Use uuid.UUID everywhere and have postgres generate ids

This commit is contained in:
jacob1123 committed 2021-11-29 21:49:37 +00:00
1 parent 5e8a98872f
commit 85ef7557c1
19 files changed
+199 -93

No files matched your search

+2 -2
View File
@@ -1,7 +1,7 @@
-- name: CreateBudget :one
INSERT INTO budgets
(id, name, last_modification)
VALUES ($1, $2, NOW())
(name, last_modification)
VALUES ($1, NOW())
RETURNING *;
-- name: GetBudgetsForUser :many
+9
View File
@@ -0,0 +1,9 @@
-- name: CreateTransaction :one
INSERT INTO transactions
(budget_id, date, memo, amount)
VALUES ($1, $2, $3, $4)
RETURNING *;
-- name: GetTransactionsForBudget :many
SELECT transactions.* FROM transactions
WHERE transactions.budget_id = $1;