sqlc

package
v0.0.0-...-afc6299 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2025 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 CreateShareParams

type CreateShareParams struct {
	UserID             pgtype.UUID
	AmountCurrencyCode string
	PaidAmountUnits    int64
	PaidAmountNanos    int32
	OwedAmountUnits    int64
	OwedAmountNanos    int64
	TransactionID      pgtype.UUID
}

type CreateTransactionParams

type CreateTransactionParams struct {
	Type             NullTransactionType
	LastUpdatingUser pgtype.UUID
}

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 GetTransactionAndSharesRow

type GetTransactionAndSharesRow struct {
	ID                 pgtype.UUID
	LastUpdatingUser   pgtype.UUID
	Type               NullTransactionType
	CreatedAt          pgtype.Timestamptz
	UpdatedAt          pgtype.Timestamptz
	ID_2               pgtype.UUID
	UserID             pgtype.UUID
	AmountCurrencyCode string
	PaidAmountUnits    int64
	PaidAmountNanos    int32
	OwedAmountUnits    int64
	OwedAmountNanos    int64
	TransactionID      pgtype.UUID
	CreatedAt_2        pgtype.Timestamptz
	UpdatedAt_2        pgtype.Timestamptz
}

type NullTransactionType

type NullTransactionType struct {
	TransactionType TransactionType
	Valid           bool // Valid is true if TransactionType is not NULL
}

func (*NullTransactionType) Scan

func (ns *NullTransactionType) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullTransactionType) Value

func (ns NullTransactionType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateShare

func (q *Queries) CreateShare(ctx context.Context, arg CreateShareParams) (Share, error)

func (*Queries) CreateTransaction

func (q *Queries) CreateTransaction(ctx context.Context, arg CreateTransactionParams) (Transaction, error)

func (*Queries) GetTransactionAndShares

func (q *Queries) GetTransactionAndShares(ctx context.Context, id pgtype.UUID) ([]GetTransactionAndSharesRow, error)

func (*Queries) WithTx

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

type Share

type Share struct {
	ID                 pgtype.UUID
	UserID             pgtype.UUID
	AmountCurrencyCode string
	PaidAmountUnits    int64
	PaidAmountNanos    int32
	OwedAmountUnits    int64
	OwedAmountNanos    int64
	TransactionID      pgtype.UUID
	CreatedAt          pgtype.Timestamptz
	UpdatedAt          pgtype.Timestamptz
}

type Transaction

type Transaction struct {
	ID               pgtype.UUID
	LastUpdatingUser pgtype.UUID
	Type             NullTransactionType
	CreatedAt        pgtype.Timestamptz
	UpdatedAt        pgtype.Timestamptz
}

type TransactionType

type TransactionType string
const (
	TransactionTypePayment    TransactionType = "payment"
	TransactionTypeSettlement TransactionType = "settlement"
)

func (*TransactionType) Scan

func (e *TransactionType) Scan(src interface{}) error

Jump to

Keyboard shortcuts

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