Implement single account transaction-list

This commit is contained in:
2021-12-02 21:44:35 +00:00
parent f2e8721aa8
commit 871b11bbcc
7 changed files with 56 additions and 48 deletions

View File

@ -28,6 +28,18 @@ func (q *Queries) CreateAccount(ctx context.Context, arg CreateAccountParams) (A
return i, err
}
const getAccount = `-- name: GetAccount :one
SELECT accounts.id, accounts.budget_id, accounts.name FROM accounts
WHERE accounts.id = $1
`
func (q *Queries) GetAccount(ctx context.Context, id uuid.UUID) (Account, error) {
row := q.db.QueryRowContext(ctx, getAccount, id)
var i Account
err := row.Scan(&i.ID, &i.BudgetID, &i.Name)
return i, err
}
const getAccounts = `-- name: GetAccounts :many
SELECT accounts.id, accounts.budget_id, accounts.name FROM accounts
WHERE accounts.budget_id = $1