Skip to content

Commit 19e526d

Browse files
authored
SQLCipher 4.4.0 / SQLite 3.31.0. (#50)
1 parent b451386 commit 19e526d

4 files changed

Lines changed: 43 additions & 23 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## 4.1.0
4+
5+
- Update to SQLCipher 4.3.0 / SQLite 3.30.1.
36
## 4.0.0
47

58
- Update to SQLCipher 4.2.0 / SQLite 3.28.0.

README.md

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -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();
3626
var db = new sqlite3.Database('test.db');
3727

3828
db.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

6574
SQLCipher 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

6978
On 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

SQLCipher.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ git clone git@github.com:sqlcipher/sqlcipher.git
1111
cd sqlcipher
1212
./configure
1313
make sqlite3.c
14+
15+
VERSION=3031000
16+
mkdir sqlcipher-amalgamation-$VERSION
17+
cp sqlite3.c sqlite3.h shell.c sqlite3ext.h VERSION sqlcipher-amalgamation-$VERSION/
1418
```
1519

1620
The above produces 4 files of interest:
@@ -23,7 +27,7 @@ sqlite3ext.h # optional
2327
VERSION # optional
2428
```
2529

26-
Copy these files to a new folder, `sqlcipher-amalgamation-<version>`.
30+
The files are copied to: `sqlcipher-amalgamation-<version>`.
2731

2832
## Step 2: Get OpenSSL libraries
2933

@@ -46,6 +50,10 @@ Copy the header files (include folder) to `sqlcipher-amalgamation-<version>/open
4650

4751
Archive the folder as `deps/sqlcipher-amalgamation-<version>.tar.gz`, and update the version number in `common-sqlite.gypi` (must be the same).
4852

53+
```
54+
tar czf sqlcipher-amalgamation-$VERSION.tar.gz sqlcipher-amalgamation-$VERSION
55+
```
56+
4957
## Step 4: Test the build
5058

5159
Run:
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:ef782f7fd27484b9c2c7c043f162e5294ec06e23ef9df60d9c5cffb5dc343163
3-
size 5507468
2+
oid sha256:afabc65e0907afef636de3940b1e08967600f0290cb30b8c2269dbd18f22f8a6
3+
size 5545265

0 commit comments

Comments
 (0)