sqlc

package
v0.0.0-...-8bac97a Latest Latest
Warning

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

Go to latest
Published: Sep 19, 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 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 GetTransactionRow

type GetTransactionRow struct {
	ID                 pgtype.UUID
	LastUpdatingUser   pgtype.UUID
	Type               NullTransactionType
	CreatedAt          pgtype.Timestamptz
	UpdatedAt          pgtype.Timestamptz
	ID_2               pgtype.UUID
	UserID             pgtype.UUID
	Direction          NullLedgerDirection
	AmountCurrencyCode string
	AmountUnits        int64
	AmountNanos        int32
	TransactionID      pgtype.UUID
	CreatedAt_2        pgtype.Timestamptz
	UpdatedAt_2        pgtype.Timestamptz
}

type Ledger

type Ledger struct {
	ID                 pgtype.UUID
	UserID             pgtype.UUID
	Direction          NullLedgerDirection
	AmountCurrencyCode string
	AmountUnits        int64
	AmountNanos        int32
	TransactionID      pgtype.UUID
	CreatedAt          pgtype.Timestamptz
	UpdatedAt          pgtype.Timestamptz
}

type LedgerDirection

type LedgerDirection string
const (
	LedgerDirectionIN  LedgerDirection = "IN"
	LedgerDirectionOUT LedgerDirection = "OUT"
)

func (*LedgerDirection) Scan

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

type NullLedgerDirection

type NullLedgerDirection struct {
	LedgerDirection LedgerDirection
	Valid           bool // Valid is true if LedgerDirection is not NULL
}

func (*NullLedgerDirection) Scan

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

Scan implements the Scanner interface.

func (NullLedgerDirection) Value

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

Value implements the driver Valuer interface.

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) GetLedger

func (q *Queries) GetLedger(ctx context.Context, id pgtype.UUID) (Ledger, error)

func (*Queries) GetTransaction

func (q *Queries) GetTransaction(ctx context.Context, id pgtype.UUID) (GetTransactionRow, error)

func (*Queries) WithTx

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

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