pq

package
v0.0.0-...-e0cd53d Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreatePageParams

type CreatePageParams struct {
	ID        uuid.UUID
	UpdatedAt time.Time
	Title     string
	Text      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 ListPageIDsParams

type ListPageIDsParams struct {
	Cursor uuid.NullUUID
	Limit  int32
}

type ListPagesParams

type ListPagesParams struct {
	Cursor uuid.NullUUID
	Limit  int32
}

type Page

type Page struct {
	ID        uuid.UUID
	UpdatedAt time.Time
	Title     string
	Text      string
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreatePage

func (q *Queries) CreatePage(ctx context.Context, arg CreatePageParams) error

func (*Queries) GetPage

func (q *Queries) GetPage(ctx context.Context, id uuid.UUID) (Page, error)

func (*Queries) ListPageIDs

func (q *Queries) ListPageIDs(ctx context.Context, arg ListPageIDsParams) ([]uuid.UUID, error)

func (*Queries) ListPages

func (q *Queries) ListPages(ctx context.Context, arg ListPagesParams) ([]Page, error)

func (*Queries) WithTx

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

Jump to

Keyboard shortcuts

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