Skip to content

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

Closed
tpoliaw wants to merge 1 commit into
mainfrom
read_only_temp_db
Closed

Use a temp file for read-only DB tests#85
tpoliaw wants to merge 1 commit into
mainfrom
read_only_temp_db

Conversation

@tpoliaw

@tpoliaw tpoliaw commented Feb 6, 2025

Copy link
Copy Markdown
Collaborator

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

tpoliaw commented Feb 6, 2025

Copy link
Copy Markdown
Collaborator Author

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.
@tpoliaw

tpoliaw commented Feb 12, 2025

Copy link
Copy Markdown
Collaborator Author

Closing this in favour of #86

@tpoliaw tpoliaw closed this Feb 12, 2025
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