-
Notifications
You must be signed in to change notification settings - Fork 45
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
storage_status/1
should return :up
for in-memory database
#34
Comments
@sntran unfortunately with how the connections are pooled, your in memory database will always be empty because each new connection opens its own database. This is mostly an issue with how Although you are right, we should return |
If you use rc = sqlite3_open("file:memdb1?mode=memory&cache=shared", &db);
SQLite docs: In-memory Databases And Shared Cache But I ran into a very strange error when I was trying to use an in-memory database. Everything works fine until you try to perform two parallel transactions, one of which performs a write operation. |
I haven't had time to really dive into this lately, but I don't know how the shared cache is going to work when the DB is on a different machine than the one trying to access it. Could be an unfounded fear. Unsure yet. |
I'm still not sure if this is something that we should support. |
I ran into the same problem with I have the number of simple Phoenix Apps for Admin. Each time when an application start it opens the in-memory sqlite DB, when run migration to create user/token tables and register only one user with the Admin username and password from the ENV variables. So, this way I have the login functionality for simple Admin tool with completely autogenerated code for authentication ( |
tldr: I was trying to use an in-memory database using the # config/dev.exs
config :phoenix_app, PhoenixApp.Repo,
database: "file:/db?vfs=memdb",
pool_size: 5,
stacktrace: true,
show_sensitive_data_on_connection_error: true https://www.sqlite.org/forum/forumpost/c1004073ca76117f Realized the error from Further, I decided to drop the
Which was also problematic, but possibly a different issue?! Even though the "file:" prefix is a valid part of SQLite URI, it makes
|
@rhcarvalho I'll take a look at this soon, we should handle this. We are also in an experimental phase changing how the connection is pooled. This is an incredibly interesting conversation. |
I didn't know about it, thanks for the pointers, exciting developments 🚀 |
Currently, the function checks if the database file exists. This returns false for in-memory.
Which in turn fails
Phoenix.Ecto.CheckRepoStatus
during development.I would like to see if we can make the function return true instead.
The text was updated successfully, but these errors were encountered: