Skip to content

Commit 47a9539

Browse files
Ralf KistnerRalf Kistner
authored andcommitted
Use upstream wa-sqlite.
1 parent ff079fe commit 47a9539

File tree

5 files changed

+19
-24
lines changed

5 files changed

+19
-24
lines changed

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v22.5.1
1+
v22.20.0

packages/wa-sqlite-driver/src/wa-sqlite-driver.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
import * as SQLite from '@journeyapps/wa-sqlite';
2-
// import SQLiteESMFactory from '@journeyapps/wa-sqlite/dist/wa-sqlite-async.mjs';
3-
import SQLiteESMFactory from '@journeyapps/wa-sqlite/dist/wa-sqlite.mjs';
4-
// import * as SQLite from 'wa-sqlite';
5-
// import SQLiteESMFactory from 'wa-sqlite/dist/wa-sqlite-async.mjs';
1+
import * as SQLite from 'wa-sqlite';
2+
import SQLiteESMFactory from 'wa-sqlite/dist/wa-sqlite-async.mjs';
63
import {
74
PrepareOptions,
85
ResetOptions,

packages/wa-sqlite-driver/src/wa-sqlite-worker.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import { OPFSCoopSyncVFS2 } from './OPFSCoopSyncVFS2';
22
import { sqlite3, module, WaSqliteConnection } from './wa-sqlite-driver';
33
import { setupDriverWorker } from './worker_threads';
4-
import { IDBBatchAtomicVFS } from '@journeyapps/wa-sqlite/src/examples/IDBBatchAtomicVFS.js';
5-
import { OPFSAdaptiveVFS } from '@journeyapps/wa-sqlite/src/examples/OPFSAdaptiveVFS.js';
6-
import { OPFSPermutedVFS } from '@journeyapps/wa-sqlite/src/examples/OPFSPermutedVFS.js';
7-
import { IDBBatchAtomicVFS as IDBBatchAtomicVFS0 } from 'wa-sqlite/src/examples/IDBBatchAtomicVFS.js';
4+
import { IDBBatchAtomicVFS } from 'wa-sqlite/src/examples/IDBBatchAtomicVFS.js';
5+
import { OPFSAdaptiveVFS } from 'wa-sqlite/src/examples/OPFSAdaptiveVFS.js';
6+
import { OPFSPermutedVFS } from 'wa-sqlite/src/examples/OPFSPermutedVFS.js';
87

98
let vfs: any | null = null;
109
setupDriverWorker({
@@ -13,13 +12,13 @@ setupDriverWorker({
1312
if (vfs != null) {
1413
throw new Error('Can only open one connection');
1514
}
16-
vfs = await OPFSCoopSyncVFS2.create(
17-
'test.db',
18-
module,
19-
options.readonly ?? false
20-
);
15+
// vfs = await OPFSCoopSyncVFS2.create(
16+
// 'test.db',
17+
// module,
18+
// options.readonly ?? false
19+
// );
2120
// IDBBatchAtomicVFS - breaks hard (database disk image is malformed)
22-
// vfs = await (IDBBatchAtomicVFS0 as any).create('test.db', module);
21+
vfs = await (IDBBatchAtomicVFS as any).create('test.db', module);
2322
// OPFSAdaptiveVFS - works great
2423
// vfs = await (OPFSAdaptiveVFS as any).create('test.db', module, {
2524
// ifAvailable: true,

packages/wa-sqlite-driver/vitest.config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import { defineConfig } from 'vitest/config';
22
import wasm from 'vite-plugin-wasm';
3-
import topLevelAwait from 'vite-plugin-top-level-await';
43

54
export default defineConfig({
65
esbuild: { target: 'es2022' },
76
plugins: [wasm()],
87
optimizeDeps: {
98
// Don't optimise these packages as they contain web workers and WASM files.
109
// https://github.com/vitejs/vite/issues/11672#issuecomment-1415820673
11-
exclude: ['@journeyapps/wa-sqlite'],
10+
exclude: ['wa-sqlite'],
1211
include: []
1312
},
1413
define: {

pnpm-lock.yaml

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)