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
The library has native support for [SQLCipher](https://www.zetetic.net/sqlcipher/). If you want to use encrypted databases, you have to include the `sqlite_moder_cpp/sqlcipher.h` header.
337
-
Then you can create a `sqlcipher_database`.
338
-
339
-
```c++
340
-
#include<iostream>
341
-
#include <sqlite_modern_cpp/sqlcipher.h>
342
-
using namespace sqlite;
343
-
using namespace std;
344
-
345
-
int main() {
346
-
347
-
try {
348
-
// creates a database file 'dbfile.db' if it does not exists with password 'secret'
349
-
sqlcipher_config config;
350
-
config.key = secret;
351
-
sqlcipher_database db("dbfile.db", config);
352
-
353
-
// executes the query and creates a 'user' table
354
-
db <<
355
-
"create table if not exists user ("
356
-
" _id integer primary key autoincrement not null,"
357
-
" age int,"
358
-
" name text,"
359
-
" weight real"
360
-
");";
361
-
362
-
// More queries
363
-
364
-
db.rekey("new_secret"); // Change the password of the already encrypted database.
365
-
366
-
// Even more queries
367
-
}
368
-
catch (exception& e) {
369
-
cout << e.what() << endl;
370
-
}
371
-
}
372
-
```
373
-
374
371
Building and Installing
375
372
----
376
373
@@ -385,9 +382,7 @@ Note, there's nothing to make, so you there's no need to run configure and you c
385
382
386
383
Breaking Changes
387
384
----
388
-
389
-
- Databases with non-ASCII characters in their names created with versions up to 2.4 are not found by the current master.
390
-
You have to manually rename them to their actual (UTF-8 encoded) name.
385
+
See breaking changes documented in each [Release](https://github.com/aminroosta/sqlite_modern_cpp/releases).
0 commit comments