repository

package
v0.0.0-...-37f0314 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPool

func NewPool(ctx context.Context, dsn string) (*pgxpool.Pool, error)

Types

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 Item

type Item struct {
	ID        int64     `db:"id"`
	Title     string    `db:"title"`
	UpdatedAt time.Time `db:"updated_at"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateItem

func (q *Queries) CreateItem(ctx context.Context, title string) (Item, error)

func (*Queries) GetItems

func (q *Queries) GetItems(ctx context.Context) ([]Item, error)

func (*Queries) UpdateItem

func (q *Queries) UpdateItem(ctx context.Context, arg UpdateItemParams) (Item, error)

func (*Queries) WithTx

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

type UpdateItemParams

type UpdateItemParams struct {
	ID    int64  `db:"id"`
	Title string `db:"title"`
}

Jump to

Keyboard shortcuts

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