db

package
v0.0.0-...-917fc08 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAccouont

func CreateAccouont(code string, title string, accType string, db *sql.DB) error

func CreateRecord

func CreateRecord(record Record, db *sql.DB) error

func InitDB

func InitDB(db *sql.DB) error

func Open

func Open(dbPath string) (*sql.DB, error)

Types

type Account

type Account struct {
	Id    string
	Code  string
	Title string
	Type  AccountType
}

func SelectAccounts

func SelectAccounts(query squirrel.SelectBuilder) ([]Account, error)

type AccountType

type AccountType string
const (
	AccountTypeAsset     AccountType = "asset"
	AccountTypeLiability AccountType = "liability"
	AccountTypeIncome    AccountType = "income"
	AccountTypeExpense   AccountType = "expense"
)

type Record

type Record struct {
	Id          string
	AccountId   string
	RecordId    string
	Debit       float64
	Credit      float64
	Description string
	Date        string
}

func SelectRecords

func SelectRecords(query squirrel.SelectBuilder) ([]Record, error)

Jump to

Keyboard shortcuts

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