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
@@ -0,0 +1,24 @@
|
||||
import { expect, it } from 'vitest';
|
||||
import { assertRuntime, prebuildFiles, runtimeLibc, runtimePrebuild } from '../src/layout';
|
||||
|
||||
it('selects only the exact platform, architecture and libc binary', () => {
|
||||
expect(runtimePrebuild('win32', 'arm64')).toBe('win32-arm64/@appthreat+sqlite3.node');
|
||||
expect(runtimePrebuild('darwin', 'x64')).toBe('darwin-x64/@appthreat+sqlite3.node');
|
||||
expect(
|
||||
runtimePrebuild('linux', 'arm64', runtimeLibc({ header: { glibcVersionRuntime: '2.39' } })),
|
||||
).toBe('linux-arm64/@appthreat+sqlite3.glibc.node');
|
||||
expect(runtimePrebuild('linux', 'x64', runtimeLibc({ header: {} }))).toBe(
|
||||
'linux-x64/@appthreat+sqlite3.musl.node',
|
||||
);
|
||||
expect(() => runtimePrebuild('linux', 'x64')).toThrow('libc');
|
||||
expect(() => prebuildFiles('linux-ia32')).toThrow('Unsupported SQLite target');
|
||||
expect(() => runtimeLibc({})).toThrow('diagnostic report');
|
||||
});
|
||||
|
||||
it('rejects incompatible runtimes before attempting to load a Node-API 10 binary', () => {
|
||||
expect(() => assertRuntime('24.0.0', '10')).not.toThrow();
|
||||
expect(() => assertRuntime('26.0.0', '11')).not.toThrow();
|
||||
expect(() => assertRuntime('22.0.0', '10')).toThrow('Node >=24');
|
||||
expect(() => assertRuntime('24.0.0', '9')).toThrow('Node-API >=10');
|
||||
expect(() => assertRuntime('24.0.0', undefined)).toThrow('Node-API >=10');
|
||||
});
|
||||
Reference in new issue
Block a user