This differential refactors main compaction creation and restore not to use ORM. At this point both
web and mobile apps are fully functional.
Details
Excute test plan for main compaction project:
https://linear.app/comm/issue/ENG-6146/final-testing-task
Additionally:
- Checkout from this stack to master.
- Disable database encryption.
- Download database from XCode.
- Execute sqlite3 comm.sqlite .schema > schema.sql
- Repeat 1-4 after checkout to this stack.
- Ensure schema.sql files are the same.
Diff Detail
- Repository
- rCOMM Comm
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp | ||
---|---|---|
897 | I have some memory that this code enabled us to create a new database from scratch. Is that memory correct? If so, how is the functionality replaced? |
native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp | ||
---|---|---|
897 | According to SQLite ORM docs this function can create database. However my understanding is that we never actually used this functionality. The reason is that prior to any call to getStorage we first call SQLiteQueryExecutor constructor which internally calls migrate method. The migrate method creates database structure from scratch if necessary using SQL query. @kamil is my understanding correct? |
Adding @atul since he might have context on historical SQLite setup
native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp | ||
---|---|---|
897 | Is there any risk that the migrate method is missing something that is later filled in by sqlite_orm? It might be worth adding a step to your test plan to export a fresh database from before the deprecation and after the deprecation, and compare to see if there are any differences. |
Agree that it would be good to check that the call to make_storage() isn't "filling in any gaps" from our SQL queries.
We could maybe do something like
sqlite3 blah.db .schema > blah.sql
before and after the call to make_storage() to see if there are any changes?
native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp | ||
---|---|---|
897 | Updated the test plan to include those steps. |
native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp | ||
---|---|---|
1603 ↗ | (On Diff #36028) | are you sure the name main is correct? sqlite_orm used the same? |
897 |
yes
It was a time when we were using sync_schema but we don't do that anymore. |
native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp | ||
---|---|---|
1603 ↗ | (On Diff #36028) |
Yes according to sqlite3_backup_init documentation.. We are not working with temporary database nor with ATTACH-ed database.
Yes - there code is here. |