db

package
v0.0.0-...-fc28805 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(ctx context.Context, dbURL string) (*pgxpool.Pool, error)

Connect establishes a connection pool to the database

Types

type Comment

type Comment struct {
	CommentID int32              `json:"commentId"`
	TodoID    int32              `json:"todoId"`
	UserID    int32              `json:"userId"`
	Content   string             `json:"content"`
	CreatedAt pgtype.Timestamptz `json:"createdAt"`
	UpdatedAt pgtype.Timestamptz `json:"updatedAt"`
}

type CreateCommentParams

type CreateCommentParams struct {
	TodoID  int32  `json:"todoId"`
	UserID  int32  `json:"userId"`
	Content string `json:"content"`
}

type CreateNotificationParams

type CreateNotificationParams struct {
	TodoID           int32              `json:"todoId"`
	UserID           int32              `json:"userId"`
	ScheduledFor     pgtype.Timestamptz `json:"scheduledFor"`
	NotificationType pgtype.Text        `json:"notificationType"`
}

type CreateProjectParams

type CreateProjectParams struct {
	UserID          int32       `json:"userId"`
	ParentProjectID pgtype.Int4 `json:"parentProjectId"`
	Name            string      `json:"name"`
	Description     pgtype.Text `json:"description"`
	Color           pgtype.Text `json:"color"`
}

type CreatePushSubscriptionParams

type CreatePushSubscriptionParams struct {
	UserID    int32  `json:"userId"`
	Endpoint  string `json:"endpoint"`
	P256dhKey string `json:"p256dhKey"`
	AuthKey   string `json:"authKey"`
}

type CreateRefreshTokenParams

type CreateRefreshTokenParams struct {
	UserID    int32              `json:"userId"`
	TokenHash string             `json:"tokenHash"`
	ExpiresAt pgtype.Timestamptz `json:"expiresAt"`
}

type CreateTagParams

type CreateTagParams struct {
	UserID int32       `json:"userId"`
	Name   string      `json:"name"`
	Color  pgtype.Text `json:"color"`
}

type CreateTodoFromTemplateParams

type CreateTodoFromTemplateParams struct {
	UserID        int32              `json:"userId"`
	TemplateID    int32              `json:"templateId"`
	ParentTodoID  pgtype.Int4        `json:"parentTodoId"`
	ScheduledDate pgtype.Timestamptz `json:"scheduledDate"`
}

type CreateTodoParams

type CreateTodoParams struct {
	UserID         int32              `json:"userId"`
	TemplateID     pgtype.Int4        `json:"templateId"`
	ProjectID      pgtype.Int4        `json:"projectId"`
	ParentTodoID   pgtype.Int4        `json:"parentTodoId"`
	Title          string             `json:"title"`
	Description    pgtype.Text        `json:"description"`
	ScheduledDate  pgtype.Timestamptz `json:"scheduledDate"`
	DurationMin    pgtype.Int4        `json:"durationMin"`
	Priority       pgtype.Int4        `json:"priority"`
	IsModified     pgtype.Bool        `json:"isModified"`
	ModifiedFields []byte             `json:"modifiedFields"`
}

type CreateTodoTagParams

type CreateTodoTagParams struct {
	TodoID int32 `json:"todoId"`
	TagID  int32 `json:"tagId"`
}

type CreateTodoTemplateParams

type CreateTodoTemplateParams struct {
	UserID      int32              `json:"userId"`
	ProjectID   pgtype.Int4        `json:"projectId"`
	Title       string             `json:"title"`
	Description pgtype.Text        `json:"description"`
	DurationMin pgtype.Int4        `json:"durationMin"`
	Priority    pgtype.Int4        `json:"priority"`
	Rrule       string             `json:"rrule"`
	Dtstart     pgtype.Timestamptz `json:"dtstart"`
	UntilDate   pgtype.Timestamptz `json:"untilDate"`
	IsActive    pgtype.Bool        `json:"isActive"`
}

type CreateUserParams

type CreateUserParams struct {
	Email             string      `json:"email"`
	PasswordHash      pgtype.Text `json:"passwordHash"`
	GoogleID          pgtype.Text `json:"googleId"`
	ProfilePictureUrl pgtype.Text `json:"profilePictureUrl"`
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type DeletePushSubscriptionParams

type DeletePushSubscriptionParams struct {
	UserID   int32  `json:"userId"`
	Endpoint string `json:"endpoint"`
}

type DeleteTodoTagParams

type DeleteTodoTagParams struct {
	TodoID int32 `json:"todoId"`
	TagID  int32 `json:"tagId"`
}

type GetNotificationsWithTodoAndSubscriptionsParams

type GetNotificationsWithTodoAndSubscriptionsParams struct {
	ScheduledFor   pgtype.Timestamptz `json:"scheduledFor"`
	ScheduledFor_2 pgtype.Timestamptz `json:"scheduledFor2"`
}

type GetNotificationsWithTodoAndSubscriptionsRow

type GetNotificationsWithTodoAndSubscriptionsRow struct {
	NotificationID    int32              `json:"notificationId"`
	TodoID            int32              `json:"todoId"`
	UserID            int32              `json:"userId"`
	ScheduledFor      pgtype.Timestamptz `json:"scheduledFor"`
	NotificationType  pgtype.Text        `json:"notificationType"`
	Sent              pgtype.Bool        `json:"sent"`
	CreatedAt         pgtype.Timestamptz `json:"createdAt"`
	TodoTitle         string             `json:"todoTitle"`
	TodoDescription   pgtype.Text        `json:"todoDescription"`
	TodoScheduledDate pgtype.Timestamptz `json:"todoScheduledDate"`
	TodoDurationMin   pgtype.Int4        `json:"todoDurationMin"`
	TodoPriority      pgtype.Int4        `json:"todoPriority"`
	SubscriptionID    int32              `json:"subscriptionId"`
	Endpoint          string             `json:"endpoint"`
	P256dhKey         string             `json:"p256dhKey"`
	AuthKey           string             `json:"authKey"`
}

type GetTagByNameParams

type GetTagByNameParams struct {
	UserID int32  `json:"userId"`
	Name   string `json:"name"`
}

type GetUnsentNotificationsInRangeParams

type GetUnsentNotificationsInRangeParams struct {
	ScheduledFor   pgtype.Timestamptz `json:"scheduledFor"`
	ScheduledFor_2 pgtype.Timestamptz `json:"scheduledFor2"`
}

type ListProjectsByParentParams

type ListProjectsByParentParams struct {
	UserID          int32       `json:"userId"`
	ParentProjectID pgtype.Int4 `json:"parentProjectId"`
}

type ListTodosByCompletionParams

type ListTodosByCompletionParams struct {
	UserID      int32       `json:"userId"`
	IsCompleted pgtype.Bool `json:"isCompleted"`
}

type ListTodosByParentParams

type ListTodosByParentParams struct {
	UserID       int32       `json:"userId"`
	ParentTodoID pgtype.Int4 `json:"parentTodoId"`
}

type ListTodosByProjectAndCompletionParams

type ListTodosByProjectAndCompletionParams struct {
	UserID      int32       `json:"userId"`
	ProjectID   pgtype.Int4 `json:"projectId"`
	IsCompleted pgtype.Bool `json:"isCompleted"`
}

type ListTodosByProjectParams

type ListTodosByProjectParams struct {
	UserID    int32       `json:"userId"`
	ProjectID pgtype.Int4 `json:"projectId"`
}

type ListTodosByTemplateParams

type ListTodosByTemplateParams struct {
	UserID     int32       `json:"userId"`
	TemplateID pgtype.Int4 `json:"templateId"`
}

type ListTodosForDateRangeParams

type ListTodosForDateRangeParams struct {
	UserID          int32              `json:"userId"`
	ScheduledDate   pgtype.Timestamptz `json:"scheduledDate"`
	ScheduledDate_2 pgtype.Timestamptz `json:"scheduledDate2"`
}

type MarkSubscriptionInactiveParams

type MarkSubscriptionInactiveParams struct {
	UserID   int32  `json:"userId"`
	Endpoint string `json:"endpoint"`
}

type NotificationQueue

type NotificationQueue struct {
	NotificationID   int32              `json:"notificationId"`
	TodoID           int32              `json:"todoId"`
	UserID           int32              `json:"userId"`
	ScheduledFor     pgtype.Timestamptz `json:"scheduledFor"`
	NotificationType pgtype.Text        `json:"notificationType"`
	Sent             pgtype.Bool        `json:"sent"`
	CreatedAt        pgtype.Timestamptz `json:"createdAt"`
}

type Project

type Project struct {
	ProjectID       int32              `json:"projectId"`
	UserID          int32              `json:"userId"`
	ParentProjectID pgtype.Int4        `json:"parentProjectId"`
	Name            string             `json:"name"`
	Description     pgtype.Text        `json:"description"`
	Color           pgtype.Text        `json:"color"`
	CreatedAt       pgtype.Timestamptz `json:"createdAt"`
	UpdatedAt       pgtype.Timestamptz `json:"updatedAt"`
}

type PushSubscription

type PushSubscription struct {
	ID        int32              `json:"id"`
	UserID    int32              `json:"userId"`
	Endpoint  string             `json:"endpoint"`
	P256dhKey string             `json:"p256dhKey"`
	AuthKey   string             `json:"authKey"`
	CreatedAt pgtype.Timestamptz `json:"createdAt"`
	UpdatedAt pgtype.Timestamptz `json:"updatedAt"`
	IsActive  pgtype.Bool        `json:"isActive"`
}

type Querier

type Querier interface {
	CleanupExpiredRefreshTokens(ctx context.Context) error
	CleanupOldSubscriptions(ctx context.Context) error
	CompleteTodo(ctx context.Context, todoID int32) (Todo, error)
	CreateComment(ctx context.Context, arg CreateCommentParams) (Comment, error)
	CreateNotification(ctx context.Context, arg CreateNotificationParams) (NotificationQueue, error)
	CreateProject(ctx context.Context, arg CreateProjectParams) (Project, error)
	CreatePushSubscription(ctx context.Context, arg CreatePushSubscriptionParams) (PushSubscription, error)
	CreateRefreshToken(ctx context.Context, arg CreateRefreshTokenParams) (RefreshToken, error)
	CreateTag(ctx context.Context, arg CreateTagParams) (Tag, error)
	CreateTodo(ctx context.Context, arg CreateTodoParams) (Todo, error)
	CreateTodoFromTemplate(ctx context.Context, arg CreateTodoFromTemplateParams) (Todo, error)
	CreateTodoTag(ctx context.Context, arg CreateTodoTagParams) error
	// Template-related queries
	CreateTodoTemplate(ctx context.Context, arg CreateTodoTemplateParams) (TodoTemplate, error)
	CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
	DeleteAllTagTodos(ctx context.Context, tagID int32) error
	DeleteAllTodoTags(ctx context.Context, todoID int32) error
	DeleteComment(ctx context.Context, commentID int32) error
	DeleteNotification(ctx context.Context, notificationID int32) error
	DeleteProject(ctx context.Context, projectID int32) error
	DeletePushSubscription(ctx context.Context, arg DeletePushSubscriptionParams) error
	DeleteTag(ctx context.Context, tagID int32) error
	DeleteTodo(ctx context.Context, todoID int32) error
	DeleteTodoTag(ctx context.Context, arg DeleteTodoTagParams) error
	DeleteTodoTemplate(ctx context.Context, templateID int32) error
	DeleteUser(ctx context.Context, userID int32) error
	GetComment(ctx context.Context, commentID int32) (Comment, error)
	GetNotificationsWithTodoAndSubscriptions(ctx context.Context, arg GetNotificationsWithTodoAndSubscriptionsParams) ([]GetNotificationsWithTodoAndSubscriptionsRow, error)
	GetPendingNotifications(ctx context.Context) ([]NotificationQueue, error)
	GetProject(ctx context.Context, projectID int32) (Project, error)
	GetRefreshToken(ctx context.Context, tokenHash string) (RefreshToken, error)
	GetTag(ctx context.Context, tagID int32) (Tag, error)
	GetTagByName(ctx context.Context, arg GetTagByNameParams) (Tag, error)
	GetTagTodos(ctx context.Context, tagID int32) ([]TodoTag, error)
	GetTodo(ctx context.Context, todoID int32) (Todo, error)
	GetTodoTags(ctx context.Context, todoID int32) ([]TodoTag, error)
	GetTodoTemplate(ctx context.Context, templateID int32) (TodoTemplate, error)
	GetUnsentNotificationsInRange(ctx context.Context, arg GetUnsentNotificationsInRangeParams) ([]NotificationQueue, error)
	GetUser(ctx context.Context, userID int32) (User, error)
	GetUserByEmail(ctx context.Context, email string) (User, error)
	GetUserByGoogleID(ctx context.Context, googleID pgtype.Text) (User, error)
	GetUserPushSubscriptions(ctx context.Context, userID int32) ([]PushSubscription, error)
	GetUserRefreshTokens(ctx context.Context, userID int32) ([]RefreshToken, error)
	ListComments(ctx context.Context, todoID int32) ([]Comment, error)
	ListCommentsByUser(ctx context.Context, userID int32) ([]Comment, error)
	ListCompletedTodos(ctx context.Context, userID int32) ([]Todo, error)
	ListPendingTodos(ctx context.Context, userID int32) ([]Todo, error)
	ListProjects(ctx context.Context, userID int32) ([]Project, error)
	ListProjectsByParent(ctx context.Context, arg ListProjectsByParentParams) ([]Project, error)
	ListTags(ctx context.Context, userID int32) ([]Tag, error)
	ListTodoTagsByTodo(ctx context.Context, todoID int32) ([]Tag, error)
	ListTodoTemplates(ctx context.Context, userID int32) ([]TodoTemplate, error)
	ListTodos(ctx context.Context, userID int32) ([]Todo, error)
	ListTodosByCompletion(ctx context.Context, arg ListTodosByCompletionParams) ([]Todo, error)
	ListTodosByParent(ctx context.Context, arg ListTodosByParentParams) ([]Todo, error)
	ListTodosByProject(ctx context.Context, arg ListTodosByProjectParams) ([]Todo, error)
	ListTodosByProjectAndCompletion(ctx context.Context, arg ListTodosByProjectAndCompletionParams) ([]Todo, error)
	ListTodosByTag(ctx context.Context, tagID int32) ([]Todo, error)
	ListTodosByTemplate(ctx context.Context, arg ListTodosByTemplateParams) ([]Todo, error)
	ListTodosForDateRange(ctx context.Context, arg ListTodosForDateRangeParams) ([]Todo, error)
	ListUsers(ctx context.Context) ([]User, error)
	MarkNotificationSent(ctx context.Context, notificationID int32) error
	MarkSubscriptionInactive(ctx context.Context, arg MarkSubscriptionInactiveParams) error
	RevokeAllUserRefreshTokens(ctx context.Context, userID int32) error
	RevokeRefreshToken(ctx context.Context, tokenHash string) error
	UncompleteTodo(ctx context.Context, todoID int32) (Todo, error)
	UpdateComment(ctx context.Context, arg UpdateCommentParams) (Comment, error)
	UpdateNotificationSchedule(ctx context.Context, arg UpdateNotificationScheduleParams) (int64, error)
	UpdateProject(ctx context.Context, arg UpdateProjectParams) (Project, error)
	UpdateRefreshTokenLastUsed(ctx context.Context, tokenHash string) error
	UpdateTag(ctx context.Context, arg UpdateTagParams) (Tag, error)
	UpdateTodo(ctx context.Context, arg UpdateTodoParams) (Todo, error)
	UpdateTodoTemplate(ctx context.Context, arg UpdateTodoTemplateParams) error
	UpdateUser(ctx context.Context, arg UpdateUserParams) (User, error)
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) CleanupExpiredRefreshTokens

func (q *Queries) CleanupExpiredRefreshTokens(ctx context.Context) error

func (*Queries) CleanupOldSubscriptions

func (q *Queries) CleanupOldSubscriptions(ctx context.Context) error

func (*Queries) CompleteTodo

func (q *Queries) CompleteTodo(ctx context.Context, todoID int32) (Todo, error)

func (*Queries) CreateComment

func (q *Queries) CreateComment(ctx context.Context, arg CreateCommentParams) (Comment, error)

func (*Queries) CreateNotification

func (q *Queries) CreateNotification(ctx context.Context, arg CreateNotificationParams) (NotificationQueue, error)

func (*Queries) CreateProject

func (q *Queries) CreateProject(ctx context.Context, arg CreateProjectParams) (Project, error)

func (*Queries) CreatePushSubscription

func (q *Queries) CreatePushSubscription(ctx context.Context, arg CreatePushSubscriptionParams) (PushSubscription, error)

func (*Queries) CreateRefreshToken

func (q *Queries) CreateRefreshToken(ctx context.Context, arg CreateRefreshTokenParams) (RefreshToken, error)

func (*Queries) CreateTag

func (q *Queries) CreateTag(ctx context.Context, arg CreateTagParams) (Tag, error)

func (*Queries) CreateTodo

func (q *Queries) CreateTodo(ctx context.Context, arg CreateTodoParams) (Todo, error)

func (*Queries) CreateTodoFromTemplate

func (q *Queries) CreateTodoFromTemplate(ctx context.Context, arg CreateTodoFromTemplateParams) (Todo, error)

func (*Queries) CreateTodoTag

func (q *Queries) CreateTodoTag(ctx context.Context, arg CreateTodoTagParams) error

func (*Queries) CreateTodoTemplate

func (q *Queries) CreateTodoTemplate(ctx context.Context, arg CreateTodoTemplateParams) (TodoTemplate, error)

Template-related queries

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)

func (*Queries) DeleteAllTagTodos

func (q *Queries) DeleteAllTagTodos(ctx context.Context, tagID int32) error

func (*Queries) DeleteAllTodoTags

func (q *Queries) DeleteAllTodoTags(ctx context.Context, todoID int32) error

func (*Queries) DeleteComment

func (q *Queries) DeleteComment(ctx context.Context, commentID int32) error

func (*Queries) DeleteNotification

func (q *Queries) DeleteNotification(ctx context.Context, notificationID int32) error

func (*Queries) DeleteProject

func (q *Queries) DeleteProject(ctx context.Context, projectID int32) error

func (*Queries) DeletePushSubscription

func (q *Queries) DeletePushSubscription(ctx context.Context, arg DeletePushSubscriptionParams) error

func (*Queries) DeleteTag

func (q *Queries) DeleteTag(ctx context.Context, tagID int32) error

func (*Queries) DeleteTodo

func (q *Queries) DeleteTodo(ctx context.Context, todoID int32) error

func (*Queries) DeleteTodoTag

func (q *Queries) DeleteTodoTag(ctx context.Context, arg DeleteTodoTagParams) error

func (*Queries) DeleteTodoTemplate

func (q *Queries) DeleteTodoTemplate(ctx context.Context, templateID int32) error

func (*Queries) DeleteUser

func (q *Queries) DeleteUser(ctx context.Context, userID int32) error

func (*Queries) GetComment

func (q *Queries) GetComment(ctx context.Context, commentID int32) (Comment, error)

func (*Queries) GetPendingNotifications

func (q *Queries) GetPendingNotifications(ctx context.Context) ([]NotificationQueue, error)

func (*Queries) GetProject

func (q *Queries) GetProject(ctx context.Context, projectID int32) (Project, error)

func (*Queries) GetRefreshToken

func (q *Queries) GetRefreshToken(ctx context.Context, tokenHash string) (RefreshToken, error)

func (*Queries) GetTag

func (q *Queries) GetTag(ctx context.Context, tagID int32) (Tag, error)

func (*Queries) GetTagByName

func (q *Queries) GetTagByName(ctx context.Context, arg GetTagByNameParams) (Tag, error)

func (*Queries) GetTagTodos

func (q *Queries) GetTagTodos(ctx context.Context, tagID int32) ([]TodoTag, error)

func (*Queries) GetTodo

func (q *Queries) GetTodo(ctx context.Context, todoID int32) (Todo, error)

func (*Queries) GetTodoTags

func (q *Queries) GetTodoTags(ctx context.Context, todoID int32) ([]TodoTag, error)

func (*Queries) GetTodoTemplate

func (q *Queries) GetTodoTemplate(ctx context.Context, templateID int32) (TodoTemplate, error)

func (*Queries) GetUnsentNotificationsInRange

func (q *Queries) GetUnsentNotificationsInRange(ctx context.Context, arg GetUnsentNotificationsInRangeParams) ([]NotificationQueue, error)

func (*Queries) GetUser

func (q *Queries) GetUser(ctx context.Context, userID int32) (User, error)

func (*Queries) GetUserByEmail

func (q *Queries) GetUserByEmail(ctx context.Context, email string) (User, error)

func (*Queries) GetUserByGoogleID

func (q *Queries) GetUserByGoogleID(ctx context.Context, googleID pgtype.Text) (User, error)

func (*Queries) GetUserPushSubscriptions

func (q *Queries) GetUserPushSubscriptions(ctx context.Context, userID int32) ([]PushSubscription, error)

func (*Queries) GetUserRefreshTokens

func (q *Queries) GetUserRefreshTokens(ctx context.Context, userID int32) ([]RefreshToken, error)

func (*Queries) ListComments

func (q *Queries) ListComments(ctx context.Context, todoID int32) ([]Comment, error)

func (*Queries) ListCommentsByUser

func (q *Queries) ListCommentsByUser(ctx context.Context, userID int32) ([]Comment, error)

func (*Queries) ListCompletedTodos

func (q *Queries) ListCompletedTodos(ctx context.Context, userID int32) ([]Todo, error)

func (*Queries) ListPendingTodos

func (q *Queries) ListPendingTodos(ctx context.Context, userID int32) ([]Todo, error)

func (*Queries) ListProjects

func (q *Queries) ListProjects(ctx context.Context, userID int32) ([]Project, error)

func (*Queries) ListProjectsByParent

func (q *Queries) ListProjectsByParent(ctx context.Context, arg ListProjectsByParentParams) ([]Project, error)

func (*Queries) ListTags

func (q *Queries) ListTags(ctx context.Context, userID int32) ([]Tag, error)

func (*Queries) ListTodoTagsByTodo

func (q *Queries) ListTodoTagsByTodo(ctx context.Context, todoID int32) ([]Tag, error)

func (*Queries) ListTodoTemplates

func (q *Queries) ListTodoTemplates(ctx context.Context, userID int32) ([]TodoTemplate, error)

func (*Queries) ListTodos

func (q *Queries) ListTodos(ctx context.Context, userID int32) ([]Todo, error)

func (*Queries) ListTodosByCompletion

func (q *Queries) ListTodosByCompletion(ctx context.Context, arg ListTodosByCompletionParams) ([]Todo, error)

func (*Queries) ListTodosByParent

func (q *Queries) ListTodosByParent(ctx context.Context, arg ListTodosByParentParams) ([]Todo, error)

func (*Queries) ListTodosByProject

func (q *Queries) ListTodosByProject(ctx context.Context, arg ListTodosByProjectParams) ([]Todo, error)

func (*Queries) ListTodosByProjectAndCompletion

func (q *Queries) ListTodosByProjectAndCompletion(ctx context.Context, arg ListTodosByProjectAndCompletionParams) ([]Todo, error)

func (*Queries) ListTodosByTag

func (q *Queries) ListTodosByTag(ctx context.Context, tagID int32) ([]Todo, error)

func (*Queries) ListTodosByTemplate

func (q *Queries) ListTodosByTemplate(ctx context.Context, arg ListTodosByTemplateParams) ([]Todo, error)

func (*Queries) ListTodosForDateRange

func (q *Queries) ListTodosForDateRange(ctx context.Context, arg ListTodosForDateRangeParams) ([]Todo, error)

func (*Queries) ListUsers

func (q *Queries) ListUsers(ctx context.Context) ([]User, error)

func (*Queries) MarkNotificationSent

func (q *Queries) MarkNotificationSent(ctx context.Context, notificationID int32) error

func (*Queries) MarkSubscriptionInactive

func (q *Queries) MarkSubscriptionInactive(ctx context.Context, arg MarkSubscriptionInactiveParams) error

func (*Queries) RevokeAllUserRefreshTokens

func (q *Queries) RevokeAllUserRefreshTokens(ctx context.Context, userID int32) error

func (*Queries) RevokeRefreshToken

func (q *Queries) RevokeRefreshToken(ctx context.Context, tokenHash string) error

func (*Queries) UncompleteTodo

func (q *Queries) UncompleteTodo(ctx context.Context, todoID int32) (Todo, error)

func (*Queries) UpdateComment

func (q *Queries) UpdateComment(ctx context.Context, arg UpdateCommentParams) (Comment, error)

func (*Queries) UpdateNotificationSchedule

func (q *Queries) UpdateNotificationSchedule(ctx context.Context, arg UpdateNotificationScheduleParams) (int64, error)

func (*Queries) UpdateProject

func (q *Queries) UpdateProject(ctx context.Context, arg UpdateProjectParams) (Project, error)

func (*Queries) UpdateRefreshTokenLastUsed

func (q *Queries) UpdateRefreshTokenLastUsed(ctx context.Context, tokenHash string) error

func (*Queries) UpdateTag

func (q *Queries) UpdateTag(ctx context.Context, arg UpdateTagParams) (Tag, error)

func (*Queries) UpdateTodo

func (q *Queries) UpdateTodo(ctx context.Context, arg UpdateTodoParams) (Todo, error)

func (*Queries) UpdateTodoTemplate

func (q *Queries) UpdateTodoTemplate(ctx context.Context, arg UpdateTodoTemplateParams) error

func (*Queries) UpdateUser

func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) (User, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type RefreshToken

type RefreshToken struct {
	TokenID    int32              `json:"tokenId"`
	UserID     int32              `json:"userId"`
	TokenHash  string             `json:"tokenHash"`
	ExpiresAt  pgtype.Timestamptz `json:"expiresAt"`
	CreatedAt  pgtype.Timestamptz `json:"createdAt"`
	LastUsedAt pgtype.Timestamptz `json:"lastUsedAt"`
	IsRevoked  pgtype.Bool        `json:"isRevoked"`
}

type Tag

type Tag struct {
	TagID     int32              `json:"tagId"`
	UserID    int32              `json:"userId"`
	Name      string             `json:"name"`
	Color     pgtype.Text        `json:"color"`
	CreatedAt pgtype.Timestamptz `json:"createdAt"`
}

type TemplateTag

type TemplateTag struct {
	TemplateID int32 `json:"templateId"`
	TagID      int32 `json:"tagId"`
}

type Todo

type Todo struct {
	TodoID         int32              `json:"todoId"`
	UserID         int32              `json:"userId"`
	TemplateID     pgtype.Int4        `json:"templateId"`
	ProjectID      pgtype.Int4        `json:"projectId"`
	ParentTodoID   pgtype.Int4        `json:"parentTodoId"`
	Title          string             `json:"title"`
	Description    pgtype.Text        `json:"description"`
	IsCompleted    pgtype.Bool        `json:"isCompleted"`
	ScheduledDate  pgtype.Timestamptz `json:"scheduledDate"`
	DurationMin    pgtype.Int4        `json:"durationMin"`
	Priority       pgtype.Int4        `json:"priority"`
	IsModified     pgtype.Bool        `json:"isModified"`
	ModifiedFields []byte             `json:"modifiedFields"`
	CreatedAt      pgtype.Timestamptz `json:"createdAt"`
	UpdatedAt      pgtype.Timestamptz `json:"updatedAt"`
	CompletedAt    pgtype.Timestamptz `json:"completedAt"`
}

type TodoTag

type TodoTag struct {
	TodoID int32 `json:"todoId"`
	TagID  int32 `json:"tagId"`
}

type TodoTemplate

type TodoTemplate struct {
	TemplateID  int32              `json:"templateId"`
	UserID      int32              `json:"userId"`
	ProjectID   pgtype.Int4        `json:"projectId"`
	Title       string             `json:"title"`
	Description pgtype.Text        `json:"description"`
	DurationMin pgtype.Int4        `json:"durationMin"`
	Priority    pgtype.Int4        `json:"priority"`
	Rrule       string             `json:"rrule"`
	Dtstart     pgtype.Timestamptz `json:"dtstart"`
	UntilDate   pgtype.Timestamptz `json:"untilDate"`
	IsActive    pgtype.Bool        `json:"isActive"`
	CreatedAt   pgtype.Timestamptz `json:"createdAt"`
	UpdatedAt   pgtype.Timestamptz `json:"updatedAt"`
}

type UpdateCommentParams

type UpdateCommentParams struct {
	CommentID int32  `json:"commentId"`
	Content   string `json:"content"`
}

type UpdateNotificationScheduleParams

type UpdateNotificationScheduleParams struct {
	TodoID       int32              `json:"todoId"`
	ScheduledFor pgtype.Timestamptz `json:"scheduledFor"`
}

type UpdateProjectParams

type UpdateProjectParams struct {
	ProjectID       int32       `json:"projectId"`
	ParentProjectID pgtype.Int4 `json:"parentProjectId"`
	Name            string      `json:"name"`
	Description     pgtype.Text `json:"description"`
	Color           pgtype.Text `json:"color"`
}

type UpdateTagParams

type UpdateTagParams struct {
	TagID int32       `json:"tagId"`
	Name  string      `json:"name"`
	Color pgtype.Text `json:"color"`
}

type UpdateTodoParams

type UpdateTodoParams struct {
	TodoID         int32              `json:"todoId"`
	TemplateID     pgtype.Int4        `json:"templateId"`
	ProjectID      pgtype.Int4        `json:"projectId"`
	ParentTodoID   pgtype.Int4        `json:"parentTodoId"`
	Title          string             `json:"title"`
	Description    pgtype.Text        `json:"description"`
	ScheduledDate  pgtype.Timestamptz `json:"scheduledDate"`
	DurationMin    pgtype.Int4        `json:"durationMin"`
	Priority       pgtype.Int4        `json:"priority"`
	IsCompleted    pgtype.Bool        `json:"isCompleted"`
	IsModified     pgtype.Bool        `json:"isModified"`
	ModifiedFields []byte             `json:"modifiedFields"`
	CompletedAt    pgtype.Timestamptz `json:"completedAt"`
}

type UpdateTodoTemplateParams

type UpdateTodoTemplateParams struct {
	TemplateID  int32              `json:"templateId"`
	ProjectID   pgtype.Int4        `json:"projectId"`
	Title       string             `json:"title"`
	Description pgtype.Text        `json:"description"`
	DurationMin pgtype.Int4        `json:"durationMin"`
	Priority    pgtype.Int4        `json:"priority"`
	Rrule       string             `json:"rrule"`
	Dtstart     pgtype.Timestamptz `json:"dtstart"`
	UntilDate   pgtype.Timestamptz `json:"untilDate"`
	IsActive    pgtype.Bool        `json:"isActive"`
}

type UpdateUserParams

type UpdateUserParams struct {
	UserID            int32       `json:"userId"`
	Email             string      `json:"email"`
	PasswordHash      pgtype.Text `json:"passwordHash"`
	GoogleID          pgtype.Text `json:"googleId"`
	ProfilePictureUrl pgtype.Text `json:"profilePictureUrl"`
}

type User

type User struct {
	UserID            int32              `json:"userId"`
	Email             string             `json:"email"`
	PasswordHash      pgtype.Text        `json:"passwordHash"`
	GoogleID          pgtype.Text        `json:"googleId"`
	ProfilePictureUrl pgtype.Text        `json:"profilePictureUrl"`
	CreatedAt         pgtype.Timestamptz `json:"createdAt"`
	UpdatedAt         pgtype.Timestamptz `json:"updatedAt"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL