You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17Lines changed: 17 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -77,6 +77,23 @@ int main() {
77
77
}
78
78
```
79
79
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
+
80
97
Prepared Statements
81
98
----
82
99
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