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

Use a temp file for read-only DB tests #85

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

tpoliaw
Copy link
Collaborator

@tpoliaw tpoliaw commented Feb 6, 2025

An in-memory DB does not allow a mix of read-only and read-write
connections. The initial connection has to have write access to set up
the initial schema so subsequent connections all end up having write
access as well, even when setting read_only(true) in the pool options.

The read_only test previously passed as the connection in the test was
seeing a new in-memory database and the test didn't distinguish between
'DB is read-only' and 'Table does not exist' error cases.

@tpoliaw tpoliaw requested a review from abbiemery February 6, 2025 16:21
@tpoliaw
Copy link
Collaborator Author

tpoliaw commented Feb 6, 2025

This kind of feels like an overkill just to test that sqlite errors are propagated back to the client. Maybe going back to the missing table version would be easier

An in-memory DB does not allow a mix of read-only and read-write
connections. The initial connection has to have write access to set up
the initial schema so subsequent connections all end up having write
access as well, even when setting read_only(true) in the pool options.

The read_only test previously passed as the connection in the test was
seeing a new in-memory database and the test didn't distinguish between
'DB is read-only' and 'Table does not exist' error cases.
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

Successfully merging this pull request may close these issues.

1 participant