database

package
v0.0.0-...-3885022 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddIdempotencyEntryParams

type AddIdempotencyEntryParams struct {
	UserID     uuid.UUID
	Key        string
	MethodPath string
	Request    []byte
	Response   []byte
}

type AddPetParams

type AddPetParams struct {
	Name        string
	DateOfBirth time.Time
}

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 GetIdempotencyEntryParams

type GetIdempotencyEntryParams struct {
	UserID     uuid.UUID
	Key        string
	MethodPath string
	Request    []byte
}

type Idempotency

type Idempotency struct {
	UserID     uuid.UUID
	Key        string
	MethodPath string
	Request    []byte
	Response   []byte
}

type Pet

type Pet struct {
	RowID       int32
	ID          uuid.UUID
	Name        string
	DateOfBirth time.Time
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AddIdempotencyEntry

func (q *Queries) AddIdempotencyEntry(ctx context.Context, arg AddIdempotencyEntryParams) error

func (*Queries) AddPet

func (q *Queries) AddPet(ctx context.Context, arg AddPetParams) (uuid.UUID, error)

func (*Queries) GetIdempotencyEntry

func (q *Queries) GetIdempotencyEntry(ctx context.Context, arg GetIdempotencyEntryParams) ([]byte, error)

func (*Queries) GetPetByID

func (q *Queries) GetPetByID(ctx context.Context, ids uuid.UUID) (Pet, error)

TODO: these queries that select * get more data than needed

func (*Queries) GetPetsByIDs

func (q *Queries) GetPetsByIDs(ctx context.Context, ids []uuid.UUID) ([]Pet, error)

func (*Queries) UpdateIdempotencyEntry

func (q *Queries) UpdateIdempotencyEntry(ctx context.Context, arg UpdateIdempotencyEntryParams) error

func (*Queries) UpdatePetDateOfBirth

func (q *Queries) UpdatePetDateOfBirth(ctx context.Context, arg UpdatePetDateOfBirthParams) error

func (*Queries) UpdatePetName

func (q *Queries) UpdatePetName(ctx context.Context, arg UpdatePetNameParams) error

func (*Queries) WithTx

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

type UpdateIdempotencyEntryParams

type UpdateIdempotencyEntryParams struct {
	Response   []byte
	UserID     uuid.UUID
	Key        string
	MethodPath string
	Request    []byte
}

type UpdatePetDateOfBirthParams

type UpdatePetDateOfBirthParams struct {
	ID          uuid.UUID
	DateOfBirth time.Time
}

type UpdatePetNameParams

type UpdatePetNameParams struct {
	ID   uuid.UUID
	Name string
}

Jump to

Keyboard shortcuts

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