@tursodatabase/sync 0.3.0-pre.4 → 0.3.0-pre.6
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.test.js +152 -6
- package/index.js +46 -46
- package/package.json +7 -7
package/dist/promise.test.js
CHANGED
|
@@ -13,6 +13,67 @@ function cleanup(path) {
|
|
|
13
13
|
}
|
|
14
14
|
catch (e) { }
|
|
15
15
|
}
|
|
16
|
+
test('concurrent-actions-consistency', async () => {
|
|
17
|
+
{
|
|
18
|
+
const db = await connect({
|
|
19
|
+
path: ':memory:',
|
|
20
|
+
url: process.env.VITE_TURSO_DB_URL,
|
|
21
|
+
longPollTimeoutMs: 100,
|
|
22
|
+
});
|
|
23
|
+
await db.exec("CREATE TABLE IF NOT EXISTS rows(key TEXT PRIMARY KEY, value INTEGER)");
|
|
24
|
+
await db.exec("DELETE FROM rows");
|
|
25
|
+
await db.exec("INSERT INTO rows VALUES ('key', 0)");
|
|
26
|
+
await db.push();
|
|
27
|
+
await db.close();
|
|
28
|
+
}
|
|
29
|
+
const db1 = await connect({ path: ':memory:', url: process.env.VITE_TURSO_DB_URL });
|
|
30
|
+
console.info('run_info', await db1.prepare("SELECT * FROM sqlite_master").all());
|
|
31
|
+
await db1.exec("PRAGMA busy_timeout=100");
|
|
32
|
+
const pull = async function (iterations) {
|
|
33
|
+
for (let i = 0; i < iterations; i++) {
|
|
34
|
+
console.info('pull', i);
|
|
35
|
+
try {
|
|
36
|
+
await db1.pull();
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
39
|
+
console.error('pull', e);
|
|
40
|
+
}
|
|
41
|
+
await new Promise(resolve => setTimeout(resolve, 0));
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const push = async function (iterations) {
|
|
45
|
+
for (let i = 0; i < iterations; i++) {
|
|
46
|
+
await new Promise(resolve => setTimeout(resolve, (Math.random() + 1)));
|
|
47
|
+
console.info('push', i);
|
|
48
|
+
try {
|
|
49
|
+
if ((await db1.stats()).operations > 0) {
|
|
50
|
+
const start = performance.now();
|
|
51
|
+
await db1.push();
|
|
52
|
+
console.info('push', performance.now() - start);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
catch (e) {
|
|
56
|
+
console.error('push', e);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const run = async function (iterations) {
|
|
61
|
+
let rows = 0;
|
|
62
|
+
for (let i = 0; i < iterations; i++) {
|
|
63
|
+
// console.info('run', i, rows);
|
|
64
|
+
// console.info('run_info', 'update', 'start');
|
|
65
|
+
await db1.prepare("UPDATE rows SET value = value + 1 WHERE key = ?").run('key');
|
|
66
|
+
// console.info('run_info', 'update', 'end');
|
|
67
|
+
rows += 1;
|
|
68
|
+
// console.info('run_info', 'select', 'start');
|
|
69
|
+
const { cnt } = await db1.prepare("SELECT value as cnt FROM rows WHERE key = ?").get(['key']);
|
|
70
|
+
// console.info('run_info', 'select', 'end', cnt, '(', rows, ')');
|
|
71
|
+
expect(cnt).toBe(rows);
|
|
72
|
+
await new Promise(resolve => setTimeout(resolve, 10 * (Math.random() + 1)));
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
await Promise.all([pull(100), push(100), run(200)]);
|
|
76
|
+
});
|
|
16
77
|
test('simple-db', async () => {
|
|
17
78
|
const db = new Database({ path: ':memory:' });
|
|
18
79
|
expect(await db.prepare("SELECT 1 as x").all()).toEqual([{ x: 1 }]);
|
|
@@ -357,15 +418,20 @@ test('concurrent-updates', async () => {
|
|
|
357
418
|
await db.push();
|
|
358
419
|
await db.close();
|
|
359
420
|
}
|
|
360
|
-
const db1 = await connect({
|
|
421
|
+
const db1 = await connect({
|
|
422
|
+
path: ':memory:',
|
|
423
|
+
url: process.env.VITE_TURSO_DB_URL,
|
|
424
|
+
});
|
|
425
|
+
await db1.exec("PRAGMA busy_timeout=100");
|
|
361
426
|
async function pull(db) {
|
|
362
427
|
try {
|
|
363
428
|
await db.pull();
|
|
364
429
|
}
|
|
365
430
|
catch (e) {
|
|
366
|
-
|
|
431
|
+
console.error('pull error', e);
|
|
367
432
|
}
|
|
368
433
|
finally {
|
|
434
|
+
console.error('pull ok');
|
|
369
435
|
setTimeout(async () => await pull(db), 0);
|
|
370
436
|
}
|
|
371
437
|
}
|
|
@@ -374,9 +440,10 @@ test('concurrent-updates', async () => {
|
|
|
374
440
|
await db.push();
|
|
375
441
|
}
|
|
376
442
|
catch (e) {
|
|
377
|
-
|
|
443
|
+
console.error('push error', e);
|
|
378
444
|
}
|
|
379
445
|
finally {
|
|
446
|
+
console.error('push ok');
|
|
380
447
|
setTimeout(async () => await push(db), 0);
|
|
381
448
|
}
|
|
382
449
|
}
|
|
@@ -385,16 +452,40 @@ test('concurrent-updates', async () => {
|
|
|
385
452
|
for (let i = 0; i < 1000; i++) {
|
|
386
453
|
try {
|
|
387
454
|
await Promise.all([
|
|
388
|
-
db1.exec(`INSERT INTO q VALUES ('1', 0) ON CONFLICT DO UPDATE SET y =
|
|
389
|
-
db1.exec(`INSERT INTO q VALUES ('
|
|
455
|
+
db1.exec(`INSERT INTO q VALUES ('1', 0) ON CONFLICT DO UPDATE SET y = randomblob(1024)`),
|
|
456
|
+
db1.exec(`INSERT INTO q VALUES ('1', 0) ON CONFLICT DO UPDATE SET y = randomblob(1024)`)
|
|
390
457
|
]);
|
|
458
|
+
console.info('insert ok');
|
|
391
459
|
}
|
|
392
460
|
catch (e) {
|
|
393
|
-
|
|
461
|
+
console.error('insert error', e);
|
|
394
462
|
}
|
|
395
463
|
await new Promise(resolve => setTimeout(resolve, 1));
|
|
396
464
|
}
|
|
397
465
|
});
|
|
466
|
+
test('corruption-bug-1', async () => {
|
|
467
|
+
{
|
|
468
|
+
const db = await connect({ path: ':memory:', url: process.env.VITE_TURSO_DB_URL, longPollTimeoutMs: 5000 });
|
|
469
|
+
await db.exec("CREATE TABLE IF NOT EXISTS q(x TEXT PRIMARY KEY, y)");
|
|
470
|
+
await db.exec("DELETE FROM q");
|
|
471
|
+
await db.push();
|
|
472
|
+
await db.close();
|
|
473
|
+
}
|
|
474
|
+
const db1 = await connect({
|
|
475
|
+
path: ':memory:',
|
|
476
|
+
url: process.env.VITE_TURSO_DB_URL,
|
|
477
|
+
});
|
|
478
|
+
for (let i = 0; i < 100; i++) {
|
|
479
|
+
await db1.exec(`INSERT INTO q VALUES ('1', 0) ON CONFLICT DO UPDATE SET y = randomblob(1024)`);
|
|
480
|
+
}
|
|
481
|
+
await db1.pull();
|
|
482
|
+
await db1.push();
|
|
483
|
+
for (let i = 0; i < 100; i++) {
|
|
484
|
+
await db1.exec(`INSERT INTO q VALUES ('1', 0) ON CONFLICT DO UPDATE SET y = randomblob(1024)`);
|
|
485
|
+
}
|
|
486
|
+
await db1.pull();
|
|
487
|
+
await db1.push();
|
|
488
|
+
});
|
|
398
489
|
test('pull-push-concurrent', async () => {
|
|
399
490
|
{
|
|
400
491
|
const db = await connect({ path: ':memory:', url: process.env.VITE_TURSO_DB_URL, longPollTimeoutMs: 5000 });
|
|
@@ -456,6 +547,61 @@ test('pull-push-concurrent', async () => {
|
|
|
456
547
|
await pullFinish;
|
|
457
548
|
console.info(await db.stats());
|
|
458
549
|
});
|
|
550
|
+
test('checkpoint-and-actions', async () => {
|
|
551
|
+
{
|
|
552
|
+
const db = await connect({
|
|
553
|
+
path: ':memory:',
|
|
554
|
+
url: process.env.VITE_TURSO_DB_URL,
|
|
555
|
+
longPollTimeoutMs: 100,
|
|
556
|
+
});
|
|
557
|
+
await db.exec("CREATE TABLE IF NOT EXISTS rows(key TEXT PRIMARY KEY, value INTEGER)");
|
|
558
|
+
await db.exec("DELETE FROM rows");
|
|
559
|
+
await db.exec("INSERT INTO rows VALUES ('key', 0)");
|
|
560
|
+
await db.push();
|
|
561
|
+
await db.close();
|
|
562
|
+
}
|
|
563
|
+
const db1 = await connect({ path: ':memory:', url: process.env.VITE_TURSO_DB_URL });
|
|
564
|
+
await db1.exec("PRAGMA busy_timeout=100");
|
|
565
|
+
const pull = async function (iterations) {
|
|
566
|
+
for (let i = 0; i < iterations; i++) {
|
|
567
|
+
try {
|
|
568
|
+
await db1.pull();
|
|
569
|
+
}
|
|
570
|
+
catch (e) {
|
|
571
|
+
console.error('pull', e);
|
|
572
|
+
}
|
|
573
|
+
await new Promise(resolve => setTimeout(resolve, 0));
|
|
574
|
+
}
|
|
575
|
+
};
|
|
576
|
+
const push = async function (iterations) {
|
|
577
|
+
for (let i = 0; i < iterations; i++) {
|
|
578
|
+
await new Promise(resolve => setTimeout(resolve, 5));
|
|
579
|
+
try {
|
|
580
|
+
if ((await db1.stats()).operations > 0) {
|
|
581
|
+
const start = performance.now();
|
|
582
|
+
await db1.push();
|
|
583
|
+
console.info('push', performance.now() - start);
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
catch (e) {
|
|
587
|
+
console.error('push', e);
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
};
|
|
591
|
+
let rows = 0;
|
|
592
|
+
const run = async function (iterations) {
|
|
593
|
+
for (let i = 0; i < iterations; i++) {
|
|
594
|
+
await db1.prepare("UPDATE rows SET value = value + 1 WHERE key = ?").run('key');
|
|
595
|
+
rows += 1;
|
|
596
|
+
const { cnt } = await db1.prepare("SELECT value as cnt FROM rows WHERE key = ?").get(['key']);
|
|
597
|
+
console.info('CHECK', cnt, rows);
|
|
598
|
+
expect(cnt).toBe(rows);
|
|
599
|
+
await new Promise(resolve => setTimeout(resolve, 10 * (1 + Math.random())));
|
|
600
|
+
}
|
|
601
|
+
};
|
|
602
|
+
// await run(100);
|
|
603
|
+
await Promise.all([pull(40), push(40), run(100)]);
|
|
604
|
+
});
|
|
459
605
|
test('transform', async () => {
|
|
460
606
|
{
|
|
461
607
|
const db = await connect({
|
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.
|
|
85
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
84
|
+
if (bindingPackageVersion !== '0.3.0-pre.4' && 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.3.0-pre.4 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.
|
|
101
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
100
|
+
if (bindingPackageVersion !== '0.3.0-pre.4' && 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.3.0-pre.4 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.
|
|
121
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
120
|
+
if (bindingPackageVersion !== '0.3.0-pre.4' && 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.3.0-pre.4 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.
|
|
137
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
136
|
+
if (bindingPackageVersion !== '0.3.0-pre.4' && 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.3.0-pre.4 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.
|
|
153
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
152
|
+
if (bindingPackageVersion !== '0.3.0-pre.4' && 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.3.0-pre.4 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.
|
|
172
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
171
|
+
if (bindingPackageVersion !== '0.3.0-pre.4' && 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.3.0-pre.4 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.
|
|
188
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
187
|
+
if (bindingPackageVersion !== '0.3.0-pre.4' && 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.3.0-pre.4 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.
|
|
204
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
203
|
+
if (bindingPackageVersion !== '0.3.0-pre.4' && 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.3.0-pre.4 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.
|
|
224
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
223
|
+
if (bindingPackageVersion !== '0.3.0-pre.4' && 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.3.0-pre.4 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.
|
|
240
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
239
|
+
if (bindingPackageVersion !== '0.3.0-pre.4' && 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.3.0-pre.4 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.
|
|
261
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
260
|
+
if (bindingPackageVersion !== '0.3.0-pre.4' && 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.3.0-pre.4 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.
|
|
277
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
276
|
+
if (bindingPackageVersion !== '0.3.0-pre.4' && 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.3.0-pre.4 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.
|
|
295
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
294
|
+
if (bindingPackageVersion !== '0.3.0-pre.4' && 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.3.0-pre.4 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.
|
|
311
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
310
|
+
if (bindingPackageVersion !== '0.3.0-pre.4' && 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.3.0-pre.4 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.
|
|
329
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
328
|
+
if (bindingPackageVersion !== '0.3.0-pre.4' && 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.3.0-pre.4 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.
|
|
345
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
344
|
+
if (bindingPackageVersion !== '0.3.0-pre.4' && 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.3.0-pre.4 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.
|
|
363
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
362
|
+
if (bindingPackageVersion !== '0.3.0-pre.4' && 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.3.0-pre.4 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.
|
|
379
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
378
|
+
if (bindingPackageVersion !== '0.3.0-pre.4' && 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.3.0-pre.4 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.
|
|
396
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
395
|
+
if (bindingPackageVersion !== '0.3.0-pre.4' && 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.3.0-pre.4 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.
|
|
412
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
411
|
+
if (bindingPackageVersion !== '0.3.0-pre.4' && 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.3.0-pre.4 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.
|
|
432
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
431
|
+
if (bindingPackageVersion !== '0.3.0-pre.4' && 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.3.0-pre.4 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.
|
|
448
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
447
|
+
if (bindingPackageVersion !== '0.3.0-pre.4' && 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.3.0-pre.4 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.
|
|
464
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
463
|
+
if (bindingPackageVersion !== '0.3.0-pre.4' && 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.3.0-pre.4 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.3.0-pre.
|
|
3
|
+
"version": "0.3.0-pre.6",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/tursodatabase/turso"
|
|
@@ -44,16 +44,16 @@
|
|
|
44
44
|
]
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@tursodatabase/database-common": "^0.3.0-pre.
|
|
48
|
-
"@tursodatabase/sync-common": "^0.3.0-pre.
|
|
47
|
+
"@tursodatabase/database-common": "^0.3.0-pre.6",
|
|
48
|
+
"@tursodatabase/sync-common": "^0.3.0-pre.6"
|
|
49
49
|
},
|
|
50
50
|
"imports": {
|
|
51
51
|
"#index": "./index.js"
|
|
52
52
|
},
|
|
53
53
|
"optionalDependencies": {
|
|
54
|
-
"@tursodatabase/sync-linux-x64-gnu": "0.3.0-pre.
|
|
55
|
-
"@tursodatabase/sync-win32-x64-msvc": "0.3.0-pre.
|
|
56
|
-
"@tursodatabase/sync-darwin-arm64": "0.3.0-pre.
|
|
57
|
-
"@tursodatabase/sync-linux-arm64-gnu": "0.3.0-pre.
|
|
54
|
+
"@tursodatabase/sync-linux-x64-gnu": "0.3.0-pre.6",
|
|
55
|
+
"@tursodatabase/sync-win32-x64-msvc": "0.3.0-pre.6",
|
|
56
|
+
"@tursodatabase/sync-darwin-arm64": "0.3.0-pre.6",
|
|
57
|
+
"@tursodatabase/sync-linux-arm64-gnu": "0.3.0-pre.6"
|
|
58
58
|
}
|
|
59
59
|
}
|