Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Migrate to SQLite #3045

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft

feat: Migrate to SQLite #3045

wants to merge 3 commits into from

Conversation

krocheck
Copy link
Member

@krocheck krocheck commented Sep 20, 2024

This implements SQLite to replace the JSON file DB currently used.

Existing DB implementations were moved to /Data/Legacy with write functionality removed in order to facilitate migration to the new format for existing installations. The tables used are simple (id, value) string rows with id flagged a UNIQUE.

This does include a DB version increment from v4 to v5, and this was done to simplify conditions during the migration and ensure import functionality remained untouched. Part of the v4tov5 upgrade is to move controls from the main table into a dedicated controls table. Also, it migrates the separate, legacy clouddb into a cloud table.

Upon startup, the driver ...

  1. Attempts to start without create ability. If that fails ...
  2. It checks the filesystem for a legacy DB file
  • If found, the Legacy driver is loaded, a DB is created, and all data is "as-is" moved to the main SQLite table
  • If not found ...
  1. It creates a new DB and loads the defaults

TODOs

  • Bolster error handling, including startup (attempt to recover backup)
  • Deal with types better
  • Fix tests
  • Test, test, test

Initial testing showed successful OOB startup and migration from a v4 config of relatively small size/scope.

@krocheck krocheck changed the title Migrate to SQLite feat: Migrate to SQLite Sep 20, 2024
@krocheck krocheck marked this pull request as draft September 20, 2024 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant