1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
-- name: GetTransaction :one
SELECT * from transactions
WHERE id = ? LIMIT 1;
-- name: ListTransactions :many
SELECT * FROM transactions
WHERE date BETWEEN ? AND ?;
-- name: CreateTransaction :one
INSERT INTO transactions (
title, amount, date, recurrance, week, is_income
) VALUES (
?, ?, ?, ?, ?, ?
)
RETURNING *;
-- name: UpdateTransaction :one
UPDATE transactions
SET title = ?, amount = ?, date = ?, recurrance = ?, week = ?, is_income = ?
WHERE id = ?
RETURNING *;
-- name: DeleteTransaction :exec
DELETE FROM transactions
WHERE id = ?;
|