database

package
v0.0.0-...-676b5a0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	DB *sql.DB
}

func InitDB

func InitDB() (*DB, error)

func (*DB) CreateMonth

func (db *DB) CreateMonth(newMonth types.MonthCreate) error

func (*DB) CreateNewBudgetsForMonth

func (db *DB) CreateNewBudgetsForMonth(monthID int) error

func (*DB) CreateTransaction

func (db *DB) CreateTransaction(tr types.TransactionCreate) error

func (*DB) DeleteTransaction

func (db *DB) DeleteTransaction(id int) error

func (*DB) GetBudgetByID

func (db *DB) GetBudgetByID(id int) (types.Budget, error)

func (*DB) GetBudgetsByMonthIDAndType

func (db *DB) GetBudgetsByMonthIDAndType(monthID int, transactionType types.TransactionType) ([]types.Budget, error)

func (*DB) GetMonthByID

func (db *DB) GetMonthByID(id int) (types.Month, error)

func (*DB) GetMonthByMonthAndYear

func (db *DB) GetMonthByMonthAndYear(m time.Month, y int) (types.Month, error)

func (*DB) GetMonths

func (db *DB) GetMonths() ([]types.Month, error)

func (*DB) GetOrCreateCurrentMonth

func (db *DB) GetOrCreateCurrentMonth() (types.Month, error)

func (*DB) GetTransactionByID

func (db *DB) GetTransactionByID(id int) (types.Transaction, error)

func (*DB) GetTransactionsByMonthIDAndCategoryAndType

func (db *DB) GetTransactionsByMonthIDAndCategoryAndType(monthID int, category types.Category, transactionType types.TransactionType) ([]types.Transaction, error)

func (*DB) GetTransactionsByMonthIDAndType

func (db *DB) GetTransactionsByMonthIDAndType(monthID int, transactionType types.TransactionType) ([]types.Transaction, error)

func (*DB) PatchBudget

func (db *DB) PatchBudget(id int, amount float64) error

func (*DB) UpdateTransaction

func (db *DB) UpdateTransaction(id int, tr types.TransactionUpdate) error

Jump to

Keyboard shortcuts

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