aboutsummaryrefslogtreecommitdiff
path: root/sqlite/README.txt
diff options
context:
space:
mode:
authorfusion32 <marcopuzziello@gmail.com>2025-10-18 02:32:59 -0300
committerfusion32 <marcopuzziello@gmail.com>2025-10-18 02:35:24 -0300
commit601ce32ee8d0cee32b66c87b0bfefa7424a5b8c8 (patch)
tree7b06c2d9d385b957377b801b83f004fc554e19d0 /sqlite/README.txt
parentd92f642810dc3125515d64f953d2bee840de1cc1 (diff)
downloadquerymanager-601ce32ee8d0cee32b66c87b0bfefa7424a5b8c8.tar.gz
querymanager-601ce32ee8d0cee32b66c87b0bfefa7424a5b8c8.zip
modify how automatic SQLite patches/upgrades works + overall cleanup
Diffstat (limited to 'sqlite/README.txt')
-rw-r--r--sqlite/README.txt21
1 files changed, 11 insertions, 10 deletions
diff --git a/sqlite/README.txt b/sqlite/README.txt
index 26f782a..8ef89f5 100644
--- a/sqlite/README.txt
+++ b/sqlite/README.txt
@@ -1,10 +1,11 @@
- The query manager will properly initialize and upgrade the database schema
-based on files in this folder. The initial schema should be in `schema.sql` and
-upgrades should be in `upgrade-N.sql` where N is a number starting from 1. The
-`upgrade-N.sql` file should take the database from version N to N + 1.
- The only restriction to these files is that they can't have transaction
-statements ("BEGIN", "ROLLBACK", "COMMIT") because the query manager will
-already bundle them into a transaction that also sets `user_version`, and
-and nested transactions aren't allowed.
- The current database version can be retrieved with the "PRAGMA user_version"
-query in the SQLite shell. \ No newline at end of file
+ The query manager will initialize and patch the database schema, at startup,
+based on the files in this folder. The initial schema is inside `schema.sql` and
+shouldn't be modified, to make sure the database can be initialized if everything
+else fails. Patches and modifications should be placed in `patches/` with no
+particular name restrictions except for having an `.sql` extension. These patch
+files will be executed exactly ONCE. If multiple patches are pending at startup,
+they're executed in alphabetical order.
+ As for statement restrictions, the only thing prohibited is the presence of
+transaction statements "BEGIN", "ROLLBACK", and "COMMIT". This is because all
+patches will be bundled into the same transaction, to ensure atomicity.
+