Skip to content

Commit ab7b413

Browse files
authored
Update to sqlite 3.52.0 (#12)
* Update to sqlite 3.52.0 Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com> --------- Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
1 parent d83d1c0 commit ab7b413

7 files changed

Lines changed: 34139 additions & 29244 deletions

File tree

README.md

Lines changed: 53 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,49 @@
22

33
Asynchronous, non-blocking [SQLite3](https://sqlite.org/) bindings for [Node.js](http://nodejs.org/). Forked from TryGhost/node-sqlite3.
44

5+
![NPM Downloads](https://img.shields.io/npm/dm/%40appthreat%2Fsqlite3)
56
[![Latest release](https://img.shields.io/github/release/AppThreat/node-sqlite3.svg)](https://www.npmjs.com/package/@appthreat/sqlite3)
6-
![Build Status](https://github.com/AppThreat/node-sqlite3/workflows/CI/badge.svg?branch=master)
77
![Node-API v9 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v9%20Badge.svg)
88

99
# Features
1010

11-
- Straightforward query and parameter binding interface
12-
- Full Buffer/Blob support
13-
- Extensive [debugging support](https://github.com/AppThreat/node-sqlite3/wiki/Debugging)
14-
- [Query serialization](https://github.com/AppThreat/node-sqlite3/wiki/Control-Flow) API
15-
- [Extension support](https://github.com/AppThreat/node-sqlite3/wiki/API#databaseloadextensionpath-callback), including bundled support for the [json1 extension](https://www.sqlite.org/json1.html)
16-
- Big test suite
17-
- Written in modern C++ and tested for memory leaks
18-
- Bundles SQLite v3.51.0, or you can build using a local SQLite [amalgamation](https://www.sqlite.org/amalgamation.html)
11+
- Straightforward query and parameter binding interface
12+
- Full Buffer/Blob support
13+
- Extensive [debugging support](https://github.com/AppThreat/node-sqlite3/wiki/Debugging)
14+
- [Query serialization](https://github.com/AppThreat/node-sqlite3/wiki/Control-Flow) API
15+
- [Extension support](https://github.com/AppThreat/node-sqlite3/wiki/API#databaseloadextensionpath-callback), including bundled support for the [json1 extension](https://www.sqlite.org/json1.html)
16+
- Big test suite
17+
- Written in modern C++ and tested for memory leaks
18+
- Bundles SQLite v3.52.0, or you can build using a local SQLite [amalgamation](https://www.sqlite.org/amalgamation.html)
1919

2020
# Installing
2121

2222
You can use [`npm`](https://github.com/npm/cli) or [`yarn`](https://github.com/yarnpkg/yarn) to install `sqlite3`:
2323

24-
* (recommended) Latest published package:
24+
- (recommended) Latest published package:
25+
2526
```bash
2627
npm install @appthreat/sqlite3
2728
# or
2829
yarn add @appthreat/sqlite3
2930
```
30-
* GitHub's `master` branch: `npm install https://github.com/AppThreat/node-sqlite3/tarball/master`
31+
32+
- GitHub's `master` branch: `npm install https://github.com/AppThreat/node-sqlite3/tarball/master`
3133

3234
### Prebuilt binaries
3335

3436
`@appthreat/sqlite3` v6+ was rewritten to use [Node-API](https://nodejs.org/api/n-api.html) so prebuilt binaries do not need to be built for specific Node versions. `sqlite3` currently builds for both Node-API v3 and v6. Check the [Node-API version matrix](https://nodejs.org/api/n-api.html#node-api-version-matrix) to ensure your Node version supports one of these. The prebuilt binaries should be supported on Node v10+.
3537

3638
The module uses [`prebuild-install`](https://github.com/prebuild/prebuild-install) to download the prebuilt binary for your platform, if it exists. These binaries are hosted on GitHub Releases for `sqlite3` versions above 5.0.2, and they are hosted on S3 otherwise. The following targets are currently provided:
3739

38-
* `darwin-arm64`
39-
* `darwin-x64`
40-
* `linux-arm64`
41-
* `linux-x64`
42-
* `linuxmusl-arm64`
43-
* `linuxmusl-x64`
44-
* `win32-ia32`
45-
* `win32-x64`
40+
- `darwin-arm64`
41+
- `darwin-x64`
42+
- `linux-arm64`
43+
- `linux-x64`
44+
- `linuxmusl-arm64`
45+
- `linuxmusl-x64`
46+
- `win32-ia32`
47+
- `win32-x64`
4648

4749
Unfortunately, [prebuild](https://github.com/prebuild/prebuild/issues/174) cannot differentiate between `armv6` and `armv7`, and instead uses `arm` as the `{arch}`. Until that is fixed, you will still need to install `sqlite3` from [source](#source-install).
4850

@@ -68,22 +70,22 @@ See the [API documentation](https://github.com/AppThreat/node-sqlite3/wiki/API)
6870

6971
This package is now ESM only.
7072

71-
``` js
72-
import sqlite3 from 'sqlite3';
73-
const db = new sqlite3.verbose().Database(':memory:');
73+
```js
74+
import sqlite3 from "sqlite3";
75+
const db = new sqlite3.verbose().Database(":memory:");
7476

7577
db.serialize(() => {
76-
db.run("CREATE TABLE lorem (info TEXT)");
78+
db.run("CREATE TABLE lorem (info TEXT)");
7779

78-
const stmt = db.prepare("INSERT INTO lorem VALUES (?)");
79-
for (let i = 0; i < 10; i++) {
80-
stmt.run("Ipsum " + i);
81-
}
82-
stmt.finalize();
80+
const stmt = db.prepare("INSERT INTO lorem VALUES (?)");
81+
for (let i = 0; i < 10; i++) {
82+
stmt.run("Ipsum " + i);
83+
}
84+
stmt.finalize();
8385

84-
db.each("SELECT rowid AS id, info FROM lorem", (err, row) => {
85-
console.log(row.id + ": " + row.info);
86-
});
86+
db.each("SELECT rowid AS id, info FROM lorem", (err, row) => {
87+
console.log(row.id + ": " + row.info);
88+
});
8789
});
8890

8991
db.close();
@@ -121,15 +123,15 @@ The default sqlite file header is "SQLite format 3". You can specify a different
121123
npm install --build-from-source --sqlite_magic="MyCustomMagic15"
122124
```
123125

124-
Note that the magic *must* be exactly 15 characters long (16 bytes including null terminator).
126+
Note that the magic _must_ be exactly 15 characters long (16 bytes including null terminator).
125127

126128
## Building for node-webkit
127129

128130
Because of ABI differences, `sqlite3` must be built in a custom to be used with [node-webkit](https://github.com/rogerwang/node-webkit).
129131

130132
To build `sqlite3` for node-webkit:
131133

132-
1. Install [`nw-gyp`](https://github.com/rogerwang/nw-gyp) globally: `npm install nw-gyp -g` *(unless already installed)*
134+
1. Install [`nw-gyp`](https://github.com/rogerwang/nw-gyp) globally: `npm install nw-gyp -g` _(unless already installed)_
133135

134136
2. Build the module with the custom flags of `--runtime`, `--target_arch`, and `--target`:
135137

@@ -146,10 +148,10 @@ npm install --build-from-source --runtime=node-webkit --target_arch=ia32 --targe
146148

147149
Remember the following:
148150

149-
* You must provide the right `--target_arch` flag. `ia32` is needed to target 32bit node-webkit builds, while `x64` will target 64bit node-webkit builds (if available for your platform).
151+
- You must provide the right `--target_arch` flag. `ia32` is needed to target 32bit node-webkit builds, while `x64` will target 64bit node-webkit builds (if available for your platform).
150152

151-
* After the `sqlite3` package is built for node-webkit it cannot run in the vanilla Node.js (and vice versa).
152-
* For example, `npm test` of the node-webkit's package would fail.
153+
- After the `sqlite3` package is built for node-webkit it cannot run in the vanilla Node.js (and vice versa).
154+
- For example, `npm test` of the node-webkit's package would fail.
153155

154156
Visit the “[Using Node modules](https://github.com/rogerwang/node-webkit/wiki/Using-Node-modules)” article in the node-webkit's wiki for more details.
155157

@@ -208,21 +210,21 @@ npm test
208210

209211
# Contributors
210212

211-
* [Daniel Lockyer](https://github.com/daniellockyer)
212-
* [Konstantin Käfer](https://github.com/kkaefer)
213-
* [Dane Springmeyer](https://github.com/springmeyer)
214-
* [Will White](https://github.com/willwhite)
215-
* [Orlando Vazquez](https://github.com/orlandov)
216-
* [Artem Kustikov](https://github.com/artiz)
217-
* [Eric Fredricksen](https://github.com/grumdrig)
218-
* [John Wright](https://github.com/mrjjwright)
219-
* [Ryan Dahl](https://github.com/ry)
220-
* [Tom MacWright](https://github.com/tmcw)
221-
* [Carter Thaxton](https://github.com/carter-thaxton)
222-
* [Audrius Kažukauskas](https://github.com/audriusk)
223-
* [Johannes Schauer](https://github.com/pyneo)
224-
* [Mithgol](https://github.com/Mithgol)
225-
* [Kewde](https://github.com/kewde)
213+
- [Daniel Lockyer](https://github.com/daniellockyer)
214+
- [Konstantin Käfer](https://github.com/kkaefer)
215+
- [Dane Springmeyer](https://github.com/springmeyer)
216+
- [Will White](https://github.com/willwhite)
217+
- [Orlando Vazquez](https://github.com/orlandov)
218+
- [Artem Kustikov](https://github.com/artiz)
219+
- [Eric Fredricksen](https://github.com/grumdrig)
220+
- [John Wright](https://github.com/mrjjwright)
221+
- [Ryan Dahl](https://github.com/ry)
222+
- [Tom MacWright](https://github.com/tmcw)
223+
- [Carter Thaxton](https://github.com/carter-thaxton)
224+
- [Audrius Kažukauskas](https://github.com/audriusk)
225+
- [Johannes Schauer](https://github.com/pyneo)
226+
- [Mithgol](https://github.com/Mithgol)
227+
- [Kewde](https://github.com/kewde)
226228

227229
# Acknowledgments
228230

deps/common-sqlite.gypi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
'variables': {
3-
'sqlite_version%':'3510200',
3+
'sqlite_version%':'3520000',
44
"toolset%":'',
55
},
66
'target_defaults': {

0 commit comments

Comments
 (0)