-
-
Notifications
You must be signed in to change notification settings - Fork 822
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
Creating shared memory database fails #1032
Comments
At the moment this is only possible if libsqlite3.so has been compiled with "SQLITE_USE_URI=1" and node-sqlite3 has been installed using the options "--build-from-source" and "--sqlite=/path/to/sqlite3/prefix" I have been using this method for some time now, so I am able to open a named shared memory database using an URI like:
Today I was browsing in the sqlite documentation, which other possibilities would exist, since the activation of the above compile-time option would be a breaking change for node-sqlite3. luckily one would only need to propagate the SQLITE_OPEN_URI constant to JavaScript Flags For File Open Operations I will therefore create a related (mini) PR; possibly also with other missing constants, such as SQLITE_OPEN_SHAREDCACHE and SQLITE_OPEN_PRIVATECACHE. |
Thanks for your informative reply :) I'm not able to compile from source though where I am. I think the best would be indeed to have the pre-built binaries with this setting enabled. I'm not sure if this is a breaking change since we're basically just enabling a new option though? |
yes, with this solution we would just provide additional constants for use in JavaScript and would not change existing functionality |
Hello.
I'm trying to create a database in memory, run some queries on it to create tables, and then attach that same database to another one.
According to the sqlite3 documentaiton, you can create shared memory databases.
https://www.sqlite.org/inmemorydb.html see the "In-memory Databases And Shared Cache" section.
I tried something like that, but it fails :
I could always attach the memory database first and then run queries on it, but since I'm reusing queries I already ran elsewhere, I'd have to copy/paste them to change table names (
table1
tomemorydb.table1
) for example.This works fine when using a sqlite3 client in bash.
Would it be possible to implement it ?
The text was updated successfully, but these errors were encountered: