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

Read-only in-memory databases don't work for tests #84

Closed
tpoliaw opened this issue Feb 6, 2025 · 1 comment
Closed

Read-only in-memory databases don't work for tests #84

tpoliaw opened this issue Feb 6, 2025 · 1 comment
Labels
wontfix This will not be worked on

Comments

@tpoliaw
Copy link
Collaborator

tpoliaw commented Feb 6, 2025

By design, every sqlite connection to :memory: returns a new in memory DB. This means in a connection pool, every connection is using a different DB and later connections do not see the tables created by running the migrations on the first.

It is possible to specify a name and shared cache for the connection but it doesn't seem to be possible for some connections to be read-only while others are read-write.

@tpoliaw
Copy link
Collaborator Author

tpoliaw commented Feb 11, 2025

I think this can be ignored as won't fix. The only reason for creating the read-only DB was to ensure sqlite errors were propagated correctly in tests and that can be done in simpler ways (see #86). It is possible to create a read-only DB in a tempfile but it's a faff (#85).

@tpoliaw tpoliaw closed this as completed Feb 11, 2025
@tpoliaw tpoliaw added the wontfix This will not be worked on label Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant