Skip to content

Commit 188fe5a

Browse files
committed
Some documentation
1 parent 1c1c694 commit 188fe5a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,23 @@ int main() {
7777
}
7878
```
7979

80+
Additional flags
81+
----
82+
You can pass additional open flags to SQLite by using a config object:
83+
84+
```c++
85+
sqlite_config config;
86+
config.flags = Flags::OPEN_READONLY
87+
database db("some_db", config);
88+
int a;
89+
// Now you can only read from db
90+
auto ps = db << "select a from table where something = ? and anotherthing = ?" >> a;
91+
config.flags = Flags::OPEN_READWRITE | Flags::OPEN_CREATE; // This is the default
92+
config.encoding = Encoding::UTF16; // The encoding is respected only if you create a new database
93+
database db2("some_db2", config);
94+
// If some_db2 didn't exists before, it will be created with UTF-16 encoding.
95+
```
96+
8097
Prepared Statements
8198
----
8299
It is possible to retain and reuse statments this will keep the query plan and in case of an complex query or many uses might increase the performance significantly.

0 commit comments

Comments
 (0)