Repository navigation
mvx v0.2.1
A new account keeps its files in sqlite
This changes where a new account stores its data. Existing accounts do not move.
lmdb pushes nothing down. Its driver implements select_begin/next/end/count and the index hooks and nothing else — no select_where, no select_order, no filtered COUNT, no SUM, no join, no explain — so every WITH streamed the whole id list to the verb and filtered it there. sqlite answers those in SQL, and is the same deal for the operator: one local file, no server to run.
The difference shows in what DESCRIBE reports. Where a new account used to say:
lmdb: no server-side query planner; the driver returns the id list ...
it now says:
sqlite: SELECT id FROM "CUST" WHERE ...
Nothing existing moves
An account that has lmdb files keeps lmdb. Accounts made before this release declare no backend, so they are asked rather than assumed: if lmdb already holds files for the account, lmdb is what it keeps getting.
The first time such an account is entered from TCL, the backend holding its VOC is recorded in .mvx (voc = lmdb), so it is settled once and never worked out again. If VOC cannot be found in lmdb either, MVX asks — on a terminal — and records the answer rather than guessing; off a terminal it changes nothing.
An account now says what it uses
.mvx carries two declarations:
driver = sqlite the default for a file nothing else placed
voc = sqlite VOC's own
VOC is declared separately because it is the bootstrap file: it must be opened before anything that could describe it, and it need not match the default — an account keeps the VOC it was made with while later files go elsewhere.
Moving a file between backends
CONVERT-FILE <file> <type> is the operator route, and it moves VOC too:
CONVERT-FILE VOC lmdb
.mvx is updated to match, because a stale voc = does not merely mislead — VOC is the one file nothing else can describe, so it would lock the account.
CONVERT-FILE <file> lmdb was broken by the default change and is fixed here. It created the target with the account default, so it reported converted to lmdb and left the file where it was.
Also
LISTFreports a file whatever local backend holds it. It asked lmdb only, so a file the account placed in sqlite was invisible — and because mvx-git finds an account's files through that list, such an account committed without its records..gitignorecovers every backend's store, not just lmdb's. lmdb's is a directory; sqlite's is a file with-shmand-wal, so a run in a source tree left three untracked files behind.
If you use mvx-git
Update the git package to 2.0.4 or later. Earlier versions commit a sqlite-backed account's raw database instead of its records, because the store-exclusion rule named mvxdata.lmdb literally.
What's Changed
- #187 an account records which transport it uses by @gheydon in #188
- #187 LISTF reports a file whatever local backend holds it by @gheydon in #189
- #187 sqlite is the default backend for a new account by @gheydon in #190
- #191 converting VOC updates the account's record of where VOC is by @gheydon in #192
- #187 ignore every backend's local store, not just lmdb's by @gheydon in #193
Full Changelog: v0.2.0...v0.2.1
What's Changed
- #187 an account records which transport it uses by @gheydon in #188
- #187 LISTF reports a file whatever local backend holds it by @gheydon in #189
- #187 sqlite is the default backend for a new account by @gheydon in #190
- #191 converting VOC updates the account's record of where VOC is by @gheydon in #192
- #187 ignore every backend's local store, not just lmdb's by @gheydon in #193
Full Changelog: v0.2.0...v0.2.1