it was nice to use the ordering from hledger, but after the migration to
room this worked only by chance - sqlite returned the rows in the order
they were inserted. this means that any new accounts will end up at
the bottom. this is the case when speculative transaction storage is
active (coming soon) and the transaction has a new account.
also, the conversion from db account objects to UI list relies on the
ordering now.
in a future version, the accounts table may store the hledger ordering
in a new column, but this doesn't completely solve the problem when
adding new accounts speculatively
@Delete
public abstract void deleteSync(List<Account> items);
- @Query("SELECT * FROM accounts WHERE profile_id=:profileId")
+ @Query("SELECT * FROM accounts WHERE profile_id=:profileId ORDER BY name")
public abstract LiveData<List<Account>> getAll(long profileId);
@Transaction
- @Query("SELECT * FROM accounts WHERE profile_id = :profileId")
+ @Query("SELECT * FROM accounts WHERE profile_id = :profileId ORDER BY name")
public abstract LiveData<List<AccountWithAmounts>> getAllWithAmounts(long profileId);
@Query("SELECT * FROM accounts WHERE id=:id")