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

In-Memory Databases are not really pooled/shared #1

Closed
gwenn opened this issue Oct 4, 2015 · 6 comments
Closed

In-Memory Databases are not really pooled/shared #1

gwenn opened this issue Oct 4, 2015 · 6 comments

Comments

@gwenn
Copy link

gwenn commented Oct 4, 2015

Hi,
https://www.sqlite.org/inmemorydb.html:

The database ceases to exist as soon as the database connection is closed. Every :memory: database is distinct from every other. So, opening two database connections each with the filename ":memory:" will create two independent in-memory databases.

Regards.

@ivanceras
Copy link
Owner

Yes, we can't do anything about it for now.

@gwenn
Copy link
Author

gwenn commented Nov 4, 2015

Are you sure ?
https://github.com/jgallagher/rusqlite/blob/master/src/lib.rs#L180
http://sqlite.org/c3ref/open.html
http://sqlite.org/uri.html

SqliteConnectionManager::new(PathBuf::from("file:dummy.db?mode=memory&cache=shared"),
             SQLITE_OPEN_URI | SQLITE_OPEN_CREATE | SQLITE_OPEN_READ_WRITE)

...

@ivanceras ivanceras reopened this Nov 4, 2015
@SergioBenitez
Copy link

Just ran into this. It makes absolutely no sense to me to create a pool of connections if each connection refers to a different in-memory database.

@ivanceras
Copy link
Owner

I just make it a pool to have a uniform code for accessing the connection. If you have a better improvement, I'll take a PR.

@gwenn
Copy link
Author

gwenn commented Feb 3, 2017

@gwenn
Copy link
Author

gwenn commented Apr 7, 2017

It seems to me that the issue has been fixed by f0a7bdd .

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

No branches or pull requests

3 participants