@tursodatabase/database 0.1.5-pre.3 → 0.1.5
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/README.md +14 -18
- package/dist/compat.d.ts +6 -0
- package/dist/compat.d.ts.map +1 -0
- package/dist/compat.js +4 -363
- package/dist/compat.test.d.ts +2 -0
- package/dist/compat.test.d.ts.map +1 -0
- package/dist/compat.test.js +62 -0
- package/dist/promise.d.ts +14 -0
- package/dist/promise.d.ts.map +1 -0
- package/dist/promise.js +5 -370
- package/dist/promise.test.d.ts +2 -0
- package/dist/promise.test.d.ts.map +1 -0
- package/dist/promise.test.js +95 -0
- package/index.js +141 -26
- package/package.json +28 -41
- package/browser.js +0 -1
- package/dist/bind.js +0 -68
- package/dist/sqlite-error.js +0 -12
- package/index.d.ts +0 -130
package/index.js
CHANGED
|
@@ -79,7 +79,12 @@ function requireNative() {
|
|
|
79
79
|
loadErrors.push(e)
|
|
80
80
|
}
|
|
81
81
|
try {
|
|
82
|
-
|
|
82
|
+
const binding = require('@tursodatabase/database-android-arm64')
|
|
83
|
+
const bindingPackageVersion = require('@tursodatabase/database-android-arm64/package.json').version
|
|
84
|
+
if (bindingPackageVersion !== '0.1.5-pre.3' && 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.1.5-pre.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
86
|
+
}
|
|
87
|
+
return binding
|
|
83
88
|
} catch (e) {
|
|
84
89
|
loadErrors.push(e)
|
|
85
90
|
}
|
|
@@ -90,7 +95,12 @@ function requireNative() {
|
|
|
90
95
|
loadErrors.push(e)
|
|
91
96
|
}
|
|
92
97
|
try {
|
|
93
|
-
|
|
98
|
+
const binding = require('@tursodatabase/database-android-arm-eabi')
|
|
99
|
+
const bindingPackageVersion = require('@tursodatabase/database-android-arm-eabi/package.json').version
|
|
100
|
+
if (bindingPackageVersion !== '0.1.5-pre.3' && 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.1.5-pre.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
102
|
+
}
|
|
103
|
+
return binding
|
|
94
104
|
} catch (e) {
|
|
95
105
|
loadErrors.push(e)
|
|
96
106
|
}
|
|
@@ -105,7 +115,12 @@ function requireNative() {
|
|
|
105
115
|
loadErrors.push(e)
|
|
106
116
|
}
|
|
107
117
|
try {
|
|
108
|
-
|
|
118
|
+
const binding = require('@tursodatabase/database-win32-x64-msvc')
|
|
119
|
+
const bindingPackageVersion = require('@tursodatabase/database-win32-x64-msvc/package.json').version
|
|
120
|
+
if (bindingPackageVersion !== '0.1.5-pre.3' && 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.1.5-pre.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
122
|
+
}
|
|
123
|
+
return binding
|
|
109
124
|
} catch (e) {
|
|
110
125
|
loadErrors.push(e)
|
|
111
126
|
}
|
|
@@ -116,7 +131,12 @@ function requireNative() {
|
|
|
116
131
|
loadErrors.push(e)
|
|
117
132
|
}
|
|
118
133
|
try {
|
|
119
|
-
|
|
134
|
+
const binding = require('@tursodatabase/database-win32-ia32-msvc')
|
|
135
|
+
const bindingPackageVersion = require('@tursodatabase/database-win32-ia32-msvc/package.json').version
|
|
136
|
+
if (bindingPackageVersion !== '0.1.5-pre.3' && 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.1.5-pre.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
138
|
+
}
|
|
139
|
+
return binding
|
|
120
140
|
} catch (e) {
|
|
121
141
|
loadErrors.push(e)
|
|
122
142
|
}
|
|
@@ -127,7 +147,12 @@ function requireNative() {
|
|
|
127
147
|
loadErrors.push(e)
|
|
128
148
|
}
|
|
129
149
|
try {
|
|
130
|
-
|
|
150
|
+
const binding = require('@tursodatabase/database-win32-arm64-msvc')
|
|
151
|
+
const bindingPackageVersion = require('@tursodatabase/database-win32-arm64-msvc/package.json').version
|
|
152
|
+
if (bindingPackageVersion !== '0.1.5-pre.3' && 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.1.5-pre.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
154
|
+
}
|
|
155
|
+
return binding
|
|
131
156
|
} catch (e) {
|
|
132
157
|
loadErrors.push(e)
|
|
133
158
|
}
|
|
@@ -141,7 +166,12 @@ function requireNative() {
|
|
|
141
166
|
loadErrors.push(e)
|
|
142
167
|
}
|
|
143
168
|
try {
|
|
144
|
-
|
|
169
|
+
const binding = require('@tursodatabase/database-darwin-universal')
|
|
170
|
+
const bindingPackageVersion = require('@tursodatabase/database-darwin-universal/package.json').version
|
|
171
|
+
if (bindingPackageVersion !== '0.1.5-pre.3' && 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.1.5-pre.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
173
|
+
}
|
|
174
|
+
return binding
|
|
145
175
|
} catch (e) {
|
|
146
176
|
loadErrors.push(e)
|
|
147
177
|
}
|
|
@@ -152,7 +182,12 @@ function requireNative() {
|
|
|
152
182
|
loadErrors.push(e)
|
|
153
183
|
}
|
|
154
184
|
try {
|
|
155
|
-
|
|
185
|
+
const binding = require('@tursodatabase/database-darwin-x64')
|
|
186
|
+
const bindingPackageVersion = require('@tursodatabase/database-darwin-x64/package.json').version
|
|
187
|
+
if (bindingPackageVersion !== '0.1.5-pre.3' && 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.1.5-pre.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
189
|
+
}
|
|
190
|
+
return binding
|
|
156
191
|
} catch (e) {
|
|
157
192
|
loadErrors.push(e)
|
|
158
193
|
}
|
|
@@ -163,7 +198,12 @@ function requireNative() {
|
|
|
163
198
|
loadErrors.push(e)
|
|
164
199
|
}
|
|
165
200
|
try {
|
|
166
|
-
|
|
201
|
+
const binding = require('@tursodatabase/database-darwin-arm64')
|
|
202
|
+
const bindingPackageVersion = require('@tursodatabase/database-darwin-arm64/package.json').version
|
|
203
|
+
if (bindingPackageVersion !== '0.1.5-pre.3' && 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.1.5-pre.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
205
|
+
}
|
|
206
|
+
return binding
|
|
167
207
|
} catch (e) {
|
|
168
208
|
loadErrors.push(e)
|
|
169
209
|
}
|
|
@@ -178,7 +218,12 @@ function requireNative() {
|
|
|
178
218
|
loadErrors.push(e)
|
|
179
219
|
}
|
|
180
220
|
try {
|
|
181
|
-
|
|
221
|
+
const binding = require('@tursodatabase/database-freebsd-x64')
|
|
222
|
+
const bindingPackageVersion = require('@tursodatabase/database-freebsd-x64/package.json').version
|
|
223
|
+
if (bindingPackageVersion !== '0.1.5-pre.3' && 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.1.5-pre.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
225
|
+
}
|
|
226
|
+
return binding
|
|
182
227
|
} catch (e) {
|
|
183
228
|
loadErrors.push(e)
|
|
184
229
|
}
|
|
@@ -189,7 +234,12 @@ function requireNative() {
|
|
|
189
234
|
loadErrors.push(e)
|
|
190
235
|
}
|
|
191
236
|
try {
|
|
192
|
-
|
|
237
|
+
const binding = require('@tursodatabase/database-freebsd-arm64')
|
|
238
|
+
const bindingPackageVersion = require('@tursodatabase/database-freebsd-arm64/package.json').version
|
|
239
|
+
if (bindingPackageVersion !== '0.1.5-pre.3' && 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.1.5-pre.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
241
|
+
}
|
|
242
|
+
return binding
|
|
193
243
|
} catch (e) {
|
|
194
244
|
loadErrors.push(e)
|
|
195
245
|
}
|
|
@@ -205,7 +255,12 @@ function requireNative() {
|
|
|
205
255
|
loadErrors.push(e)
|
|
206
256
|
}
|
|
207
257
|
try {
|
|
208
|
-
|
|
258
|
+
const binding = require('@tursodatabase/database-linux-x64-musl')
|
|
259
|
+
const bindingPackageVersion = require('@tursodatabase/database-linux-x64-musl/package.json').version
|
|
260
|
+
if (bindingPackageVersion !== '0.1.5-pre.3' && 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.1.5-pre.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
262
|
+
}
|
|
263
|
+
return binding
|
|
209
264
|
} catch (e) {
|
|
210
265
|
loadErrors.push(e)
|
|
211
266
|
}
|
|
@@ -216,7 +271,12 @@ function requireNative() {
|
|
|
216
271
|
loadErrors.push(e)
|
|
217
272
|
}
|
|
218
273
|
try {
|
|
219
|
-
|
|
274
|
+
const binding = require('@tursodatabase/database-linux-x64-gnu')
|
|
275
|
+
const bindingPackageVersion = require('@tursodatabase/database-linux-x64-gnu/package.json').version
|
|
276
|
+
if (bindingPackageVersion !== '0.1.5-pre.3' && 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.1.5-pre.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
278
|
+
}
|
|
279
|
+
return binding
|
|
220
280
|
} catch (e) {
|
|
221
281
|
loadErrors.push(e)
|
|
222
282
|
}
|
|
@@ -229,7 +289,12 @@ function requireNative() {
|
|
|
229
289
|
loadErrors.push(e)
|
|
230
290
|
}
|
|
231
291
|
try {
|
|
232
|
-
|
|
292
|
+
const binding = require('@tursodatabase/database-linux-arm64-musl')
|
|
293
|
+
const bindingPackageVersion = require('@tursodatabase/database-linux-arm64-musl/package.json').version
|
|
294
|
+
if (bindingPackageVersion !== '0.1.5-pre.3' && 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.1.5-pre.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
296
|
+
}
|
|
297
|
+
return binding
|
|
233
298
|
} catch (e) {
|
|
234
299
|
loadErrors.push(e)
|
|
235
300
|
}
|
|
@@ -240,7 +305,12 @@ function requireNative() {
|
|
|
240
305
|
loadErrors.push(e)
|
|
241
306
|
}
|
|
242
307
|
try {
|
|
243
|
-
|
|
308
|
+
const binding = require('@tursodatabase/database-linux-arm64-gnu')
|
|
309
|
+
const bindingPackageVersion = require('@tursodatabase/database-linux-arm64-gnu/package.json').version
|
|
310
|
+
if (bindingPackageVersion !== '0.1.5-pre.3' && 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.1.5-pre.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
312
|
+
}
|
|
313
|
+
return binding
|
|
244
314
|
} catch (e) {
|
|
245
315
|
loadErrors.push(e)
|
|
246
316
|
}
|
|
@@ -253,7 +323,12 @@ function requireNative() {
|
|
|
253
323
|
loadErrors.push(e)
|
|
254
324
|
}
|
|
255
325
|
try {
|
|
256
|
-
|
|
326
|
+
const binding = require('@tursodatabase/database-linux-arm-musleabihf')
|
|
327
|
+
const bindingPackageVersion = require('@tursodatabase/database-linux-arm-musleabihf/package.json').version
|
|
328
|
+
if (bindingPackageVersion !== '0.1.5-pre.3' && 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.1.5-pre.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
330
|
+
}
|
|
331
|
+
return binding
|
|
257
332
|
} catch (e) {
|
|
258
333
|
loadErrors.push(e)
|
|
259
334
|
}
|
|
@@ -264,7 +339,12 @@ function requireNative() {
|
|
|
264
339
|
loadErrors.push(e)
|
|
265
340
|
}
|
|
266
341
|
try {
|
|
267
|
-
|
|
342
|
+
const binding = require('@tursodatabase/database-linux-arm-gnueabihf')
|
|
343
|
+
const bindingPackageVersion = require('@tursodatabase/database-linux-arm-gnueabihf/package.json').version
|
|
344
|
+
if (bindingPackageVersion !== '0.1.5-pre.3' && 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.1.5-pre.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
346
|
+
}
|
|
347
|
+
return binding
|
|
268
348
|
} catch (e) {
|
|
269
349
|
loadErrors.push(e)
|
|
270
350
|
}
|
|
@@ -277,7 +357,12 @@ function requireNative() {
|
|
|
277
357
|
loadErrors.push(e)
|
|
278
358
|
}
|
|
279
359
|
try {
|
|
280
|
-
|
|
360
|
+
const binding = require('@tursodatabase/database-linux-riscv64-musl')
|
|
361
|
+
const bindingPackageVersion = require('@tursodatabase/database-linux-riscv64-musl/package.json').version
|
|
362
|
+
if (bindingPackageVersion !== '0.1.5-pre.3' && 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.1.5-pre.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
364
|
+
}
|
|
365
|
+
return binding
|
|
281
366
|
} catch (e) {
|
|
282
367
|
loadErrors.push(e)
|
|
283
368
|
}
|
|
@@ -288,7 +373,12 @@ function requireNative() {
|
|
|
288
373
|
loadErrors.push(e)
|
|
289
374
|
}
|
|
290
375
|
try {
|
|
291
|
-
|
|
376
|
+
const binding = require('@tursodatabase/database-linux-riscv64-gnu')
|
|
377
|
+
const bindingPackageVersion = require('@tursodatabase/database-linux-riscv64-gnu/package.json').version
|
|
378
|
+
if (bindingPackageVersion !== '0.1.5-pre.3' && 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.1.5-pre.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
380
|
+
}
|
|
381
|
+
return binding
|
|
292
382
|
} catch (e) {
|
|
293
383
|
loadErrors.push(e)
|
|
294
384
|
}
|
|
@@ -300,7 +390,12 @@ function requireNative() {
|
|
|
300
390
|
loadErrors.push(e)
|
|
301
391
|
}
|
|
302
392
|
try {
|
|
303
|
-
|
|
393
|
+
const binding = require('@tursodatabase/database-linux-ppc64-gnu')
|
|
394
|
+
const bindingPackageVersion = require('@tursodatabase/database-linux-ppc64-gnu/package.json').version
|
|
395
|
+
if (bindingPackageVersion !== '0.1.5-pre.3' && 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.1.5-pre.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
397
|
+
}
|
|
398
|
+
return binding
|
|
304
399
|
} catch (e) {
|
|
305
400
|
loadErrors.push(e)
|
|
306
401
|
}
|
|
@@ -311,7 +406,12 @@ function requireNative() {
|
|
|
311
406
|
loadErrors.push(e)
|
|
312
407
|
}
|
|
313
408
|
try {
|
|
314
|
-
|
|
409
|
+
const binding = require('@tursodatabase/database-linux-s390x-gnu')
|
|
410
|
+
const bindingPackageVersion = require('@tursodatabase/database-linux-s390x-gnu/package.json').version
|
|
411
|
+
if (bindingPackageVersion !== '0.1.5-pre.3' && 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.1.5-pre.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
413
|
+
}
|
|
414
|
+
return binding
|
|
315
415
|
} catch (e) {
|
|
316
416
|
loadErrors.push(e)
|
|
317
417
|
}
|
|
@@ -321,34 +421,49 @@ function requireNative() {
|
|
|
321
421
|
} else if (process.platform === 'openharmony') {
|
|
322
422
|
if (process.arch === 'arm64') {
|
|
323
423
|
try {
|
|
324
|
-
return require('./turso.
|
|
424
|
+
return require('./turso.openharmony-arm64.node')
|
|
325
425
|
} catch (e) {
|
|
326
426
|
loadErrors.push(e)
|
|
327
427
|
}
|
|
328
428
|
try {
|
|
329
|
-
|
|
429
|
+
const binding = require('@tursodatabase/database-openharmony-arm64')
|
|
430
|
+
const bindingPackageVersion = require('@tursodatabase/database-openharmony-arm64/package.json').version
|
|
431
|
+
if (bindingPackageVersion !== '0.1.5-pre.3' && 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.1.5-pre.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
433
|
+
}
|
|
434
|
+
return binding
|
|
330
435
|
} catch (e) {
|
|
331
436
|
loadErrors.push(e)
|
|
332
437
|
}
|
|
333
438
|
} else if (process.arch === 'x64') {
|
|
334
439
|
try {
|
|
335
|
-
return require('./turso.
|
|
440
|
+
return require('./turso.openharmony-x64.node')
|
|
336
441
|
} catch (e) {
|
|
337
442
|
loadErrors.push(e)
|
|
338
443
|
}
|
|
339
444
|
try {
|
|
340
|
-
|
|
445
|
+
const binding = require('@tursodatabase/database-openharmony-x64')
|
|
446
|
+
const bindingPackageVersion = require('@tursodatabase/database-openharmony-x64/package.json').version
|
|
447
|
+
if (bindingPackageVersion !== '0.1.5-pre.3' && 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.1.5-pre.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
449
|
+
}
|
|
450
|
+
return binding
|
|
341
451
|
} catch (e) {
|
|
342
452
|
loadErrors.push(e)
|
|
343
453
|
}
|
|
344
454
|
} else if (process.arch === 'arm') {
|
|
345
455
|
try {
|
|
346
|
-
return require('./turso.
|
|
456
|
+
return require('./turso.openharmony-arm.node')
|
|
347
457
|
} catch (e) {
|
|
348
458
|
loadErrors.push(e)
|
|
349
459
|
}
|
|
350
460
|
try {
|
|
351
|
-
|
|
461
|
+
const binding = require('@tursodatabase/database-openharmony-arm')
|
|
462
|
+
const bindingPackageVersion = require('@tursodatabase/database-openharmony-arm/package.json').version
|
|
463
|
+
if (bindingPackageVersion !== '0.1.5-pre.3' && 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.1.5-pre.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
465
|
+
}
|
|
466
|
+
return binding
|
|
352
467
|
} catch (e) {
|
|
353
468
|
loadErrors.push(e)
|
|
354
469
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tursodatabase/database",
|
|
3
|
-
"version": "0.1.5
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/tursodatabase/turso"
|
|
7
7
|
},
|
|
8
|
-
"
|
|
8
|
+
"license": "MIT",
|
|
9
9
|
"module": "./dist/promise.js",
|
|
10
10
|
"main": "./dist/promise.js",
|
|
11
11
|
"type": "module",
|
|
@@ -14,58 +14,45 @@
|
|
|
14
14
|
"./compat": "./dist/compat.js"
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
|
-
"browser.js",
|
|
18
17
|
"index.js",
|
|
19
|
-
"
|
|
20
|
-
"
|
|
18
|
+
"dist/**",
|
|
19
|
+
"README.md"
|
|
21
20
|
],
|
|
22
|
-
"
|
|
21
|
+
"packageManager": "yarn@4.9.2",
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@napi-rs/cli": "^3.1.5",
|
|
24
|
+
"@types/node": "^24.3.1",
|
|
25
|
+
"typescript": "^5.9.2",
|
|
26
|
+
"vitest": "^3.2.4"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"napi-build": "napi build --platform --release --esm --manifest-path ../../Cargo.toml --output-dir .",
|
|
30
|
+
"napi-dirs": "napi create-npm-dirs",
|
|
31
|
+
"napi-artifacts": "napi artifacts --output-dir .",
|
|
32
|
+
"tsc-build": "npm exec tsc",
|
|
33
|
+
"build": "npm run napi-build && npm run tsc-build",
|
|
34
|
+
"test": "vitest --run",
|
|
35
|
+
"prepublishOnly": "npm run napi-dirs && npm run napi-artifacts && napi prepublish -t npm"
|
|
36
|
+
},
|
|
23
37
|
"napi": {
|
|
24
38
|
"binaryName": "turso",
|
|
25
39
|
"targets": [
|
|
26
40
|
"x86_64-unknown-linux-gnu",
|
|
27
41
|
"x86_64-pc-windows-msvc",
|
|
28
42
|
"universal-apple-darwin",
|
|
29
|
-
"aarch64-unknown-linux-gnu"
|
|
30
|
-
"wasm32-wasip1-threads"
|
|
43
|
+
"aarch64-unknown-linux-gnu"
|
|
31
44
|
]
|
|
32
45
|
},
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
"@napi-rs/cli": "^3.0.4",
|
|
36
|
-
"@napi-rs/wasm-runtime": "^1.0.1",
|
|
37
|
-
"ava": "^6.0.1",
|
|
38
|
-
"better-sqlite3": "^11.9.1",
|
|
39
|
-
"typescript": "^5.9.2"
|
|
40
|
-
},
|
|
41
|
-
"ava": {
|
|
42
|
-
"timeout": "3m"
|
|
43
|
-
},
|
|
44
|
-
"engines": {
|
|
45
|
-
"node": ">= 10"
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@tursodatabase/database-common": "^0.1.5"
|
|
46
48
|
},
|
|
47
|
-
"scripts": {
|
|
48
|
-
"artifacts": "napi artifacts",
|
|
49
|
-
"build": "npm exec tsc && napi build --platform --release --esm",
|
|
50
|
-
"build:debug": "npm exec tsc && napi build --platform",
|
|
51
|
-
"prepublishOnly": "npm exec tsc && napi prepublish -t npm",
|
|
52
|
-
"test": "true",
|
|
53
|
-
"universal": "napi universalize",
|
|
54
|
-
"version": "napi version"
|
|
55
|
-
},
|
|
56
|
-
"packageManager": "yarn@4.9.2",
|
|
57
49
|
"imports": {
|
|
58
|
-
"#
|
|
59
|
-
"types": "./index.d.ts",
|
|
60
|
-
"browser": "./browser.js",
|
|
61
|
-
"node": "./index.js"
|
|
62
|
-
}
|
|
50
|
+
"#index": "./index.js"
|
|
63
51
|
},
|
|
64
52
|
"optionalDependencies": {
|
|
65
|
-
"@tursodatabase/database-linux-x64-gnu": "0.1.5
|
|
66
|
-
"@tursodatabase/database-win32-x64-msvc": "0.1.5
|
|
67
|
-
"@tursodatabase/database-darwin-universal": "0.1.5
|
|
68
|
-
"@tursodatabase/database-linux-arm64-gnu": "0.1.5
|
|
69
|
-
"@tursodatabase/database-wasm32-wasi": "0.1.5-pre.3"
|
|
53
|
+
"@tursodatabase/database-linux-x64-gnu": "0.1.5",
|
|
54
|
+
"@tursodatabase/database-win32-x64-msvc": "0.1.5",
|
|
55
|
+
"@tursodatabase/database-darwin-universal": "0.1.5",
|
|
56
|
+
"@tursodatabase/database-linux-arm64-gnu": "0.1.5"
|
|
70
57
|
}
|
|
71
58
|
}
|
package/browser.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@tursodatabase/database-wasm32-wasi'
|
package/dist/bind.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
// Bind parameters to a statement.
|
|
2
|
-
//
|
|
3
|
-
// This function is used to bind parameters to a statement. It supports both
|
|
4
|
-
// named and positional parameters, and nested arrays.
|
|
5
|
-
//
|
|
6
|
-
// The `stmt` parameter is a statement object.
|
|
7
|
-
// The `params` parameter is an array of parameters.
|
|
8
|
-
//
|
|
9
|
-
// The function returns void.
|
|
10
|
-
export function bindParams(stmt, params) {
|
|
11
|
-
const len = params?.length;
|
|
12
|
-
if (len === 0) {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
if (len === 1) {
|
|
16
|
-
const param = params[0];
|
|
17
|
-
if (isPlainObject(param)) {
|
|
18
|
-
bindNamedParams(stmt, param);
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
if (Array.isArray(param)) {
|
|
22
|
-
bindPositionalParams(stmt, [param]);
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
bindValue(stmt, 1, param);
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
bindPositionalParams(stmt, params);
|
|
29
|
-
}
|
|
30
|
-
// Check if object is plain (no prototype chain)
|
|
31
|
-
function isPlainObject(obj) {
|
|
32
|
-
if (!obj || typeof obj !== 'object')
|
|
33
|
-
return false;
|
|
34
|
-
const proto = Object.getPrototypeOf(obj);
|
|
35
|
-
return proto === Object.prototype || proto === null;
|
|
36
|
-
}
|
|
37
|
-
// Handle named parameters
|
|
38
|
-
function bindNamedParams(stmt, paramObj) {
|
|
39
|
-
const paramCount = stmt.parameterCount();
|
|
40
|
-
for (let i = 1; i <= paramCount; i++) {
|
|
41
|
-
const paramName = stmt.parameterName(i);
|
|
42
|
-
if (paramName) {
|
|
43
|
-
const key = paramName.substring(1); // Remove ':' or '$' prefix
|
|
44
|
-
const value = paramObj[key];
|
|
45
|
-
if (value !== undefined) {
|
|
46
|
-
bindValue(stmt, i, value);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
// Handle positional parameters (including nested arrays)
|
|
52
|
-
function bindPositionalParams(stmt, params) {
|
|
53
|
-
let bindIndex = 1;
|
|
54
|
-
for (let i = 0; i < params.length; i++) {
|
|
55
|
-
const param = params[i];
|
|
56
|
-
if (Array.isArray(param)) {
|
|
57
|
-
for (let j = 0; j < param.length; j++) {
|
|
58
|
-
bindValue(stmt, bindIndex++, param[j]);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
bindValue(stmt, bindIndex++, param);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
function bindValue(stmt, index, value) {
|
|
67
|
-
stmt.bindAt(index, value);
|
|
68
|
-
}
|
package/dist/sqlite-error.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export class SqliteError extends Error {
|
|
2
|
-
name;
|
|
3
|
-
code;
|
|
4
|
-
rawCode;
|
|
5
|
-
constructor(message, code, rawCode) {
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = 'SqliteError';
|
|
8
|
-
this.code = code;
|
|
9
|
-
this.rawCode = rawCode;
|
|
10
|
-
Error.captureStackTrace(this, SqliteError);
|
|
11
|
-
}
|
|
12
|
-
}
|
package/index.d.ts
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
/* auto-generated by NAPI-RS */
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
/** A database connection. */
|
|
4
|
-
export declare class Database {
|
|
5
|
-
/**
|
|
6
|
-
* Creates a new database instance.
|
|
7
|
-
*
|
|
8
|
-
* # Arguments
|
|
9
|
-
* * `path` - The path to the database file.
|
|
10
|
-
*/
|
|
11
|
-
constructor(path: string)
|
|
12
|
-
/** Returns whether the database is in memory-only mode. */
|
|
13
|
-
get memory(): boolean
|
|
14
|
-
/** Returns whether the database connection is open. */
|
|
15
|
-
get open(): boolean
|
|
16
|
-
/**
|
|
17
|
-
* Executes a batch of SQL statements.
|
|
18
|
-
*
|
|
19
|
-
* # Arguments
|
|
20
|
-
*
|
|
21
|
-
* * `sql` - The SQL statements to execute.
|
|
22
|
-
*
|
|
23
|
-
* # Returns
|
|
24
|
-
*/
|
|
25
|
-
batch(sql: string): void
|
|
26
|
-
/**
|
|
27
|
-
* Prepares a statement for execution.
|
|
28
|
-
*
|
|
29
|
-
* # Arguments
|
|
30
|
-
*
|
|
31
|
-
* * `sql` - The SQL statement to prepare.
|
|
32
|
-
*
|
|
33
|
-
* # Returns
|
|
34
|
-
*
|
|
35
|
-
* A `Statement` instance.
|
|
36
|
-
*/
|
|
37
|
-
prepare(sql: string): Statement
|
|
38
|
-
/**
|
|
39
|
-
* Returns the rowid of the last row inserted.
|
|
40
|
-
*
|
|
41
|
-
* # Returns
|
|
42
|
-
*
|
|
43
|
-
* The rowid of the last row inserted.
|
|
44
|
-
*/
|
|
45
|
-
lastInsertRowid(): number
|
|
46
|
-
/**
|
|
47
|
-
* Returns the number of changes made by the last statement.
|
|
48
|
-
*
|
|
49
|
-
* # Returns
|
|
50
|
-
*
|
|
51
|
-
* The number of changes made by the last statement.
|
|
52
|
-
*/
|
|
53
|
-
changes(): number
|
|
54
|
-
/**
|
|
55
|
-
* Returns the total number of changes made by all statements.
|
|
56
|
-
*
|
|
57
|
-
* # Returns
|
|
58
|
-
*
|
|
59
|
-
* The total number of changes made by all statements.
|
|
60
|
-
*/
|
|
61
|
-
totalChanges(): number
|
|
62
|
-
/**
|
|
63
|
-
* Closes the database connection.
|
|
64
|
-
*
|
|
65
|
-
* # Returns
|
|
66
|
-
*
|
|
67
|
-
* `Ok(())` if the database is closed successfully.
|
|
68
|
-
*/
|
|
69
|
-
close(): void
|
|
70
|
-
/**
|
|
71
|
-
* Sets the default safe integers mode for all statements from this database.
|
|
72
|
-
*
|
|
73
|
-
* # Arguments
|
|
74
|
-
*
|
|
75
|
-
* * `toggle` - Whether to use safe integers by default.
|
|
76
|
-
*/
|
|
77
|
-
defaultSafeIntegers(toggle?: boolean | undefined | null): void
|
|
78
|
-
/** Runs the I/O loop synchronously. */
|
|
79
|
-
ioLoopSync(): void
|
|
80
|
-
/** Runs the I/O loop asynchronously, returning a Promise. */
|
|
81
|
-
ioLoopAsync(): Promise<void>
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/** A prepared statement. */
|
|
85
|
-
export declare class Statement {
|
|
86
|
-
reset(): void
|
|
87
|
-
/** Returns the number of parameters in the statement. */
|
|
88
|
-
parameterCount(): number
|
|
89
|
-
/**
|
|
90
|
-
* Returns the name of a parameter at a specific 1-based index.
|
|
91
|
-
*
|
|
92
|
-
* # Arguments
|
|
93
|
-
*
|
|
94
|
-
* * `index` - The 1-based parameter index.
|
|
95
|
-
*/
|
|
96
|
-
parameterName(index: number): string | null
|
|
97
|
-
/**
|
|
98
|
-
* Binds a parameter at a specific 1-based index with explicit type.
|
|
99
|
-
*
|
|
100
|
-
* # Arguments
|
|
101
|
-
*
|
|
102
|
-
* * `index` - The 1-based parameter index.
|
|
103
|
-
* * `value_type` - The type constant (0=null, 1=int, 2=float, 3=text, 4=blob).
|
|
104
|
-
* * `value` - The value to bind.
|
|
105
|
-
*/
|
|
106
|
-
bindAt(index: number, value: unknown): void
|
|
107
|
-
/**
|
|
108
|
-
* Step the statement and return result code:
|
|
109
|
-
* 1 = Row available, 2 = Done, 3 = I/O needed
|
|
110
|
-
*/
|
|
111
|
-
step(): number
|
|
112
|
-
/** Get the current row data according to the presentation mode */
|
|
113
|
-
row(): unknown
|
|
114
|
-
/** Sets the presentation mode to raw. */
|
|
115
|
-
raw(raw?: boolean | undefined | null): void
|
|
116
|
-
/** Sets the presentation mode to pluck. */
|
|
117
|
-
pluck(pluck?: boolean | undefined | null): void
|
|
118
|
-
/**
|
|
119
|
-
* Sets safe integers mode for this statement.
|
|
120
|
-
*
|
|
121
|
-
* # Arguments
|
|
122
|
-
*
|
|
123
|
-
* * `toggle` - Whether to use safe integers.
|
|
124
|
-
*/
|
|
125
|
-
safeIntegers(toggle?: boolean | undefined | null): void
|
|
126
|
-
/** Get column information for the statement */
|
|
127
|
-
columns(): unknown[]
|
|
128
|
-
/** Finalizes the statement. */
|
|
129
|
-
finalize(): void
|
|
130
|
-
}
|