dbx

package
v0.0.0-...-21a8bdb Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: AGPL-3.0-or-later Imports: 4 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          int64
	UserID      int64
	DisplayName pgtype.Text
	Bank        string
	CreatedAt   pgtype.Timestamptz
	UpdatedAt   pgtype.Timestamptz
}

type CreateAccountParams

type CreateAccountParams struct {
	UserID      int64
	Bank        string
	DisplayName string
}

type CreateUserParams

type CreateUserParams struct {
	Name              string
	Username          string
	EncryptedPassword 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 DeleteAccountParams

type DeleteAccountParams struct {
	ID     int64
	UserID int64
}

type ListAccountsParams

type ListAccountsParams struct {
	UserID     int64
	PageOffset int32
	PageLimit  int32
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateAccount

func (q *Queries) CreateAccount(ctx context.Context, arg CreateAccountParams) (Account, error)

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)

func (*Queries) DeleteAccount

func (q *Queries) DeleteAccount(ctx context.Context, arg DeleteAccountParams) error

func (*Queries) FetchUserByUsername

func (q *Queries) FetchUserByUsername(ctx context.Context, email string) (User, error)

func (*Queries) ListAccounts

func (q *Queries) ListAccounts(ctx context.Context, arg ListAccountsParams) ([]Account, error)

func (*Queries) WithTx

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

type SchemaMigration

type SchemaMigration struct {
	Version int64
	Dirty   bool
}

type User

type User struct {
	ID                int64
	Username          pgtype.Text
	Name              string
	EncryptedPassword string
	CreatedAt         pgtype.Timestamptz
	UpdatedAt         pgtype.Timestamptz
}

type Withdrawal

type Withdrawal struct {
	ID             int64
	AccountID      int64
	AmountCents    int32
	AmountCurrency string
	TransactedAt   pgtype.Timestamptz
	CreatedAt      pgtype.Timestamptz
	UpdatedAt      pgtype.Timestamptz
}

Jump to

Keyboard shortcuts

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