dbc

package
v0.0.0-...-1d59f67 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID    uuid.UUID
	Email string
}

type Config

type Config struct {
	ID            uuid.UUID
	Slug          string
	ConfigSection []byte
	UpdatedAt     time.Time
}

type CreatePersonParams

type CreatePersonParams struct {
	AccountID uuid.UUID
	FirstName string
	LastName  string
}

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 GetAccountsByEmailRow

type GetAccountsByEmailRow struct {
	ID        uuid.UUID
	Email     string
	PersonID  uuid.UUID
	FirstName pgtype.Text
	LastName  pgtype.Text
}

type Person

type Person struct {
	ID        uuid.UUID
	AccountID uuid.UUID
	FirstName string
	LastName  string
}

type Querier

type Querier interface {
	ConfigsGet(ctx context.Context, slugs string) ([][]byte, error)
	CreateAccount(ctx context.Context, email string) (uuid.UUID, error)
	CreatePerson(ctx context.Context, arg CreatePersonParams) (uuid.UUID, error)
	GetAccountsByEmail(ctx context.Context, emails []string) ([]*GetAccountsByEmailRow, error)
	SaveConfig(ctx context.Context, arg SaveConfigParams) error
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) ConfigsGet

func (q *Queries) ConfigsGet(ctx context.Context, slugs string) ([][]byte, error)

func (*Queries) CreateAccount

func (q *Queries) CreateAccount(ctx context.Context, email string) (uuid.UUID, error)

func (*Queries) CreatePerson

func (q *Queries) CreatePerson(ctx context.Context, arg CreatePersonParams) (uuid.UUID, error)

func (*Queries) GetAccountsByEmail

func (q *Queries) GetAccountsByEmail(ctx context.Context, emails []string) ([]*GetAccountsByEmailRow, error)

func (*Queries) SaveConfig

func (q *Queries) SaveConfig(ctx context.Context, arg SaveConfigParams) error

func (*Queries) WithTx

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

type SaveConfigParams

type SaveConfigParams struct {
	Slug          string
	ConfigSection []byte
}

Jump to

Keyboard shortcuts

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