Skip to content

Commit f2a6b6c

Browse files
committed
Merge remote-tracking branch 'vendor/master' into merge-upstream
2 parents 079052e + 833f5cc commit f2a6b6c

28 files changed

Lines changed: 1582 additions & 1064 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ local.env
2626
.eslintrc.js
2727
setup.sh
2828
bin
29+
/build-tmp-napi-v3
30+
/build-tmp-napi-v6

Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,11 @@ RUN echo "#log: ${project}: Building sources" \
7474
&& find build/stage/ -type f \
7575
&& sync
7676

77+
WORKDIR /usr/local/${project}/${project}
78+
RUN echo "#log: ${project}: Installing sources" \
79+
&& set -x \
80+
&& install -d /usr/local/src/${project}/deploy/ \
81+
&& install *.tgz /usr/local/src/${project}/deploy/ \
82+
&& cp -rfva ./build/stage/ /usr/local/src/${project}/deploy/ \
83+
&& find /usr/local/src/${project}/deploy/ -type f \
84+
&& sync

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Publishing of the prebuilt binaries is performed on CircleCI and AppVeyor.
9696

9797
# Acknowledgments
9898

99-
Most of the work in this library is from the [node-sqlite3](https://github.com/mapbox/node-sqlite3) library by [MapBox](http://mapbox.org/).
99+
Most of the work in this library is from the [node-sqlite3](https://github.com/mapbox/node-sqlite3) library by [MapBox](https://mapbox.com/).
100100

101101
Additionally, some of the SQLCipher-related changes are based on a fork by [liubiggun](https://github.com/liubiggun/node-sqlite3).
102102

appveyor.yml

Lines changed: 77 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
environment:
22
matrix:
3-
- nodejs_version: 8
4-
platform: x64
5-
- nodejs_version: 8
6-
platform: x86
73
- nodejs_version: 10
84
platform: x64
95
- nodejs_version: 10
@@ -12,39 +8,97 @@ environment:
128
platform: x64
139
- nodejs_version: 12
1410
platform: x86
11+
- nodejs_version: 13
12+
platform: x64
13+
- nodejs_version: 13
14+
platform: x86
15+
- nodejs_version: 14
16+
platform: x64
17+
- nodejs_version: 14
18+
platform: x86
1519
# electron
16-
- nodejs_version: 10
20+
- nodejs_version: 12.13.0
1721
platform: x64
1822
NODE_RUNTIME: electron
19-
NODE_RUNTIME_VERSION: 8.1.1
20-
TOOLSET_ARGS: --dist-url=https://atom.io/download/electron
21-
- nodejs_version: 10
23+
NODE_RUNTIME_VERSION: 8.2.0
24+
TOOLSET_ARGS: --dist-url=https://electronjs.org/headers
25+
- nodejs_version: 12.13.0
2226
platform: x86
2327
NODE_RUNTIME: electron
24-
NODE_RUNTIME_VERSION: 8.1.1
25-
TOOLSET_ARGS: --dist-url=https://atom.io/download/electron
26-
- nodejs_version: 10
28+
NODE_RUNTIME_VERSION: 8.2.0
29+
TOOLSET_ARGS: --dist-url=https://electronjs.org/headers
30+
- nodejs_version: 12.13.0
2731
platform: x64
2832
NODE_RUNTIME: electron
29-
NODE_RUNTIME_VERSION: 7.1.14
30-
TOOLSET_ARGS: --dist-url=https://atom.io/download/electron
31-
- nodejs_version: 10
33+
NODE_RUNTIME_VERSION: 8.1.0
34+
TOOLSET_ARGS: --dist-url=https://electronjs.org/headers
35+
- nodejs_version: 12.13.0
3236
platform: x86
3337
NODE_RUNTIME: electron
34-
NODE_RUNTIME_VERSION: 7.1.14
35-
TOOLSET_ARGS: --dist-url=https://atom.io/download/electron
36-
- nodejs_version: 10
38+
NODE_RUNTIME_VERSION: 8.1.0
39+
TOOLSET_ARGS: --dist-url=https://electronjs.org/headers
40+
- nodejs_version: 12.13.0
3741
platform: x64
3842
NODE_RUNTIME: electron
39-
NODE_RUNTIME_VERSION: 6.1.9
40-
TOOLSET_ARGS: --dist-url=https://atom.io/download/electron
41-
- nodejs_version: 10
43+
NODE_RUNTIME_VERSION: 8.0.0
44+
TOOLSET_ARGS: --dist-url=https://electronjs.org/headers
45+
- nodejs_version: 12.13.0
46+
platform: x86
47+
NODE_RUNTIME: electron
48+
NODE_RUNTIME_VERSION: 8.0.0
49+
TOOLSET_ARGS: --dist-url=https://electronjs.org/headers
50+
- nodejs_version: 12.8.1
51+
platform: x64
52+
NODE_RUNTIME: electron
53+
NODE_RUNTIME_VERSION: 7.2.0
54+
TOOLSET_ARGS: --dist-url=https://electronjs.org/headers
55+
- nodejs_version: 12.8.1
56+
platform: x86
57+
NODE_RUNTIME: electron
58+
NODE_RUNTIME_VERSION: 7.2.0
59+
TOOLSET_ARGS: --dist-url=https://electronjs.org/headers
60+
- nodejs_version: 12.8.1
61+
platform: x64
62+
NODE_RUNTIME: electron
63+
NODE_RUNTIME_VERSION: 7.1.0
64+
TOOLSET_ARGS: --dist-url=https://electronjs.org/headers
65+
- nodejs_version: 12.8.1
66+
platform: x86
67+
NODE_RUNTIME: electron
68+
NODE_RUNTIME_VERSION: 7.1.0
69+
TOOLSET_ARGS: --dist-url=https://electronjs.org/headers
70+
- nodejs_version: 12.8.1
71+
platform: x64
72+
NODE_RUNTIME: electron
73+
NODE_RUNTIME_VERSION: 7.0.0
74+
TOOLSET_ARGS: --dist-url=https://electronjs.org/headers
75+
- nodejs_version: 12.8.1
76+
platform: x86
77+
NODE_RUNTIME: electron
78+
NODE_RUNTIME_VERSION: 7.0.0
79+
TOOLSET_ARGS: --dist-url=https://electronjs.org/headers
80+
- nodejs_version: 12.4.0
81+
platform: x64
82+
NODE_RUNTIME: electron
83+
NODE_RUNTIME_VERSION: 6.1.0
84+
TOOLSET_ARGS: --dist-url=https://electronjs.org/headers
85+
- nodejs_version: 12.4.0
86+
platform: x86
87+
NODE_RUNTIME: electron
88+
NODE_RUNTIME_VERSION: 6.1.0
89+
TOOLSET_ARGS: --dist-url=https://electronjs.org/headers
90+
- nodejs_version: 12.4.0
91+
platform: x64
92+
NODE_RUNTIME: electron
93+
NODE_RUNTIME_VERSION: 6.0.0
94+
TOOLSET_ARGS: --dist-url=https://electronjs.org/headers
95+
- nodejs_version: 12.4.0
4296
platform: x86
4397
NODE_RUNTIME: electron
44-
NODE_RUNTIME_VERSION: 6.1.9
45-
TOOLSET_ARGS: --dist-url=https://atom.io/download/electron
98+
NODE_RUNTIME_VERSION: 6.0.0
99+
TOOLSET_ARGS: --dist-url=https://electronjs.org/headers
46100

47-
os: Visual Studio 2015
101+
image: Visual Studio 2017
48102

49103

50104
install:

binding.gyp

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,21 @@
77
"targets": [
88
{
99
"target_name": "<(module_name)",
10-
"include_dirs": ["<!(node -e \"require('nan')\")"],
10+
"cflags!": [ "-fno-exceptions" ],
11+
"cflags_cc!": [ "-fno-exceptions" ],
12+
"xcode_settings": { "GCC_ENABLE_CPP_EXCEPTIONS": "YES",
13+
"CLANG_CXX_LIBRARY": "libc++",
14+
"MACOSX_DEPLOYMENT_TARGET": "10.7",
15+
},
16+
"msvs_settings": {
17+
"VCCLCompilerTool": { "ExceptionHandling": 1 },
18+
},
19+
"include_dirs": [
20+
"<!@(node -p \"require('node-addon-api').include\")"],
1121
"conditions": [
1222
["sqlite != 'internal'", {
13-
"include_dirs": [ "<(sqlite)/include" ],
23+
"include_dirs": [
24+
"<!@(node -p \"require('node-addon-api').include\")", "<(sqlite)/include" ],
1425
"libraries": [
1526
"-l<(sqlite_libname)"
1627
],
@@ -26,6 +37,7 @@
2637
},
2738
{
2839
"dependencies": [
40+
"<!(node -p \"require('node-addon-api').gyp\")",
2941
"deps/sqlite3.gyp:sqlite3"
3042
]
3143
}
@@ -36,7 +48,8 @@
3648
"src/database.cc",
3749
"src/node_sqlite3.cc",
3850
"src/statement.cc"
39-
]
51+
],
52+
"defines": [ "NAPI_VERSION=<(napi_build_version)", "NAPI_DISABLE_CPP_EXCEPTIONS=1" ]
4053
},
4154
{
4255
"target_name": "action_after_build",

deps/common-sqlite.gypi

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
},
66
'target_defaults': {
77
'default_configuration': 'Release',
8-
'msbuild_toolset':'<(toolset)',
8+
'conditions': [
9+
[ 'toolset!=""', {
10+
'msbuild_toolset':'<(toolset)'
11+
}]
12+
],
913
'configurations': {
1014
'Debug': {
1115
'defines!': [

deps/sqlite3.gyp

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
'includes': [ 'common-sqlite.gypi' ],
3+
4+
'variables': {
5+
'sqlite_magic%': '',
6+
},
7+
38
'target_defaults': {
49
'default_configuration': 'Release',
510
'cflags':[
@@ -163,7 +168,8 @@
163168
'SQLITE_ENABLE_RTREE',
164169
'SQLITE_HAS_CODEC',
165170
'SQLITE_TEMP_STORE=2',
166-
'SQLITE_SECURE_DELETE'
171+
'SQLITE_SECURE_DELETE',
172+
'SQLITE_ENABLE_DBSTAT_VTAB=1'
167173
],
168174
},
169175
'cflags_cc': [
@@ -179,11 +185,19 @@
179185
'SQLITE_ENABLE_RTREE',
180186
'SQLITE_HAS_CODEC',
181187
'SQLITE_TEMP_STORE=2',
182-
'SQLITE_SECURE_DELETE'
188+
'SQLITE_SECURE_DELETE',
189+
'SQLITE_ENABLE_DBSTAT_VTAB=1'
183190
],
184191
'export_dependent_settings': [
185192
'action_before_build',
186-
]
193+
],
194+
'conditions': [
195+
["sqlite_magic != ''", {
196+
'defines': [
197+
'SQLITE_FILE_HEADER="<(sqlite_magic)"'
198+
]
199+
}]
200+
],
187201
}
188202
]
189203
}

lib/sqlite3-binding.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var binary = require('node-pre-gyp');
2+
var path = require('path');
3+
var binding_path = binary.find(path.resolve(path.join(__dirname,'../package.json')));
4+
var binding = require(binding_path);
5+
module.exports = exports = binding;

lib/sqlite3.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
var binary = require('node-pre-gyp');
21
var path = require('path');
3-
var binding_path = binary.find(path.resolve(path.join(__dirname,'../package.json')));
4-
var binding = require(binding_path);
5-
var sqlite3 = module.exports = exports = binding;
2+
var sqlite3 = require('./sqlite3-binding.js');
63
var EventEmitter = require('events').EventEmitter;
4+
module.exports = exports = sqlite3;
75

86
function normalizeMethod (fn) {
97
return function (sql) {

lib/trace.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,14 @@ function extendTrace(object, property, pos) {
1515
var cb = arguments[pos];
1616
if (typeof arguments[pos] === 'function') {
1717
arguments[pos] = function replacement() {
18-
try {
19-
return cb.apply(this, arguments);
20-
} catch (err) {
21-
if (err && err.stack && !err.__augmented) {
22-
err.stack = filter(err).join('\n');
23-
err.stack += '\n--> in ' + name;
24-
err.stack += '\n' + filter(error).slice(1).join('\n');
25-
err.__augmented = true;
26-
}
27-
throw err;
18+
var err = arguments[0];
19+
if (err && err.stack && !err.__augmented) {
20+
err.stack = filter(err).join('\n');
21+
err.stack += '\n--> in ' + name;
22+
err.stack += '\n' + filter(error).slice(1).join('\n');
23+
err.__augmented = true;
2824
}
25+
return cb.apply(this, arguments);
2926
};
3027
}
3128
return old.apply(this, arguments);

0 commit comments

Comments
 (0)