mirror of
https://github.com/lightninglabs/lightning-terminal.git
synced 2026-08-13 12:33:36 +02:00
db: order ListAllAccounts result by account id.
In preparation for the migration from kvdb to SQL, we update the results of the ListAllAccounts query. After the migration has been implemented, we will test that the result off all accounts in the SQL database is the same as the result of the fetching all accounts in the kvdb. By ordering the SQL query's result by account id, we ensure that all accounts are returned in the same order as they are returned by the kvdb.
This commit is contained in:
parent
92689c546c
commit
6030f650fd
2 changed files with 3 additions and 1 deletions
|
|
@ -261,6 +261,7 @@ func (q *Queries) ListAccountPayments(ctx context.Context, accountID int64) ([]A
|
|||
const listAllAccounts = `-- name: ListAllAccounts :many
|
||||
SELECT id, alias, label, type, initial_balance_msat, current_balance_msat, last_updated, expiration
|
||||
FROM accounts
|
||||
ORDER BY id
|
||||
`
|
||||
|
||||
func (q *Queries) ListAllAccounts(ctx context.Context) ([]Account, error) {
|
||||
|
|
|
|||
|
|
@ -62,7 +62,8 @@ WHERE id = $1;
|
|||
|
||||
-- name: ListAllAccounts :many
|
||||
SELECT *
|
||||
FROM accounts;
|
||||
FROM accounts
|
||||
ORDER BY id;
|
||||
|
||||
-- name: ListAccountPayments :many
|
||||
SELECT *
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue