upgraded to SQLite version 3.38.2, and removed symlinks during build phase

This commit is contained in:
Joshua Wise 2022-04-06 22:21:36 -05:00
parent 5e07181b11
commit d09615c936
8 changed files with 34 additions and 27 deletions

26
deps/copy.js vendored Normal file
View File

@ -0,0 +1,26 @@
'use strict';
const path = require('path');
const fs = require('fs');
const dest = process.argv[2];
const source = path.resolve(path.sep, process.argv[3] || path.join(__dirname, 'sqlite3'));
const files = [
{ filename: 'sqlite3.c', optional: false },
{ filename: 'sqlite3.h', optional: false },
];
if (process.argv[3]) {
// Support "_HAVE_SQLITE_CONFIG_H" in custom builds.
files.push({ filename: 'config.h', optional: true });
} else {
// Required for some tests.
files.push({ filename: 'sqlite3ext.h', optional: false });
}
for (const { filename, optional } of files) {
if (optional && !fs.existsSync(path.join(source, filename))) {
continue;
}
fs.accessSync(path.join(source, filename));
fs.copyFileSync(path.join(source, filename), path.join(dest, filename));
}

6
deps/download.sh vendored
View File

@ -13,13 +13,13 @@
#
# When a user builds better-sqlite3, the following steps are taken:
# 1. node-gyp loads the previously exported compile-time options (defines.gypi).
# 2. the symlink.js script creates symlinks to the bundled amalgamation.
# 3. node-gyp compiles the symlinked sqlite3.c along with better_sqlite3.cpp.
# 2. the copy.js script copies the bundled amalgamation into the build folder.
# 3. node-gyp compiles the copied sqlite3.c along with better_sqlite3.cpp.
# 4. node-gyp links the two resulting binaries to generate better_sqlite3.node.
# ===
YEAR="2022"
VERSION="3370200"
VERSION="3380200"
DEFINES="
SQLITE_DQS=0

8
deps/sqlite3.gyp vendored
View File

@ -14,7 +14,7 @@
'conditions': [
['sqlite3 == ""', {
'actions': [{
'action_name': 'symlink_builtin_sqlite3',
'action_name': 'copy_builtin_sqlite3',
'inputs': [
'sqlite3/sqlite3.c',
'sqlite3/sqlite3.h',
@ -25,11 +25,11 @@
'<(SHARED_INTERMEDIATE_DIR)/sqlite3/sqlite3.h',
'<(SHARED_INTERMEDIATE_DIR)/sqlite3/sqlite3ext.h',
],
'action': ['node', 'symlink.js', '<(SHARED_INTERMEDIATE_DIR)/sqlite3', '', 'sqlite3.c', 'sqlite3.h', 'sqlite3ext.h'],
'action': ['node', 'copy.js', '<(SHARED_INTERMEDIATE_DIR)/sqlite3', ''],
}],
}, {
'actions': [{
'action_name': 'symlink_custom_sqlite3',
'action_name': 'copy_custom_sqlite3',
'inputs': [
'<(sqlite3)/sqlite3.c',
'<(sqlite3)/sqlite3.h',
@ -38,7 +38,7 @@
'<(SHARED_INTERMEDIATE_DIR)/sqlite3/sqlite3.c',
'<(SHARED_INTERMEDIATE_DIR)/sqlite3/sqlite3.h',
],
'action': ['node', 'symlink.js', '<(SHARED_INTERMEDIATE_DIR)/sqlite3', '<(sqlite3)', 'sqlite3.c', 'sqlite3.h'],
'action': ['node', 'copy.js', '<(SHARED_INTERMEDIATE_DIR)/sqlite3', '<(sqlite3)'],
}],
}],
],

BIN
deps/sqlite3/sqlite3.c vendored

Binary file not shown.

BIN
deps/sqlite3/sqlite3.h vendored

Binary file not shown.

Binary file not shown.

19
deps/symlink.js vendored
View File

@ -1,19 +0,0 @@
'use strict';
const path = require('path');
const fs = require('fs');
const dest = process.argv[2];
const source = path.resolve(path.sep, process.argv[3] || path.join(__dirname, 'sqlite3'));
const filenames = process.argv.slice(4).map(str => path.basename(str));
/*
This creates symlinks inside the <$2> directory, linking to files inside the
directory specified by the absolute path <$3>. If no path <$3> is provided,
the default path of "./deps/sqlite3" is used. The basenames of the files to
link are specified by <$4...>.
*/
for (const filename of filenames) {
fs.accessSync(path.join(source, filename));
fs.symlinkSync(path.join(source, filename), path.join(dest, filename), 'file');
}

View File

@ -42,7 +42,7 @@ If you're using a SQLite3 encryption extension that is a drop-in replacement for
# Bundled configuration
By default, this distribution currently uses SQLite3 **version 3.37.2** with the following [compilation options](https://www.sqlite.org/compile.html):
By default, this distribution currently uses SQLite3 **version 3.38.2** with the following [compilation options](https://www.sqlite.org/compile.html):
```
SQLITE_DQS=0