postgres

package
v0.0.0-...-4a67540 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePool

func CreatePool(url string) (*pgxpool.Pool, error)

func NewCategoryRepository

func NewCategoryRepository(pool *pgxpool.Pool) *categoryRepository

func NewMonthCategoryRepository

func NewMonthCategoryRepository(pool *pgxpool.Pool) *monthCategoryRepository

func NewMonthRepository

func NewMonthRepository(pool *pgxpool.Pool) *monthRepository

func NewPayeeRepository

func NewPayeeRepository(pool *pgxpool.Pool) *payeeRepository

Types

type AccountRepository

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

func NewAccountRepository

func NewAccountRepository(pool *pgxpool.Pool) *AccountRepository

func (*AccountRepository) Create

func (r *AccountRepository) Create(ctx context.Context, id beans.ID, name beans.Name, budgetID beans.ID) error

func (*AccountRepository) Get

func (*AccountRepository) GetForBudget

func (r *AccountRepository) GetForBudget(ctx context.Context, budgetID beans.ID) ([]*beans.Account, error)

type BudgetRepository

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

func NewBudgetRepository

func NewBudgetRepository(pool *pgxpool.Pool) *BudgetRepository

func (*BudgetRepository) Create

func (r *BudgetRepository) Create(ctx context.Context, tx beans.Tx, id beans.ID, name beans.Name, userID beans.ID) error

func (*BudgetRepository) DB

func (r *BudgetRepository) DB(tx beans.Tx) *db.Queries

func (*BudgetRepository) Get

func (r *BudgetRepository) Get(ctx context.Context, id beans.ID) (*beans.Budget, error)

func (*BudgetRepository) GetBudgetsForUser

func (r *BudgetRepository) GetBudgetsForUser(ctx context.Context, userID beans.ID) ([]*beans.Budget, error)

type TransactionRepository

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

func NewTransactionRepository

func NewTransactionRepository(pool *pgxpool.Pool) *TransactionRepository

func (*TransactionRepository) Create

func (r *TransactionRepository) Create(ctx context.Context, transaction *beans.Transaction) error

func (*TransactionRepository) Get

func (*TransactionRepository) GetForBudget

func (r *TransactionRepository) GetForBudget(ctx context.Context, budgetID beans.ID) ([]*beans.Transaction, error)

func (*TransactionRepository) GetIncomeBetween

func (r *TransactionRepository) GetIncomeBetween(ctx context.Context, budgetID beans.ID, begin beans.Date, end beans.Date) (beans.Amount, error)

func (*TransactionRepository) Update

func (r *TransactionRepository) Update(ctx context.Context, transaction *beans.Transaction) error

type Tx

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

func (*Tx) Commit

func (t *Tx) Commit(ctx context.Context) error

func (*Tx) Rollback

func (t *Tx) Rollback(ctx context.Context) error

type TxManager

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

func NewTxManager

func NewTxManager(pool *pgxpool.Pool) *TxManager

func (*TxManager) Create

func (m *TxManager) Create(ctx context.Context) (beans.Tx, error)

type UserRepository

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

func NewUserRepository

func NewUserRepository(pool *pgxpool.Pool) *UserRepository

func (*UserRepository) Create

func (r *UserRepository) Create(ctx context.Context, id beans.ID, username beans.Username, passwordHash beans.PasswordHash) error

func (*UserRepository) Exists

func (r *UserRepository) Exists(ctx context.Context, username beans.Username) (bool, error)

func (*UserRepository) Get

func (r *UserRepository) Get(ctx context.Context, id beans.ID) (*beans.User, error)

func (*UserRepository) GetByUsername

func (r *UserRepository) GetByUsername(ctx context.Context, username beans.Username) (*beans.User, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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