db_sqlc

package
v0.0.0-...-855761a Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *sql.DB

Functions

func Init

func Init()

Init initializes the database connection pool.

Types

type AddTodoParams

type AddTodoParams struct {
	Uuid  string
	Value string
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type EditTodoParams

type EditTodoParams struct {
	Value string
	Uuid  string
}

type GetTodoRow

type GetTodoRow struct {
	Uuid   string
	Value  string
	DoneAt sql.NullTime
}

type ListArchivedTodosParams

type ListArchivedTodosParams struct {
	Search string
	Limit  int32
	Offset int32
}

type ListArchivedTodosRow

type ListArchivedTodosRow struct {
	Uuid   string
	Value  string
	DoneAt sql.NullTime
}

type ListTodosParams

type ListTodosParams struct {
	Search string
	Limit  int32
	Offset int32
}

type ListTodosRow

type ListTodosRow struct {
	Uuid   string
	Value  string
	DoneAt sql.NullTime
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AddTodo

func (q *Queries) AddTodo(ctx context.Context, arg AddTodoParams) error

func (*Queries) ArchiveTodo

func (q *Queries) ArchiveTodo(ctx context.Context, uuid string) error

func (*Queries) EditTodo

func (q *Queries) EditTodo(ctx context.Context, arg EditTodoParams) error

func (*Queries) GetTodo

func (q *Queries) GetTodo(ctx context.Context, uuid string) (GetTodoRow, error)

func (*Queries) ListArchivedTodos

func (q *Queries) ListArchivedTodos(ctx context.Context, arg ListArchivedTodosParams) ([]ListArchivedTodosRow, error)

func (*Queries) ListTodos

func (q *Queries) ListTodos(ctx context.Context, arg ListTodosParams) ([]ListTodosRow, error)

func (*Queries) RestoreTodo

func (q *Queries) RestoreTodo(ctx context.Context, uuid string) error

func (*Queries) ToggleTodo

func (q *Queries) ToggleTodo(ctx context.Context, uuid string) error

func (*Queries) TotalArchivedTodos

func (q *Queries) TotalArchivedTodos(ctx context.Context, search string) (int64, error)

func (*Queries) TotalTodos

func (q *Queries) TotalTodos(ctx context.Context, search string) (int64, error)

func (*Queries) WithTx

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

type Todo

type Todo struct {
	Uuid       string
	Value      string
	CreatedAt  time.Time
	DoneAt     sql.NullTime
	Deadline   sql.NullTime
	ArchivedAt sql.NullTime
}

Jump to

Keyboard shortcuts

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