Switch between payees and accounts depending on prefix

This commit is contained in:
2022-02-23 14:47:40 +00:00
parent dae9abeeea
commit d89a8f4e2e
3 changed files with 76 additions and 10 deletions

View File

@ -19,4 +19,10 @@ FROM accounts
LEFT JOIN transactions ON transactions.account_id = accounts.id AND transactions.date < NOW()
WHERE accounts.budget_id = $1
GROUP BY accounts.id, accounts.name
ORDER BY accounts.name;
-- name: SearchAccounts :many
SELECT accounts.id, accounts.budget_id, accounts.name FROM accounts
WHERE accounts.budget_id = @budget_id
AND accounts.name LIKE @search
ORDER BY accounts.name;