feat: add async SQLite on Node 24 and improve messaging diagnostics (#520)
Move database work off the main thread on Node.js 24 and improve message handling and runtime diagnostics. Preserve migration, restart, and concurrency coverage with the async SQLite driver.
This commit is contained in:
1 parent
20f48d11ec
commit
c7428363cb
170 files changed
+7748
-3913
No files matched your search
@@ -11,6 +11,24 @@ if (!fs.statSync(entryPoint, { throwIfNoEntry: false })?.isFile()) {
|
||||
throw new Error(`release entry point must be at the archive root: ${entryPoint}`);
|
||||
}
|
||||
|
||||
const sqliteRoot = path.join(root, 'native', 'sqlite');
|
||||
const sqlite = JSON.parse(fs.readFileSync(path.join(sqliteRoot, 'manifest.json'), 'utf8'));
|
||||
if (sqlite.package !== '@appthreat/sqlite3' || sqlite.version !== '9.1.0' || sqlite.nativeInterface !== 1
|
||||
|| !/^(win32|linux|darwin)-(x64|arm64)$/.test(sqlite.target)) {
|
||||
throw new Error('release has an invalid SQLite native manifest');
|
||||
}
|
||||
const expectedSqliteFiles = (sqlite.target.startsWith('linux-')
|
||||
? ['@appthreat+sqlite3.glibc.node', '@appthreat+sqlite3.musl.node']
|
||||
: ['@appthreat+sqlite3.node']).map(file => `prebuilds/${sqlite.target}/${file}`);
|
||||
if (JSON.stringify(sqlite.files) !== JSON.stringify(expectedSqliteFiles)) {
|
||||
throw new Error('release SQLite manifest does not contain the required platform/libc variants');
|
||||
}
|
||||
for (const file of [...expectedSqliteFiles, 'LICENSE.sqlite3']) {
|
||||
if (!fs.statSync(path.join(sqliteRoot, file), { throwIfNoEntry: false })?.isFile()) {
|
||||
throw new Error(`release is missing SQLite runtime input: ${file}`);
|
||||
}
|
||||
}
|
||||
|
||||
const forbidden = [];
|
||||
const pending = [root];
|
||||
while (pending.length > 0) {
|
||||
|
||||
Reference in new issue
Block a user