Closed Zigazou closed 2 years ago
Any chance of this being merged (after resolving the conflicts, of course)?
@fosskers if conflicts are resolved and single course of testing applied, then yes.
It seems that calling sqlite3_open()
is strictly a specialization of calling sqlite3_open_v2()
, and that every call to sqlite3_open()
can be rephrased as a call to sqlite3_open_v2()
using SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE
for the 3rd argument and nullptr
for the 4th argument.
https://github.com/sqlite/sqlite/blob/dcd7408db8d1c68995bdc4825d281e7cc8dfa54e/src/main.c#L3494
https://www.sqlite.org/c3ref/open.html
Consequently, perhaps open
can be implemented as a call to open2
and the tests deal only with open2, reducing some of the difficulties regarding test duplication. Some of the remaining difficulties are related to the behavior difference arising from opening a DB with different 3rd & 4th arguments, e.g. the behavior from trying to write is different between opening RW and opening RO.
I've pushed commits for open2 with refactored tests.
Hi !
This pull request adds the ability to use the sqlite3_open_v2 with direct-sqlite.
It allows, among other things, to open a database in read-only mode as requested in the following issue https://github.com/IreneKnapp/direct-sqlite/issues/52