Show first 200 transactions only

This commit is contained in:
Jan Bader 2021-12-02 16:23:59 +00:00
parent 61c55dda3a
commit 67139ceff8
2 changed files with 6 additions and 2 deletions

View File

@ -8,9 +8,11 @@ RETURNING *;
SELECT transactions.* FROM transactions
LEFT JOIN accounts ON accounts.id = transactions.account_id
WHERE accounts.budget_id = $1
ORDER BY transactions.date DESC;
ORDER BY transactions.date DESC
LIMIT 200;
-- name: GetTransactionsForAccount :many
SELECT transactions.* FROM transactions
WHERE transactions.account_id = $1
ORDER BY transactions.date DESC;
ORDER BY transactions.date DESC
LIMIT 200;

View File

@ -50,6 +50,7 @@ const getTransactionsForAccount = `-- name: GetTransactionsForAccount :many
SELECT transactions.id, transactions.date, transactions.memo, transactions.amount, transactions.account_id, transactions.payee_id FROM transactions
WHERE transactions.account_id = $1
ORDER BY transactions.date DESC
LIMIT 200
`
func (q *Queries) GetTransactionsForAccount(ctx context.Context, accountID uuid.UUID) ([]Transaction, error) {
@ -84,6 +85,7 @@ SELECT transactions.id, transactions.date, transactions.memo, transactions.amoun
LEFT JOIN accounts ON accounts.id = transactions.account_id
WHERE accounts.budget_id = $1
ORDER BY transactions.date DESC
LIMIT 200
`
func (q *Queries) GetTransactionsForBudget(ctx context.Context, budgetID uuid.UUID) ([]Transaction, error) {