The main thrust of this topic is summarised in the below GitHub issue:
Also I can see there has been an effort to identify all databases that are used by Status. Please note the focus of my topic is not to document or change database usage, but to consolidate functionality that interacts with the databases.
Merge all the database logic, in
status-go, into one coherent package with appropriate sub-packages. Removing from the code base the numerous independent implementations for database interaction.
status-go repository has a number of database related packages that are spread out across the code base and I’m looking to consult with the team about consolidating them. Packages I’ve identified are:
Handles SQLite connection, used for device based storage
Handles SQLite migrations for:
Handles data persistence using leveldb
This package is used for the storage of chat messages.
This package also seems to partially implement storage for Transactions, but doesn’t appear to be consumed anywhere in repo.
- SQLite connection code
- migrations for the
- Functionality for getting and setting
Migration for code protocol/sqlite
Source code states that the code was generated from
// 000001_init.down.db.sql // 000001_init.up.db.sql
Possibly a redundant package.
At this moment I am unsure if the migrations in this dir are supplementary to or instead of the migrations found in protocol/internal/sqlite.
- Code for opening a sql database
- Code for triggering migrations
- Code for opening a SQLite db
- Code for migrations
- JSON blob handling
I’d like your opinion on:
- If it makes sense to consolidate these packages.
- How you’d consolidate these packages
I’ll give my approach in a following reply .
Because all the database code is scattered this may not be the full list of DB things. I looked but looking doesn’t mean that I didn’t miss something. If you are aware of any missing DB packages in
status-go please report them here .