SQLite Support #62
Labels
No labels
bug
chore
documentation
enhancement
help
in-progress
question
ready-for-release
released
translation
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
adam/gate#62
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I think SQLite support should be added, possibly by adding environment variables for DB_ADAPTER and DB_PATH. There should also be a way to migrate the database between the two options, so you don’t lose your existing database.
It seems like SQLite has some pretty serious constraints around constraints that makes support with the current set of DB migrations very difficult. For this reason I am no longer planning on adding SQLite support until a workaround is found.
A summary of the issue: When modifying a table check constraint in a knex migration file, to support sqlite you must drop the entire table and recreate it instead of just dropping the constraint. This among other issues, such as lack of default value support, make the juice not worth the squeeze in my opinion.
In smaller environments, postgres is a little bit overkill. Additionally, we can even backup and move the sqlite DB file easily with
cp.. Even Grist uses sqlite as a "document file format" .. LOL...And while it is true, modifying a table check constraint will require a drop/create of the entire table in SQLite, how often does a table check constraint really need to be changed? I think if the table constraints are changing, one might consider that a major change/issue, regardless of whichever DB backend is being used, and needs to be handled with great care anyhow.
I think the biggest issue is maybe the much smaller set of types in SQLite vs postgres/maria/etc ... And in there, default values are kind of "basic" ... but I think that can be mitigated simply by reducing the structure to basic types,
INTEGERs,TEXTs, etc, and/or setting clearly specified default values onINSERT..In any case, I do hope you will please add SQLite support, it reduces the requirements and implementation difficulty for self-hosters in an impactful manner. Much appreciated! ^_^
EDIT: Just to add, I just checked, multi-domain support should work with SQLite also, as long as they share the same DB files across two different Voidauth instances..
SQLite support is coming in the next release, if you want you can test it out on the :edge image tag
voidauth/voidauth:edgeby using theDB_ADAPTER=sqliteenvironment variable. There is currently no migration option, though a issue will be opened for it.