sqlc

package
v0.0.0-...-a6a5f53 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2021 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 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 OperationType

type OperationType struct {
	ID          int32          `json:"id"`
	Description sql.NullString `json:"description"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) SaveTransaction

func (q *Queries) SaveTransaction(ctx context.Context, arg SaveTransactionParams) (string, error)

func (*Queries) WithTx

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

type SaveTransactionParams

type SaveTransactionParams struct {
	AccountID     string `json:"account_id"`
	OperationType int32  `json:"operation_type"`
	Amount        int32  `json:"amount"`
}

type Transaction

type Transaction struct {
	ID            string    `json:"id"`
	AccountID     string    `json:"account_id"`
	OperationType int32     `json:"operation_type"`
	Amount        int32     `json:"amount"`
	CreatedAt     time.Time `json:"created_at"`
	UpdatedAt     time.Time `json:"updated_at"`
}

Jump to

Keyboard shortcuts

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