Add enum for intended sqlite database open modes.

This commit is contained in:
Ben Radford 2023-05-16 13:57:56 +01:00
parent 7f443e0428
commit afed9ccfad
No known key found for this signature in database
GPG key ID: 9DF5D4640AB888D5

View file

@ -11,6 +11,24 @@ struct sqlite3_stmt;
namespace nix { namespace nix {
enum class SQLiteOpenMode {
/**
* Open the database in read-write mode.
* If the database does not exist, it will be created.
*/
Normal,
/**
* Open the database in read-write mode.
* Fails with an error if the database does not exist.
*/
NoCreate,
/**
* Open the database in read-only mode.
* Fails with an error if the database does not exist.
*/
ReadOnly
};
/** /**
* RAII wrapper to close a SQLite database automatically. * RAII wrapper to close a SQLite database automatically.
*/ */