db

package
v0.0.0-...-0a4bc02 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2022 License: MIT Imports: 6 Imported by: 0

README

Directory for SQLC

Documentation

Index

Constants

View Source
const GetAllTodos = `-- name: GetAllTodos :many
SELECT id, name, completed
FROM todos
`

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	AccountID      int32     `json:"account_id"`
	ID             string    `json:"id"`
	Name           string    `json:"name"`
	AccountNumber  string    `json:"account_number"`
	Classification string    `json:"classification"`
	DateCreated    time.Time `json:"date_created"`
	DayTrader      bool      `json:"day_trader"`
	OptionLevel    int32     `json:"option_level"`
	Status         string    `json:"status"`
	Type           string    `json:"type"`
	CreatedAt      time.Time `json:"created_at"`
}

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 Position

type Position struct {
	PositionID   int32          `json:"position_id"`
	ProfileID    sql.NullString `json:"profile_id"`
	CostBasis    pgtype.Numeric `json:"cost_basis"`
	DateAcquired sql.NullTime   `json:"date_acquired"`
	ID           sql.NullInt32  `json:"id"`
	Quantity     sql.NullInt32  `json:"quantity"`
	Symbol       sql.NullString `json:"symbol"`
}

type PositionsMaster

type PositionsMaster struct {
	ID             string         `json:"id"`
	Name           string         `json:"name"`
	Classification string         `json:"classification"`
	Symbol         sql.NullString `json:"symbol"`
	Quantity       sql.NullInt32  `json:"quantity"`
	CostBasis      pgtype.Numeric `json:"cost_basis"`
	DateAcquired   sql.NullTime   `json:"date_acquired"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) GetAllTodos

func (q *Queries) GetAllTodos(ctx context.Context) ([]Todo, error)

func (*Queries) WithTx

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

type Todo

type Todo struct {
	ID        int64        `json:"id"`
	Name      string       `json:"name"`
	Completed sql.NullBool `json:"completed"`
}

Jump to

Keyboard shortcuts

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