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

Support SQLite as a database #80

Open
taraio opened this issue Jun 5, 2024 · 3 comments
Open

Support SQLite as a database #80

taraio opened this issue Jun 5, 2024 · 3 comments
Labels
enhancement New feature or request in-progress

Comments

@taraio
Copy link
Contributor

taraio commented Jun 5, 2024

Is your feature request related to a problem? Please describe.
Add support for sqlite using ecto_sqlite3 https://github.com/elixir-sqlite/ecto_sqlite3

@Clivern
Copy link
Owner

Clivern commented Jun 5, 2024

Actually i wanted to support SQLite for small setups and testings but sadly it doesn't support SELECT ... FOR UPDATE OF. Currently i use that for locking support, to lock an environment from a concurrent updates.

Reference https://www2.sqlite.org/cvstrac/wiki?p=UnsupportedSql

SELECT ... FOR UPDATE OF ... is not supported. This is understandable considering the mechanics of SQLite
 in that row locking is redundant as the entire database is locked when updating any bit of it. 
However, it would be good if a future version of SQLite supports it for SQL interchageability reasons if nothing else. 
The only functionality required is to ensure a "RESERVED" lock is placed on the database if not already there.

@Clivern Clivern added waiting-for-owner enhancement New feature or request labels Jun 5, 2024
@taraio
Copy link
Contributor Author

taraio commented Jun 6, 2024

Maybe we can switch to ecto locks https://hexdocs.pm/ecto/Ecto.Changeset.html#optimistic_lock/3. Not sure if it fits as replacement or not. it does fetch a version and update with that version so other update requests will fail if they try to update since they use stale version.

@Clivern
Copy link
Owner

Clivern commented Jan 24, 2025

We can use https://github.com/whitfin/sleeplocks to replace the db based locks. I will test this in a different project and if it works as expected, i will add it to lynx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request in-progress
Projects
None yet
Development

No branches or pull requests

2 participants