@@ -4,26 +4,16 @@ While the `node-sqlite3` project does include support for compiling against sqlc
44
55## Supported platforms
66
7- Tests are run and pre-built binaries are made available for the following platforms:
8- * Node 8, 10 and 12.
9- * Electron 3, 4 and 5.
10- * Windows, Mac and Linux.
7+ Binaries are built against N-API 3 and 6, on MacOS, Windows (ia32 and x64) and Linux (x64).
118
12- # Requirements
9+ Node 10+ and Electron 6+ is supported.
1310
14- ### Windows
15-
16- * Visual Studio 2015
17- * Python 2.7
18-
19- ### Mac
20-
21- * ` brew install openssl@1.1 `
11+ Other platforms/architectures may work by building from source - see the section below.
2212
2313# Installation
2414
2515``` sh
26- yarn install " @journeyapps/sqlcipher"
16+ yarn add " @journeyapps/sqlcipher"
2717# Or: npm install --save "@journeyapps/sqlcipher"
2818```
2919
@@ -36,8 +26,11 @@ var sqlite3 = require('@journeyapps/sqlcipher').verbose();
3626var db = new sqlite3.Database (' test.db' );
3727
3828db .serialize (function () {
39- // Required to open a database created with SQLCipher 3.x
40- db .run (" PRAGMA cipher_compatibility = 3" );
29+ // This is the default, but it is good to specify explicitly:
30+ db .run (" PRAGMA cipher_compatibility = 4" );
31+
32+ // To open a database created with SQLCipher 3.x, use this:
33+ // db.run("PRAGMA cipher_compatibility = 3");
4134
4235 db .run (" PRAGMA key = 'mysecret'" );
4336 db .run (" CREATE TABLE lorem (info TEXT)" );
@@ -58,13 +51,29 @@ db.close();
5851
5952# SQLCipher
6053
61- A copy of the source for SQLCipher 4.3.0 is bundled, which is based on SQLite 3.31.0.
54+ A copy of the source for SQLCipher 4.4.0 is bundled, which is based on SQLite 3.31.0.
55+
56+ ## Building from source.
57+
58+ This is done automatically by node-pre-gyp when installing on a platform without pre-built binaries.
59+ However, this does require some additional setup, and is likely to run against obscure errors when installing.
60+
61+ Requirements:
62+
63+ ### Mac
64+
65+ * ` brew install openssl@1.1 `
66+
67+ ### Windows
68+
69+ * Visual Studio 2015
70+ * Python 2.7
6271
6372## OpenSSL
6473
6574SQLCipher depends on OpenSSL. When using NodeJS, OpenSSL is provided by NodeJS itself. For Electron, we need to use our own copy.
6675
67- For Windows we bundle OpenSSL 1.0.2n. Pre-built libraries are used from https://slproweb.com/products/Win32OpenSSL.html .
76+ For Windows, we bundle OpenSSL 1.0.2n. Pre-built libraries are used from https://slproweb.com/products/Win32OpenSSL.html .
6877
6978On Mac we build against OpenSSL installed via brew, but statically link it so that end-users do not need to install it.
7079
@@ -80,7 +89,7 @@ Documentation for the SQLCipher extension is available [here](https://www.zeteti
8089
8190[ mocha] ( https://github.com/visionmedia/mocha ) is required to run unit tests.
8291
83- In sqlite3's directory (where its ` package.json ` resides) run the following:
92+ In sqlite3's directory (where its ` package.json ` resides) run the following:
8493
8594 npm install --build-from-source
8695 npm test
@@ -92,7 +101,7 @@ To publish a new version, run:
92101 npm version minor -m "%s [publish binary]"
93102 npm publish
94103
95- Publishing of the prebuilt binaries is performed on CircleCI and AppVeyor .
104+ Publishing of the prebuilt binaries is performed on CircleCI.
96105
97106# Acknowledgments
98107
0 commit comments