@tursodatabase/sync 0.4.0-pre.9 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/promise.js +8 -8
- package/dist/promise.test.js +14 -14
- package/index.js +46 -46
- package/package.json +8 -8
package/dist/promise.js
CHANGED
|
@@ -51,20 +51,20 @@ class Database extends DatabasePromise {
|
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
53
|
let partialSyncOpts = undefined;
|
|
54
|
-
if (opts.
|
|
55
|
-
switch (opts.
|
|
54
|
+
if (opts.partialSyncExperimental != null) {
|
|
55
|
+
switch (opts.partialSyncExperimental.bootstrapStrategy.kind) {
|
|
56
56
|
case "prefix":
|
|
57
57
|
partialSyncOpts = {
|
|
58
|
-
bootstrapStrategy: { type: "Prefix", length: opts.
|
|
59
|
-
segmentSize: opts.
|
|
60
|
-
|
|
58
|
+
bootstrapStrategy: { type: "Prefix", length: opts.partialSyncExperimental.bootstrapStrategy.length },
|
|
59
|
+
segmentSize: opts.partialSyncExperimental.segmentSize,
|
|
60
|
+
prefetch: opts.partialSyncExperimental.prefetch,
|
|
61
61
|
};
|
|
62
62
|
break;
|
|
63
63
|
case "query":
|
|
64
64
|
partialSyncOpts = {
|
|
65
|
-
bootstrapStrategy: { type: "Query", query: opts.
|
|
66
|
-
segmentSize: opts.
|
|
67
|
-
|
|
65
|
+
bootstrapStrategy: { type: "Query", query: opts.partialSyncExperimental.bootstrapStrategy.query },
|
|
66
|
+
segmentSize: opts.partialSyncExperimental.segmentSize,
|
|
67
|
+
prefetch: opts.partialSyncExperimental.prefetch,
|
|
68
68
|
};
|
|
69
69
|
break;
|
|
70
70
|
}
|
package/dist/promise.test.js
CHANGED
|
@@ -32,7 +32,7 @@ test('partial sync concurrency', async () => {
|
|
|
32
32
|
path: 'partial-1.db',
|
|
33
33
|
url: process.env.VITE_TURSO_DB_URL,
|
|
34
34
|
longPollTimeoutMs: 100,
|
|
35
|
-
|
|
35
|
+
partialSyncExperimental: {
|
|
36
36
|
bootstrapStrategy: { kind: 'prefix', length: 128 * 1024 },
|
|
37
37
|
segmentSize: 128 * 1024,
|
|
38
38
|
},
|
|
@@ -62,7 +62,7 @@ test('partial sync (prefix bootstrap strategy)', async () => {
|
|
|
62
62
|
path: ':memory:',
|
|
63
63
|
url: process.env.VITE_TURSO_DB_URL,
|
|
64
64
|
longPollTimeoutMs: 100,
|
|
65
|
-
|
|
65
|
+
partialSyncExperimental: {
|
|
66
66
|
bootstrapStrategy: { kind: 'prefix', length: 128 * 1024 },
|
|
67
67
|
segmentSize: 4096,
|
|
68
68
|
},
|
|
@@ -93,7 +93,7 @@ test('partial sync (prefix bootstrap strategy; large segment size)', async () =>
|
|
|
93
93
|
path: ':memory:',
|
|
94
94
|
url: process.env.VITE_TURSO_DB_URL,
|
|
95
95
|
longPollTimeoutMs: 100,
|
|
96
|
-
|
|
96
|
+
partialSyncExperimental: {
|
|
97
97
|
bootstrapStrategy: { kind: 'prefix', length: 128 * 1024 },
|
|
98
98
|
segmentSize: 128 * 1024,
|
|
99
99
|
},
|
|
@@ -111,7 +111,7 @@ test('partial sync (prefix bootstrap strategy; large segment size)', async () =>
|
|
|
111
111
|
console.info('select all', 'elapsed', performance.now() - startAll);
|
|
112
112
|
expect((await db.stats()).networkReceivedBytes).toBeGreaterThanOrEqual(2000 * 1024);
|
|
113
113
|
});
|
|
114
|
-
test('partial sync (prefix bootstrap strategy;
|
|
114
|
+
test('partial sync (prefix bootstrap strategy; prefetch)', async () => {
|
|
115
115
|
{
|
|
116
116
|
const db = await connect({
|
|
117
117
|
path: ':memory:',
|
|
@@ -128,10 +128,10 @@ test('partial sync (prefix bootstrap strategy; speculative load)', async () => {
|
|
|
128
128
|
path: ':memory:',
|
|
129
129
|
url: process.env.VITE_TURSO_DB_URL,
|
|
130
130
|
longPollTimeoutMs: 100,
|
|
131
|
-
|
|
131
|
+
partialSyncExperimental: {
|
|
132
132
|
bootstrapStrategy: { kind: 'prefix', length: 128 * 1024 },
|
|
133
133
|
segmentSize: 4 * 1024,
|
|
134
|
-
|
|
134
|
+
prefetch: true,
|
|
135
135
|
},
|
|
136
136
|
});
|
|
137
137
|
// 128kb plus some overhead
|
|
@@ -164,7 +164,7 @@ test('partial sync (query bootstrap strategy)', async () => {
|
|
|
164
164
|
path: ':memory:',
|
|
165
165
|
url: process.env.VITE_TURSO_DB_URL,
|
|
166
166
|
longPollTimeoutMs: 100,
|
|
167
|
-
|
|
167
|
+
partialSyncExperimental: {
|
|
168
168
|
bootstrapStrategy: { kind: 'query', query: 'SELECT * FROM partial_keyed WHERE key = 1000' },
|
|
169
169
|
segmentSize: 4096,
|
|
170
170
|
},
|
|
@@ -214,7 +214,7 @@ test('concurrent-actions-consistency', async () => {
|
|
|
214
214
|
await new Promise(resolve => setTimeout(resolve, (Math.random() + 1)));
|
|
215
215
|
console.info('push', i);
|
|
216
216
|
try {
|
|
217
|
-
if ((await db1.stats()).
|
|
217
|
+
if ((await db1.stats()).cdcOperations > 0) {
|
|
218
218
|
const start = performance.now();
|
|
219
219
|
await db1.push();
|
|
220
220
|
console.info('push', performance.now() - start);
|
|
@@ -446,16 +446,16 @@ test('checkpoint', async () => {
|
|
|
446
446
|
for (let i = 0; i < 1000; i++) {
|
|
447
447
|
await db1.exec(`INSERT INTO q VALUES ('k${i}', 'v${i}')`);
|
|
448
448
|
}
|
|
449
|
-
expect((await db1.stats()).
|
|
449
|
+
expect((await db1.stats()).mainWalSize).toBeGreaterThan(4096 * 1000);
|
|
450
450
|
await db1.checkpoint();
|
|
451
|
-
expect((await db1.stats()).
|
|
452
|
-
let revertWal = (await db1.stats()).
|
|
451
|
+
expect((await db1.stats()).mainWalSize).toBe(0);
|
|
452
|
+
let revertWal = (await db1.stats()).revertWalSize;
|
|
453
453
|
expect(revertWal).toBeLessThan(4096 * 1000 / 50);
|
|
454
454
|
for (let i = 0; i < 1000; i++) {
|
|
455
455
|
await db1.exec(`UPDATE q SET y = 'u${i}' WHERE x = 'k${i}'`);
|
|
456
456
|
}
|
|
457
457
|
await db1.checkpoint();
|
|
458
|
-
expect((await db1.stats()).
|
|
458
|
+
expect((await db1.stats()).revertWalSize).toBe(revertWal);
|
|
459
459
|
});
|
|
460
460
|
test('persistence-push', async () => {
|
|
461
461
|
{
|
|
@@ -687,7 +687,7 @@ test('pull-push-concurrent', async () => {
|
|
|
687
687
|
};
|
|
688
688
|
let push = async () => {
|
|
689
689
|
try {
|
|
690
|
-
if ((await db.stats()).
|
|
690
|
+
if ((await db.stats()).cdcOperations > 0) {
|
|
691
691
|
await db.push();
|
|
692
692
|
}
|
|
693
693
|
}
|
|
@@ -745,7 +745,7 @@ test('checkpoint-and-actions', async () => {
|
|
|
745
745
|
for (let i = 0; i < iterations; i++) {
|
|
746
746
|
await new Promise(resolve => setTimeout(resolve, 5));
|
|
747
747
|
try {
|
|
748
|
-
if ((await db1.stats()).
|
|
748
|
+
if ((await db1.stats()).cdcOperations > 0) {
|
|
749
749
|
const start = performance.now();
|
|
750
750
|
await db1.push();
|
|
751
751
|
console.info('push', performance.now() - start);
|
package/index.js
CHANGED
|
@@ -81,8 +81,8 @@ function requireNative() {
|
|
|
81
81
|
try {
|
|
82
82
|
const binding = require('@tursodatabase/sync-android-arm64')
|
|
83
83
|
const bindingPackageVersion = require('@tursodatabase/sync-android-arm64/package.json').version
|
|
84
|
-
if (bindingPackageVersion !== '0.4.0-pre.
|
|
85
|
-
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.
|
|
84
|
+
if (bindingPackageVersion !== '0.4.0-pre.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
85
|
+
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
86
86
|
}
|
|
87
87
|
return binding
|
|
88
88
|
} catch (e) {
|
|
@@ -97,8 +97,8 @@ function requireNative() {
|
|
|
97
97
|
try {
|
|
98
98
|
const binding = require('@tursodatabase/sync-android-arm-eabi')
|
|
99
99
|
const bindingPackageVersion = require('@tursodatabase/sync-android-arm-eabi/package.json').version
|
|
100
|
-
if (bindingPackageVersion !== '0.4.0-pre.
|
|
101
|
-
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.
|
|
100
|
+
if (bindingPackageVersion !== '0.4.0-pre.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
101
|
+
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
102
102
|
}
|
|
103
103
|
return binding
|
|
104
104
|
} catch (e) {
|
|
@@ -117,8 +117,8 @@ function requireNative() {
|
|
|
117
117
|
try {
|
|
118
118
|
const binding = require('@tursodatabase/sync-win32-x64-msvc')
|
|
119
119
|
const bindingPackageVersion = require('@tursodatabase/sync-win32-x64-msvc/package.json').version
|
|
120
|
-
if (bindingPackageVersion !== '0.4.0-pre.
|
|
121
|
-
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.
|
|
120
|
+
if (bindingPackageVersion !== '0.4.0-pre.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
121
|
+
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
122
122
|
}
|
|
123
123
|
return binding
|
|
124
124
|
} catch (e) {
|
|
@@ -133,8 +133,8 @@ function requireNative() {
|
|
|
133
133
|
try {
|
|
134
134
|
const binding = require('@tursodatabase/sync-win32-ia32-msvc')
|
|
135
135
|
const bindingPackageVersion = require('@tursodatabase/sync-win32-ia32-msvc/package.json').version
|
|
136
|
-
if (bindingPackageVersion !== '0.4.0-pre.
|
|
137
|
-
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.
|
|
136
|
+
if (bindingPackageVersion !== '0.4.0-pre.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
137
|
+
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
138
138
|
}
|
|
139
139
|
return binding
|
|
140
140
|
} catch (e) {
|
|
@@ -149,8 +149,8 @@ function requireNative() {
|
|
|
149
149
|
try {
|
|
150
150
|
const binding = require('@tursodatabase/sync-win32-arm64-msvc')
|
|
151
151
|
const bindingPackageVersion = require('@tursodatabase/sync-win32-arm64-msvc/package.json').version
|
|
152
|
-
if (bindingPackageVersion !== '0.4.0-pre.
|
|
153
|
-
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.
|
|
152
|
+
if (bindingPackageVersion !== '0.4.0-pre.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
153
|
+
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
154
154
|
}
|
|
155
155
|
return binding
|
|
156
156
|
} catch (e) {
|
|
@@ -168,8 +168,8 @@ function requireNative() {
|
|
|
168
168
|
try {
|
|
169
169
|
const binding = require('@tursodatabase/sync-darwin-universal')
|
|
170
170
|
const bindingPackageVersion = require('@tursodatabase/sync-darwin-universal/package.json').version
|
|
171
|
-
if (bindingPackageVersion !== '0.4.0-pre.
|
|
172
|
-
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.
|
|
171
|
+
if (bindingPackageVersion !== '0.4.0-pre.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
172
|
+
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
173
173
|
}
|
|
174
174
|
return binding
|
|
175
175
|
} catch (e) {
|
|
@@ -184,8 +184,8 @@ function requireNative() {
|
|
|
184
184
|
try {
|
|
185
185
|
const binding = require('@tursodatabase/sync-darwin-x64')
|
|
186
186
|
const bindingPackageVersion = require('@tursodatabase/sync-darwin-x64/package.json').version
|
|
187
|
-
if (bindingPackageVersion !== '0.4.0-pre.
|
|
188
|
-
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.
|
|
187
|
+
if (bindingPackageVersion !== '0.4.0-pre.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
188
|
+
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
189
189
|
}
|
|
190
190
|
return binding
|
|
191
191
|
} catch (e) {
|
|
@@ -200,8 +200,8 @@ function requireNative() {
|
|
|
200
200
|
try {
|
|
201
201
|
const binding = require('@tursodatabase/sync-darwin-arm64')
|
|
202
202
|
const bindingPackageVersion = require('@tursodatabase/sync-darwin-arm64/package.json').version
|
|
203
|
-
if (bindingPackageVersion !== '0.4.0-pre.
|
|
204
|
-
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.
|
|
203
|
+
if (bindingPackageVersion !== '0.4.0-pre.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
204
|
+
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
205
205
|
}
|
|
206
206
|
return binding
|
|
207
207
|
} catch (e) {
|
|
@@ -220,8 +220,8 @@ function requireNative() {
|
|
|
220
220
|
try {
|
|
221
221
|
const binding = require('@tursodatabase/sync-freebsd-x64')
|
|
222
222
|
const bindingPackageVersion = require('@tursodatabase/sync-freebsd-x64/package.json').version
|
|
223
|
-
if (bindingPackageVersion !== '0.4.0-pre.
|
|
224
|
-
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.
|
|
223
|
+
if (bindingPackageVersion !== '0.4.0-pre.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
224
|
+
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
225
225
|
}
|
|
226
226
|
return binding
|
|
227
227
|
} catch (e) {
|
|
@@ -236,8 +236,8 @@ function requireNative() {
|
|
|
236
236
|
try {
|
|
237
237
|
const binding = require('@tursodatabase/sync-freebsd-arm64')
|
|
238
238
|
const bindingPackageVersion = require('@tursodatabase/sync-freebsd-arm64/package.json').version
|
|
239
|
-
if (bindingPackageVersion !== '0.4.0-pre.
|
|
240
|
-
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.
|
|
239
|
+
if (bindingPackageVersion !== '0.4.0-pre.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
240
|
+
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
241
241
|
}
|
|
242
242
|
return binding
|
|
243
243
|
} catch (e) {
|
|
@@ -257,8 +257,8 @@ function requireNative() {
|
|
|
257
257
|
try {
|
|
258
258
|
const binding = require('@tursodatabase/sync-linux-x64-musl')
|
|
259
259
|
const bindingPackageVersion = require('@tursodatabase/sync-linux-x64-musl/package.json').version
|
|
260
|
-
if (bindingPackageVersion !== '0.4.0-pre.
|
|
261
|
-
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.
|
|
260
|
+
if (bindingPackageVersion !== '0.4.0-pre.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
261
|
+
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
262
262
|
}
|
|
263
263
|
return binding
|
|
264
264
|
} catch (e) {
|
|
@@ -273,8 +273,8 @@ function requireNative() {
|
|
|
273
273
|
try {
|
|
274
274
|
const binding = require('@tursodatabase/sync-linux-x64-gnu')
|
|
275
275
|
const bindingPackageVersion = require('@tursodatabase/sync-linux-x64-gnu/package.json').version
|
|
276
|
-
if (bindingPackageVersion !== '0.4.0-pre.
|
|
277
|
-
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.
|
|
276
|
+
if (bindingPackageVersion !== '0.4.0-pre.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
277
|
+
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
278
278
|
}
|
|
279
279
|
return binding
|
|
280
280
|
} catch (e) {
|
|
@@ -291,8 +291,8 @@ function requireNative() {
|
|
|
291
291
|
try {
|
|
292
292
|
const binding = require('@tursodatabase/sync-linux-arm64-musl')
|
|
293
293
|
const bindingPackageVersion = require('@tursodatabase/sync-linux-arm64-musl/package.json').version
|
|
294
|
-
if (bindingPackageVersion !== '0.4.0-pre.
|
|
295
|
-
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.
|
|
294
|
+
if (bindingPackageVersion !== '0.4.0-pre.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
295
|
+
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
296
296
|
}
|
|
297
297
|
return binding
|
|
298
298
|
} catch (e) {
|
|
@@ -307,8 +307,8 @@ function requireNative() {
|
|
|
307
307
|
try {
|
|
308
308
|
const binding = require('@tursodatabase/sync-linux-arm64-gnu')
|
|
309
309
|
const bindingPackageVersion = require('@tursodatabase/sync-linux-arm64-gnu/package.json').version
|
|
310
|
-
if (bindingPackageVersion !== '0.4.0-pre.
|
|
311
|
-
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.
|
|
310
|
+
if (bindingPackageVersion !== '0.4.0-pre.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
311
|
+
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
312
312
|
}
|
|
313
313
|
return binding
|
|
314
314
|
} catch (e) {
|
|
@@ -325,8 +325,8 @@ function requireNative() {
|
|
|
325
325
|
try {
|
|
326
326
|
const binding = require('@tursodatabase/sync-linux-arm-musleabihf')
|
|
327
327
|
const bindingPackageVersion = require('@tursodatabase/sync-linux-arm-musleabihf/package.json').version
|
|
328
|
-
if (bindingPackageVersion !== '0.4.0-pre.
|
|
329
|
-
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.
|
|
328
|
+
if (bindingPackageVersion !== '0.4.0-pre.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
329
|
+
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
330
330
|
}
|
|
331
331
|
return binding
|
|
332
332
|
} catch (e) {
|
|
@@ -341,8 +341,8 @@ function requireNative() {
|
|
|
341
341
|
try {
|
|
342
342
|
const binding = require('@tursodatabase/sync-linux-arm-gnueabihf')
|
|
343
343
|
const bindingPackageVersion = require('@tursodatabase/sync-linux-arm-gnueabihf/package.json').version
|
|
344
|
-
if (bindingPackageVersion !== '0.4.0-pre.
|
|
345
|
-
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.
|
|
344
|
+
if (bindingPackageVersion !== '0.4.0-pre.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
345
|
+
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
346
346
|
}
|
|
347
347
|
return binding
|
|
348
348
|
} catch (e) {
|
|
@@ -359,8 +359,8 @@ function requireNative() {
|
|
|
359
359
|
try {
|
|
360
360
|
const binding = require('@tursodatabase/sync-linux-riscv64-musl')
|
|
361
361
|
const bindingPackageVersion = require('@tursodatabase/sync-linux-riscv64-musl/package.json').version
|
|
362
|
-
if (bindingPackageVersion !== '0.4.0-pre.
|
|
363
|
-
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.
|
|
362
|
+
if (bindingPackageVersion !== '0.4.0-pre.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
363
|
+
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
364
364
|
}
|
|
365
365
|
return binding
|
|
366
366
|
} catch (e) {
|
|
@@ -375,8 +375,8 @@ function requireNative() {
|
|
|
375
375
|
try {
|
|
376
376
|
const binding = require('@tursodatabase/sync-linux-riscv64-gnu')
|
|
377
377
|
const bindingPackageVersion = require('@tursodatabase/sync-linux-riscv64-gnu/package.json').version
|
|
378
|
-
if (bindingPackageVersion !== '0.4.0-pre.
|
|
379
|
-
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.
|
|
378
|
+
if (bindingPackageVersion !== '0.4.0-pre.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
379
|
+
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
380
380
|
}
|
|
381
381
|
return binding
|
|
382
382
|
} catch (e) {
|
|
@@ -392,8 +392,8 @@ function requireNative() {
|
|
|
392
392
|
try {
|
|
393
393
|
const binding = require('@tursodatabase/sync-linux-ppc64-gnu')
|
|
394
394
|
const bindingPackageVersion = require('@tursodatabase/sync-linux-ppc64-gnu/package.json').version
|
|
395
|
-
if (bindingPackageVersion !== '0.4.0-pre.
|
|
396
|
-
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.
|
|
395
|
+
if (bindingPackageVersion !== '0.4.0-pre.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
396
|
+
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
397
397
|
}
|
|
398
398
|
return binding
|
|
399
399
|
} catch (e) {
|
|
@@ -408,8 +408,8 @@ function requireNative() {
|
|
|
408
408
|
try {
|
|
409
409
|
const binding = require('@tursodatabase/sync-linux-s390x-gnu')
|
|
410
410
|
const bindingPackageVersion = require('@tursodatabase/sync-linux-s390x-gnu/package.json').version
|
|
411
|
-
if (bindingPackageVersion !== '0.4.0-pre.
|
|
412
|
-
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.
|
|
411
|
+
if (bindingPackageVersion !== '0.4.0-pre.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
412
|
+
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
413
413
|
}
|
|
414
414
|
return binding
|
|
415
415
|
} catch (e) {
|
|
@@ -428,8 +428,8 @@ function requireNative() {
|
|
|
428
428
|
try {
|
|
429
429
|
const binding = require('@tursodatabase/sync-openharmony-arm64')
|
|
430
430
|
const bindingPackageVersion = require('@tursodatabase/sync-openharmony-arm64/package.json').version
|
|
431
|
-
if (bindingPackageVersion !== '0.4.0-pre.
|
|
432
|
-
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.
|
|
431
|
+
if (bindingPackageVersion !== '0.4.0-pre.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
432
|
+
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
433
433
|
}
|
|
434
434
|
return binding
|
|
435
435
|
} catch (e) {
|
|
@@ -444,8 +444,8 @@ function requireNative() {
|
|
|
444
444
|
try {
|
|
445
445
|
const binding = require('@tursodatabase/sync-openharmony-x64')
|
|
446
446
|
const bindingPackageVersion = require('@tursodatabase/sync-openharmony-x64/package.json').version
|
|
447
|
-
if (bindingPackageVersion !== '0.4.0-pre.
|
|
448
|
-
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.
|
|
447
|
+
if (bindingPackageVersion !== '0.4.0-pre.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
448
|
+
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
449
449
|
}
|
|
450
450
|
return binding
|
|
451
451
|
} catch (e) {
|
|
@@ -460,8 +460,8 @@ function requireNative() {
|
|
|
460
460
|
try {
|
|
461
461
|
const binding = require('@tursodatabase/sync-openharmony-arm')
|
|
462
462
|
const bindingPackageVersion = require('@tursodatabase/sync-openharmony-arm/package.json').version
|
|
463
|
-
if (bindingPackageVersion !== '0.4.0-pre.
|
|
464
|
-
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.
|
|
463
|
+
if (bindingPackageVersion !== '0.4.0-pre.18' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
464
|
+
throw new Error(`Native binding package version mismatch, expected 0.4.0-pre.18 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
465
465
|
}
|
|
466
466
|
return binding
|
|
467
467
|
} catch (e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tursodatabase/sync",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/tursodatabase/turso"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"napi-artifacts": "napi artifacts --output-dir .",
|
|
32
32
|
"tsc-build": "npm exec tsc",
|
|
33
33
|
"build": "npm run napi-build && npm run tsc-build",
|
|
34
|
-
"test": "VITE_TURSO_DB_URL=http://
|
|
34
|
+
"test": "VITE_TURSO_DB_URL=http://jj--a--a.localhost:8080 vitest --run",
|
|
35
35
|
"prepublishOnly": "npm run napi-dirs && npm run napi-artifacts && napi prepublish -t npm"
|
|
36
36
|
},
|
|
37
37
|
"napi": {
|
|
@@ -44,16 +44,16 @@
|
|
|
44
44
|
]
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@tursodatabase/database-common": "^0.4.
|
|
48
|
-
"@tursodatabase/sync-common": "^0.4.
|
|
47
|
+
"@tursodatabase/database-common": "^0.4.1",
|
|
48
|
+
"@tursodatabase/sync-common": "^0.4.1"
|
|
49
49
|
},
|
|
50
50
|
"imports": {
|
|
51
51
|
"#index": "./index.js"
|
|
52
52
|
},
|
|
53
53
|
"optionalDependencies": {
|
|
54
|
-
"@tursodatabase/sync-linux-x64-gnu": "0.4.
|
|
55
|
-
"@tursodatabase/sync-win32-x64-msvc": "0.4.
|
|
56
|
-
"@tursodatabase/sync-darwin-arm64": "0.4.
|
|
57
|
-
"@tursodatabase/sync-linux-arm64-gnu": "0.4.
|
|
54
|
+
"@tursodatabase/sync-linux-x64-gnu": "0.4.1",
|
|
55
|
+
"@tursodatabase/sync-win32-x64-msvc": "0.4.1",
|
|
56
|
+
"@tursodatabase/sync-darwin-arm64": "0.4.1",
|
|
57
|
+
"@tursodatabase/sync-linux-arm64-gnu": "0.4.1"
|
|
58
58
|
}
|
|
59
59
|
}
|