Skip to content

Conversation

fortytw2
Copy link

This PR is more for discussion - definitely don't merge in this current state.

I couldn't find a way to open a database in read only mode (so that no locks are ever acquired on the DB, essential for highly concurrent readers), so I've hacked this in.

Any thoughts on how this interface should look for the end users, @mattn?

@mattn
Copy link
Owner

mattn commented Sep 13, 2017

You can specify DSN like below.

db, err := sql.Open("sqlite3", "file:test.db?immutable=1&mode=ro")

@coveralls
Copy link

coveralls commented Sep 13, 2017

Coverage Status

Coverage increased (+0.05%) to 67.819% when pulling 6455f61 on fortytw2-graveyard:master into 05548ff on mattn:master.

@fortytw2
Copy link
Author

Ah, excellent. I was rather confused as to where this was set (L40-45 of sqlite3.go) and to how it interacted with the flags to sqlite_open_v2. Thanks!

@fortytw2 fortytw2 closed this Sep 13, 2017
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.

3 participants