GnuCash-Pocket / gnucash-android

GnuCash Pocket – a mobile companion app for Gnucash desktop application (https://github.com/Gnucash/gnucash). Developed independently of GnuCash.
Apache License 2.0
80 stars 16 forks source link

Use Room API instead of SQLite API directly #169

Open djbrown opened 2 months ago

djbrown commented 2 months ago

From https://developer.android.com/training/data-storage/room:

The Room persistence library provides an abstraction layer over SQLite to allow fluent database access while harnessing the full power of SQLite. In particular, Room provides the following benefits:

  • Compile-time verification of SQL queries.
  • Convenience annotations that minimize repetitive and error-prone boilerplate code.
  • Streamlined database migration paths.

Because of these considerations, we highly recommend that you use Room instead of using the SQLite APIs directly.

mainly concerns the org.gnucash.android.db package, but also all the other places where sqlite API is used directly (see search).

also #164 is mildly relevant

hades commented 1 month ago

I'm actually working on it in my repository. I'll send you pull requests as I go. Do note, however, that it will involve a lot of cleanup first, as I want to simplify the current models as much as possible, remove nested models (such as account->transaction->split), remove behaviour that belongs somewhere else, etc.

djbrown commented 1 month ago

@hades good to know 👍🏾 Cautious reminder: please keep PRs small and as isolated as possible, so they can be reviewed better and faster.