sqlc

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const CreateCardBrand = `` /* 133-byte string literal not displayed */
View Source
const CreateUser = `` /* 194-byte string literal not displayed */
View Source
const DeleteCardBrand = `-- name: DeleteCardBrand :one
DELETE FROM card_brand
WHERE id = $1
RETURNING id, name, created_date, last_modified_date
`
View Source
const ExistsByLogtoUserID = `-- name: ExistsByLogtoUserID :one
SELECT EXISTS(SELECT 1 FROM "user" WHERE logto_user_id = $1)
`
View Source
const GetCardBrand = `-- name: GetCardBrand :one
SELECT id, name, created_date, last_modified_date FROM card_brand
WHERE id = $1 LIMIT 1
`
View Source
const GetUserByID = `-- name: GetUserByID :one
SELECT id, logto_user_id, created_date, last_modified_date
FROM "user"
WHERE id = $1
`
View Source
const GetUserByLogtoUserID = `` /* 131-byte string literal not displayed */
View Source
const ListCardBrands = `` /* 237-byte string literal not displayed */
View Source
const UpdateCardBrand = `` /* 129-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type Bill

type Bill struct {
	ID               uuid.UUID          `db:"id" json:"id"`
	CardID           uuid.UUID          `db:"card_id" json:"cardId"`
	Month            int16              `db:"month" json:"month"`
	Year             int16              `db:"year" json:"year"`
	DueDate          int16              `db:"due_date" json:"dueDate"`
	DueMonth         int16              `db:"due_month" json:"dueMonth"`
	Paid             *bool              `db:"paid" json:"paid"`
	PaidOn           pgtype.Date        `db:"paid_on" json:"paidOn"`
	CreatedDate      pgtype.Timestamptz `db:"created_date" json:"createdDate"`
	LastModifiedDate pgtype.Timestamptz `db:"last_modified_date" json:"lastModifiedDate"`
}

type Card

type Card struct {
	ID      uuid.UUID `db:"id" json:"id"`
	BrandID uuid.UUID `db:"brand_id" json:"brandId"`
	UserID  uuid.UUID `db:"user_id" json:"userId"`
	Name    string    `db:"name" json:"name"`
	// Last 4 digits, corresponde aos 4 últimos dígitos do número docartão
	L4d *string `db:"l4d" json:"l4d"`
	// O dia do mês que a fatura vence
	DueDate int16 `db:"due_date" json:"dueDate"`
	// O dia do mês que a fatura fecha
	ClosingDate *int16 `db:"closing_date" json:"closingDate"`
	// Exemplos: Black, Platinum, entre outros
	Tier             *string            `db:"tier" json:"tier"`
	CreatedDate      pgtype.Timestamptz `db:"created_date" json:"createdDate"`
	LastModifiedDate pgtype.Timestamptz `db:"last_modified_date" json:"lastModifiedDate"`
}

type CardBrand

type CardBrand struct {
	ID               uuid.UUID          `db:"id" json:"id"`
	Name             string             `db:"name" json:"name"`
	CreatedDate      pgtype.Timestamptz `db:"created_date" json:"createdDate"`
	LastModifiedDate pgtype.Timestamptz `db:"last_modified_date" json:"lastModifiedDate"`
}

type CardPerson

type CardPerson struct {
	CardID            uuid.UUID          `db:"card_id" json:"cardId"`
	PersonID          uuid.UUID          `db:"person_id" json:"personId"`
	DefaultPercentage *decimal.Decimal   `db:"default_percentage" json:"defaultPercentage"`
	CreatedDate       pgtype.Timestamptz `db:"created_date" json:"createdDate"`
	EndDate           pgtype.Timestamptz `db:"end_date" json:"endDate"`
}

type CreateCardBrandParams

type CreateCardBrandParams struct {
	Name string `db:"name" json:"name"`
}

type CreateUserParams added in v0.3.0

type CreateUserParams struct {
	LogtoUserID *string `db:"logto_user_id" json:"logtoUserId"`
}

type CreateUserRow added in v0.3.0

type CreateUserRow struct {
	ID               uuid.UUID          `db:"id" json:"id"`
	LogtoUserID      *string            `db:"logto_user_id" json:"logtoUserId"`
	CreatedDate      pgtype.Timestamptz `db:"created_date" json:"createdDate"`
	LastModifiedDate pgtype.Timestamptz `db:"last_modified_date" json:"lastModifiedDate"`
}

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 DeleteCardBrandParams

type DeleteCardBrandParams struct {
	ID uuid.UUID `db:"id" json:"id"`
}

type ExistsByLogtoUserIDParams added in v0.3.0

type ExistsByLogtoUserIDParams struct {
	LogtoUserID *string `db:"logto_user_id" json:"logtoUserId"`
}

type GetCardBrandParams

type GetCardBrandParams struct {
	ID uuid.UUID `db:"id" json:"id"`
}

type GetUserByIDParams added in v0.3.0

type GetUserByIDParams struct {
	ID uuid.UUID `db:"id" json:"id"`
}

type GetUserByIDRow added in v0.3.0

type GetUserByIDRow struct {
	ID               uuid.UUID          `db:"id" json:"id"`
	LogtoUserID      *string            `db:"logto_user_id" json:"logtoUserId"`
	CreatedDate      pgtype.Timestamptz `db:"created_date" json:"createdDate"`
	LastModifiedDate pgtype.Timestamptz `db:"last_modified_date" json:"lastModifiedDate"`
}

type GetUserByLogtoUserIDParams added in v0.3.0

type GetUserByLogtoUserIDParams struct {
	LogtoUserID *string `db:"logto_user_id" json:"logtoUserId"`
}

type GetUserByLogtoUserIDRow added in v0.3.0

type GetUserByLogtoUserIDRow struct {
	ID               uuid.UUID          `db:"id" json:"id"`
	LogtoUserID      *string            `db:"logto_user_id" json:"logtoUserId"`
	CreatedDate      pgtype.Timestamptz `db:"created_date" json:"createdDate"`
	LastModifiedDate pgtype.Timestamptz `db:"last_modified_date" json:"lastModifiedDate"`
}

type ListCardBrandsParams

type ListCardBrandsParams struct {
	Name *string   `db:"name" json:"name"`
	ID   uuid.UUID `db:"id" json:"id"`
}

type Person

type Person struct {
	ID               uuid.UUID          `db:"id" json:"id"`
	UserID           uuid.UUID          `db:"user_id" json:"userId"`
	Name             string             `db:"name" json:"name"`
	CreatedDate      pgtype.Timestamptz `db:"created_date" json:"createdDate"`
	LastModifiedDate pgtype.Timestamptz `db:"last_modified_date" json:"lastModifiedDate"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateCardBrand

func (q *Queries) CreateCardBrand(ctx context.Context, arg CreateCardBrandParams) (CardBrand, error)

func (*Queries) CreateUser added in v0.3.0

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

func (*Queries) DeleteCardBrand

func (q *Queries) DeleteCardBrand(ctx context.Context, arg DeleteCardBrandParams) (CardBrand, error)

func (*Queries) ExistsByLogtoUserID added in v0.3.0

func (q *Queries) ExistsByLogtoUserID(ctx context.Context, arg ExistsByLogtoUserIDParams) (bool, error)

func (*Queries) GetCardBrand

func (q *Queries) GetCardBrand(ctx context.Context, arg GetCardBrandParams) (CardBrand, error)

func (*Queries) GetUserByID added in v0.3.0

func (q *Queries) GetUserByID(ctx context.Context, arg GetUserByIDParams) (GetUserByIDRow, error)

func (*Queries) GetUserByLogtoUserID added in v0.3.0

func (q *Queries) GetUserByLogtoUserID(ctx context.Context, arg GetUserByLogtoUserIDParams) (GetUserByLogtoUserIDRow, error)

func (*Queries) ListCardBrands

func (q *Queries) ListCardBrands(ctx context.Context, arg ListCardBrandsParams) ([]CardBrand, error)

func (*Queries) UpdateCardBrand

func (q *Queries) UpdateCardBrand(ctx context.Context, arg UpdateCardBrandParams) (CardBrand, error)

func (*Queries) WithTx

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

type Transaction

type Transaction struct {
	ID     uuid.UUID `db:"id" json:"id"`
	CardID uuid.UUID `db:"card_id" json:"cardId"`
	BillID uuid.UUID `db:"bill_id" json:"billId"`
	// Identificador da transação - como consta na fatura do banco
	Identifier *string `db:"identifier" json:"identifier"`
	// Como quer identificar essa transação
	Name  *string          `db:"name" json:"name"`
	Value *decimal.Decimal `db:"value" json:"value"`
	Date  pgtype.Date      `db:"date" json:"date"`
	// Indica se a transação estará presente em mais de 1 fatura
	RecurringCharge    bool               `db:"recurring_charge" json:"recurringCharge"`
	InstallmentsNumber *int16             `db:"installments_number" json:"installmentsNumber"`
	CreatedDate        pgtype.Timestamptz `db:"created_date" json:"createdDate"`
	LastModifiedDate   pgtype.Timestamptz `db:"last_modified_date" json:"lastModifiedDate"`
}

type TransactionPerson

type TransactionPerson struct {
	PersonID        uuid.UUID          `db:"person_id" json:"personId"`
	TransactionID   uuid.UUID          `db:"transaction_id" json:"transactionId"`
	Percentage      *decimal.Decimal   `db:"percentage" json:"percentage"`
	CalculatedValue *decimal.Decimal   `db:"calculated_value" json:"calculatedValue"`
	CreatedDate     pgtype.Timestamptz `db:"created_date" json:"createdDate"`
	EndDate         pgtype.Timestamptz `db:"end_date" json:"endDate"`
}

type UpdateCardBrandParams

type UpdateCardBrandParams struct {
	Name string    `db:"name" json:"name"`
	ID   uuid.UUID `db:"id" json:"id"`
}

type User

type User struct {
	ID               uuid.UUID          `db:"id" json:"id"`
	CreatedDate      pgtype.Timestamptz `db:"created_date" json:"createdDate"`
	LastModifiedDate pgtype.Timestamptz `db:"last_modified_date" json:"lastModifiedDate"`
	LogtoUserID      *string            `db:"logto_user_id" json:"logtoUserId"`
}

Jump to

Keyboard shortcuts

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