mirror of
https://github.com/status-im/nim-sqlcipher.git
synced 2025-02-16 11:16:24 +00:00
Clean up logic, variables, etc. in the Makefile and related files. Bump nimterop and sqlcipher in `vendor/` to latest versions. In addition to tests on GitHub Actions, manually test all static/shared combinations on Linux, macOS, and Windows. Also, for each combination check locally that a separately compiled `sqlite3` cli *cannot* read e.g. `test/build/my.db` even with `PRAGMA key = '[password]';`. Likewise, check that a separately compiled `sqlcipher` cli *can* read a database if and only if the correct password is used, e.g. `PRAGMA key = 'qwerty';` for `test/build/my.db`.
23 lines
443 B
Nim
23 lines
443 B
Nim
import ../sqlcipher
|
|
|
|
from os import parentDir
|
|
import strformat
|
|
import times
|
|
|
|
let db: DbConn = openDatabase(currentSourcePath.parentDir() & "/build/my.db")
|
|
|
|
let passwd = "qwerty"
|
|
|
|
key(db, passwd)
|
|
|
|
execScript(db, "create table if not exists Log (theTime text primary key)")
|
|
|
|
let date = getDateStr(now())
|
|
let time = getClockStr(now())
|
|
|
|
execScript(db, &"""insert into Log values("{date}:{time}")""")
|
|
|
|
echo rows(db, "select * from Log")
|
|
|
|
close(db)
|