db

package
v0.0.0-...-f4c426e Latest Latest
Warning

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

Go to latest
Published: Oct 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 Client

type Client struct {
	ID        uuid.UUID
	Name      string
	BrandName string
	LogoUrl   pgtype.Text
	CreatedAt pgtype.Timestamp
	UpdatedAt pgtype.Timestamp
}

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 GetClientsParams

type GetClientsParams struct {
	Limit  int32
	Offset int32
}

type GetClientsRow

type GetClientsRow struct {
	ID         uuid.UUID
	Name       string
	BrandName  string
	LogoUrl    pgtype.Text
	Total      int64
	TotalPages float64
}

type InsertClientParams

type InsertClientParams struct {
	Name      string
	BrandName string
	LogoUrl   pgtype.Text
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) DeleteClient

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

func (*Queries) FindClientById

func (q *Queries) FindClientById(ctx context.Context, id uuid.UUID) (Client, error)

func (*Queries) GetClients

func (q *Queries) GetClients(ctx context.Context, arg GetClientsParams) ([]GetClientsRow, error)

func (*Queries) InsertClient

func (q *Queries) InsertClient(ctx context.Context, arg InsertClientParams) (uuid.UUID, error)

func (*Queries) UpdateClient

func (q *Queries) UpdateClient(ctx context.Context, arg UpdateClientParams) error

func (*Queries) WithTx

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

type UpdateClientParams

type UpdateClientParams struct {
	ID        uuid.UUID
	Name      string
	BrandName string
	LogoUrl   pgtype.Text
}

Jump to

Keyboard shortcuts

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