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

sqlite-lib: Disallow :memory: connection #3352

Open
lukedirtwalker opened this issue Nov 11, 2019 · 2 comments
Open

sqlite-lib: Disallow :memory: connection #3352

lukedirtwalker opened this issue Nov 11, 2019 · 2 comments
Labels
c/documentation Improvements or additions to documentation feature New feature or request i/good first issue Good for newcomers

Comments

@lukedirtwalker
Copy link
Collaborator

Using just :memory: has some issues as pointed out by mattn/go-sqlite3#204 and https://github.com/mattn/go-sqlite3#faq, so our lib should fail out if being initialized with :memory: only.

@jiceatscion jiceatscion added the i/good first issue Good for newcomers label Jul 11, 2024
@jiceatscion
Copy link
Contributor

The problem seems to be (after reading the referenced issues), that configuring the DB uri to be ":memory:", as opposed to "file::memory:?cache=shared" (or a couple of equivalent expressions) leads to surprising behaviors that are typically not what the user wants. That is: should the same DB be opened more than once in a given process, each instance is independent (and there are also some potential data races). So, to prevent users from shooting themselves in the foot, we should disallow it. "file::memory:?cache=shared", on the other hand, would be fine. Note that issue 304 warns about the performance penalty of opening the same DB twice, but that's not necessarily a severe issue for us.

@jiceatscion jiceatscion added feature New feature or request c/documentation Improvements or additions to documentation labels Jul 11, 2024
@jiceatscion
Copy link
Contributor

In any case, we should document what configured values are acceptable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/documentation Improvements or additions to documentation feature New feature or request i/good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants