@procedures/sqlite 0.63.0 → 0.65.0

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.
@@ -0,0 +1,743 @@
1
+ // The manifest of @mark1russell7/sqlite 0.3.9, made from its types by `node scripts/wraps.ts generate`. Do not edit it.
2
+ import type { ExportsManifest } from "@procedures/compiler";
3
+
4
+ export const manifest: ExportsManifest = {
5
+ "format": "procedures-exports/1",
6
+ "package": "@mark1russell7/sqlite",
7
+ "version": "0.3.9",
8
+ "entry": ".",
9
+ "namespace": [
10
+ "sqlite"
11
+ ],
12
+ "$defs": {
13
+ "Checkpointed": {
14
+ "type": "object",
15
+ "properties": {
16
+ "busy": {
17
+ "type": "boolean",
18
+ "description": "This value is true when a different connection stopped the checkpoint before its end."
19
+ },
20
+ "log": {
21
+ "type": "number",
22
+ "description": "This value is the number of pages in the log."
23
+ },
24
+ "checkpointed": {
25
+ "type": "number",
26
+ "description": "This value is the number of pages of the log that the checkpoint copied into the database file."
27
+ }
28
+ },
29
+ "required": [
30
+ "busy",
31
+ "log",
32
+ "checkpointed"
33
+ ]
34
+ },
35
+ "ClearOptions": {
36
+ "type": "object",
37
+ "properties": {
38
+ "vacuum": {
39
+ "type": "boolean",
40
+ "description": "This value makes the file small again after the drop (`VACUUM`). The default is true."
41
+ }
42
+ }
43
+ },
44
+ "Integrity": {
45
+ "type": "object",
46
+ "properties": {
47
+ "ok": {
48
+ "type": "boolean"
49
+ },
50
+ "problems": {
51
+ "type": "array",
52
+ "items": {
53
+ "type": "string"
54
+ }
55
+ }
56
+ },
57
+ "required": [
58
+ "ok",
59
+ "problems"
60
+ ]
61
+ },
62
+ "IntegrityOptions": {
63
+ "type": "object",
64
+ "properties": {
65
+ "quick": {
66
+ "type": "boolean",
67
+ "description": "This value selects `PRAGMA quick_check`. It is faster, but it does not compare the indexes with their tables. The default is `false`."
68
+ },
69
+ "limit": {
70
+ "type": "number",
71
+ "description": "This value is the highest count of problems that the check gives. The default is 100."
72
+ }
73
+ }
74
+ },
75
+ "OpenOptions": {
76
+ "type": "object",
77
+ "properties": {
78
+ "wal": {
79
+ "anyOf": [
80
+ {
81
+ "type": "boolean"
82
+ },
83
+ {
84
+ "const": "when-writable"
85
+ }
86
+ ],
87
+ "description": "This value turns on the write-ahead log (WAL). The default is true. Then readers do not stop a writer. A database with no file keeps its journal in memory."
88
+ },
89
+ "readOnly": {
90
+ "type": "boolean",
91
+ "description": "This value opens the file to read only. The default is false. The file must exist. The open does not change the journal mode, and each write throws. Do not give `wal: true` or `makeFolder: true` with it."
92
+ },
93
+ "synchronous": {
94
+ "enum": [
95
+ "EXTRA",
96
+ "FULL",
97
+ "NORMAL",
98
+ "OFF"
99
+ ],
100
+ "description": "This value is the pragma `synchronous`. The default is `FULL`: a commit is on the disk when the call ends. With WAL, `NORMAL` can lose the last commits at a power cut, and the file stays good."
101
+ },
102
+ "busyTimeoutMs": {
103
+ "type": "number",
104
+ "description": "This value is the time in milliseconds that a statement waits for the lock of a different connection. The default is 0: then the statement fails at once with \"database is locked\"."
105
+ },
106
+ "makeFolder": {
107
+ "type": "boolean",
108
+ "description": "This value makes the folder of the file when the folder is not there. The default is false."
109
+ },
110
+ "folderMode": {
111
+ "type": "number",
112
+ "description": "This value is the mode of the folders that `makeFolder` makes, for example `0o700`."
113
+ }
114
+ }
115
+ },
116
+ "Snapshot": {
117
+ "type": "object",
118
+ "properties": {
119
+ "path": {
120
+ "type": "string"
121
+ },
122
+ "bytes": {
123
+ "type": "number"
124
+ }
125
+ },
126
+ "required": [
127
+ "path",
128
+ "bytes"
129
+ ]
130
+ }
131
+ },
132
+ "procedures": [
133
+ {
134
+ "name": "addMissingColumns",
135
+ "path": [
136
+ "sqlite",
137
+ "addMissingColumns"
138
+ ],
139
+ "description": "This function adds each column that a table does not have, and gives the names of the added columns in their order.",
140
+ "params": [
141
+ "db",
142
+ "table",
143
+ "columns"
144
+ ],
145
+ "input": {
146
+ "type": "object",
147
+ "properties": {
148
+ "db": {
149
+ "type": "object",
150
+ "description": "The connection. A handle of a node:sqlite#DatabaseSync. The procedure that opens it gives it, and handle.close closes it.",
151
+ "properties": {
152
+ "handle": {
153
+ "type": "string",
154
+ "minLength": 1
155
+ }
156
+ },
157
+ "required": [
158
+ "handle"
159
+ ],
160
+ "additionalProperties": false,
161
+ "x-procedures-handle": "node:sqlite#DatabaseSync"
162
+ },
163
+ "table": {
164
+ "type": "string",
165
+ "description": "The name of the table. The table must exist."
166
+ },
167
+ "columns": {
168
+ "type": "object",
169
+ "properties": {},
170
+ "additionalProperties": {
171
+ "type": "string"
172
+ },
173
+ "description": "The columns that the table must have."
174
+ }
175
+ },
176
+ "required": [
177
+ "db",
178
+ "table",
179
+ "columns"
180
+ ],
181
+ "additionalProperties": false
182
+ },
183
+ "output": {
184
+ "type": "array",
185
+ "items": {
186
+ "type": "string"
187
+ }
188
+ },
189
+ "effects": {
190
+ "reads": [
191
+ "fs",
192
+ "handles"
193
+ ],
194
+ "writes": [
195
+ "fs"
196
+ ],
197
+ "destructive": false,
198
+ "idempotent": true
199
+ },
200
+ "fsRoot": {}
201
+ },
202
+ {
203
+ "name": "checkIntegrity",
204
+ "path": [
205
+ "sqlite",
206
+ "checkIntegrity"
207
+ ],
208
+ "description": "This function does the integrity check of SQLite on a connection. A file that is not a database gives a problem, not an error. A different error, for example a lock that is not free, goes to the caller.",
209
+ "params": [
210
+ "db",
211
+ "options"
212
+ ],
213
+ "input": {
214
+ "type": "object",
215
+ "properties": {
216
+ "db": {
217
+ "type": "object",
218
+ "description": "The connection. A handle of a node:sqlite#DatabaseSync. The procedure that opens it gives it, and handle.close closes it.",
219
+ "properties": {
220
+ "handle": {
221
+ "type": "string",
222
+ "minLength": 1
223
+ }
224
+ },
225
+ "required": [
226
+ "handle"
227
+ ],
228
+ "additionalProperties": false,
229
+ "x-procedures-handle": "node:sqlite#DatabaseSync"
230
+ },
231
+ "options": {
232
+ "$ref": "#/$defs/IntegrityOptions",
233
+ "description": "The kind of check and the highest count of problems."
234
+ }
235
+ },
236
+ "required": [
237
+ "db"
238
+ ],
239
+ "additionalProperties": false
240
+ },
241
+ "output": {
242
+ "$ref": "#/$defs/Integrity"
243
+ },
244
+ "effects": {
245
+ "reads": [
246
+ "fs",
247
+ "handles"
248
+ ],
249
+ "writes": [],
250
+ "idempotent": true
251
+ },
252
+ "fsRoot": {}
253
+ },
254
+ {
255
+ "name": "checkpoint",
256
+ "path": [
257
+ "sqlite",
258
+ "checkpoint"
259
+ ],
260
+ "description": "This function does a checkpoint of the write-ahead log, and gives its result.",
261
+ "params": [
262
+ "db",
263
+ "mode"
264
+ ],
265
+ "input": {
266
+ "type": "object",
267
+ "properties": {
268
+ "db": {
269
+ "type": "object",
270
+ "description": "The connection. A handle of a node:sqlite#DatabaseSync. The procedure that opens it gives it, and handle.close closes it.",
271
+ "properties": {
272
+ "handle": {
273
+ "type": "string",
274
+ "minLength": 1
275
+ }
276
+ },
277
+ "required": [
278
+ "handle"
279
+ ],
280
+ "additionalProperties": false,
281
+ "x-procedures-handle": "node:sqlite#DatabaseSync"
282
+ },
283
+ "mode": {
284
+ "enum": [
285
+ "FULL",
286
+ "PASSIVE",
287
+ "RESTART",
288
+ "TRUNCATE"
289
+ ],
290
+ "description": "The mode of `PRAGMA wal_checkpoint`. The default is `PASSIVE`: it does not wait for other connections."
291
+ }
292
+ },
293
+ "required": [
294
+ "db"
295
+ ],
296
+ "additionalProperties": false
297
+ },
298
+ "output": {
299
+ "$ref": "#/$defs/Checkpointed"
300
+ },
301
+ "effects": {
302
+ "reads": [
303
+ "fs",
304
+ "handles"
305
+ ],
306
+ "writes": [
307
+ "fs"
308
+ ],
309
+ "destructive": false,
310
+ "idempotent": true
311
+ },
312
+ "fsRoot": {}
313
+ },
314
+ {
315
+ "name": "clearDatabase",
316
+ "path": [
317
+ "sqlite",
318
+ "clearDatabase"
319
+ ],
320
+ "description": "This function drops each view and each table of the database, and sets `user_version` to 0. The indexes and the triggers go with their tables and views. The tables of SQLite itself (`sqlite_*`) stay. Then `migrate` makes each step again.",
321
+ "params": [
322
+ "db",
323
+ "options"
324
+ ],
325
+ "input": {
326
+ "type": "object",
327
+ "properties": {
328
+ "db": {
329
+ "type": "object",
330
+ "description": "The connection. A handle of a node:sqlite#DatabaseSync. The procedure that opens it gives it, and handle.close closes it.",
331
+ "properties": {
332
+ "handle": {
333
+ "type": "string",
334
+ "minLength": 1
335
+ }
336
+ },
337
+ "required": [
338
+ "handle"
339
+ ],
340
+ "additionalProperties": false,
341
+ "x-procedures-handle": "node:sqlite#DatabaseSync"
342
+ },
343
+ "options": {
344
+ "$ref": "#/$defs/ClearOptions",
345
+ "description": "The vacuum after the drop."
346
+ }
347
+ },
348
+ "required": [
349
+ "db"
350
+ ],
351
+ "additionalProperties": false
352
+ },
353
+ "output": {
354
+ "type": "array",
355
+ "items": {
356
+ "type": "string"
357
+ }
358
+ },
359
+ "effects": {
360
+ "reads": [
361
+ "fs",
362
+ "handles"
363
+ ],
364
+ "writes": [
365
+ "fs"
366
+ ],
367
+ "destructive": true,
368
+ "idempotent": true
369
+ },
370
+ "fsRoot": {}
371
+ },
372
+ {
373
+ "name": "openDatabase",
374
+ "path": [
375
+ "sqlite",
376
+ "openDatabase"
377
+ ],
378
+ "description": "This function opens a database, and makes the file when it is not there. `:memory:` gives a database with no file. With `readOnly`, the file must exist.",
379
+ "params": [
380
+ "path",
381
+ "options"
382
+ ],
383
+ "input": {
384
+ "type": "object",
385
+ "properties": {
386
+ "path": {
387
+ "type": "string",
388
+ "description": "The path of the file, or `:memory:`."
389
+ },
390
+ "options": {
391
+ "$ref": "#/$defs/OpenOptions",
392
+ "description": "The pragmas and the folder."
393
+ }
394
+ },
395
+ "required": [
396
+ "path"
397
+ ],
398
+ "additionalProperties": false
399
+ },
400
+ "output": {
401
+ "type": "object",
402
+ "description": "A handle of a node:sqlite#DatabaseSync. The procedure that opens it gives it, and handle.close closes it.",
403
+ "properties": {
404
+ "handle": {
405
+ "type": "string",
406
+ "minLength": 1
407
+ }
408
+ },
409
+ "required": [
410
+ "handle"
411
+ ],
412
+ "additionalProperties": false,
413
+ "x-procedures-handle": "node:sqlite#DatabaseSync"
414
+ },
415
+ "effects": {
416
+ "reads": [
417
+ "fs"
418
+ ],
419
+ "writes": [
420
+ "fs",
421
+ "handles"
422
+ ],
423
+ "destructive": false,
424
+ "idempotent": false
425
+ },
426
+ "fsRoot": {
427
+ "paths": [
428
+ "path"
429
+ ],
430
+ "values": [
431
+ ":memory:"
432
+ ]
433
+ }
434
+ },
435
+ {
436
+ "name": "schemaVersion",
437
+ "path": [
438
+ "sqlite",
439
+ "schemaVersion"
440
+ ],
441
+ "description": "This function gives the schema version of a database. Without a part, it is the `user_version` of the file. With a part, it is the version of that part in the table `schema_versions`, and 0 when the file does not have the part.",
442
+ "params": [
443
+ "db",
444
+ "part"
445
+ ],
446
+ "input": {
447
+ "type": "object",
448
+ "properties": {
449
+ "db": {
450
+ "type": "object",
451
+ "description": "The connection. A handle of a node:sqlite#DatabaseSync. The procedure that opens it gives it, and handle.close closes it.",
452
+ "properties": {
453
+ "handle": {
454
+ "type": "string",
455
+ "minLength": 1
456
+ }
457
+ },
458
+ "required": [
459
+ "handle"
460
+ ],
461
+ "additionalProperties": false,
462
+ "x-procedures-handle": "node:sqlite#DatabaseSync"
463
+ },
464
+ "part": {
465
+ "type": "string",
466
+ "description": "The name of a part of the file."
467
+ }
468
+ },
469
+ "required": [
470
+ "db"
471
+ ],
472
+ "additionalProperties": false
473
+ },
474
+ "output": {
475
+ "type": "number"
476
+ },
477
+ "effects": {
478
+ "reads": [
479
+ "fs",
480
+ "handles"
481
+ ],
482
+ "writes": [],
483
+ "idempotent": true
484
+ },
485
+ "fsRoot": {}
486
+ },
487
+ {
488
+ "name": "snapshot",
489
+ "path": [
490
+ "sqlite",
491
+ "snapshot"
492
+ ],
493
+ "description": "This function writes a copy of an open database to a file with `VACUUM INTO`. The copy is one consistent state, and writers can continue during the copy. The function writes a temporary file first, and then it replaces the file at the path. Thus a reader of the path sees the old copy or the new copy.",
494
+ "params": [
495
+ "db",
496
+ "path"
497
+ ],
498
+ "input": {
499
+ "type": "object",
500
+ "properties": {
501
+ "db": {
502
+ "type": "object",
503
+ "description": "The connection of the database. A handle of a node:sqlite#DatabaseSync. The procedure that opens it gives it, and handle.close closes it.",
504
+ "properties": {
505
+ "handle": {
506
+ "type": "string",
507
+ "minLength": 1
508
+ }
509
+ },
510
+ "required": [
511
+ "handle"
512
+ ],
513
+ "additionalProperties": false,
514
+ "x-procedures-handle": "node:sqlite#DatabaseSync"
515
+ },
516
+ "path": {
517
+ "type": "string",
518
+ "description": "The path of the copy. A file at the path gets the new copy."
519
+ }
520
+ },
521
+ "required": [
522
+ "db",
523
+ "path"
524
+ ],
525
+ "additionalProperties": false
526
+ },
527
+ "output": {
528
+ "$ref": "#/$defs/Snapshot"
529
+ },
530
+ "effects": {
531
+ "reads": [
532
+ "fs",
533
+ "handles"
534
+ ],
535
+ "writes": [
536
+ "fs"
537
+ ],
538
+ "destructive": true,
539
+ "idempotent": true
540
+ },
541
+ "fsRoot": {
542
+ "paths": [
543
+ "path"
544
+ ]
545
+ }
546
+ },
547
+ {
548
+ "name": "tableColumns",
549
+ "path": [
550
+ "sqlite",
551
+ "tableColumns"
552
+ ],
553
+ "description": "This function gives the names of the columns of a table, in the order of the table. A table that does not exist gives an empty list.",
554
+ "params": [
555
+ "db",
556
+ "table"
557
+ ],
558
+ "input": {
559
+ "type": "object",
560
+ "properties": {
561
+ "db": {
562
+ "type": "object",
563
+ "description": "The connection. A handle of a node:sqlite#DatabaseSync. The procedure that opens it gives it, and handle.close closes it.",
564
+ "properties": {
565
+ "handle": {
566
+ "type": "string",
567
+ "minLength": 1
568
+ }
569
+ },
570
+ "required": [
571
+ "handle"
572
+ ],
573
+ "additionalProperties": false,
574
+ "x-procedures-handle": "node:sqlite#DatabaseSync"
575
+ },
576
+ "table": {
577
+ "type": "string",
578
+ "description": "The name of the table."
579
+ }
580
+ },
581
+ "required": [
582
+ "db",
583
+ "table"
584
+ ],
585
+ "additionalProperties": false
586
+ },
587
+ "output": {
588
+ "type": "array",
589
+ "items": {
590
+ "type": "string"
591
+ }
592
+ },
593
+ "effects": {
594
+ "reads": [
595
+ "fs",
596
+ "handles"
597
+ ],
598
+ "writes": [],
599
+ "idempotent": true
600
+ },
601
+ "fsRoot": {}
602
+ },
603
+ {
604
+ "name": "userVersion",
605
+ "path": [
606
+ "sqlite",
607
+ "userVersion"
608
+ ],
609
+ "description": "This function gives the pragma `user_version` of a database.",
610
+ "params": [
611
+ "db"
612
+ ],
613
+ "input": {
614
+ "type": "object",
615
+ "properties": {
616
+ "db": {
617
+ "type": "object",
618
+ "description": "A handle of a node:sqlite#DatabaseSync. The procedure that opens it gives it, and handle.close closes it.",
619
+ "properties": {
620
+ "handle": {
621
+ "type": "string",
622
+ "minLength": 1
623
+ }
624
+ },
625
+ "required": [
626
+ "handle"
627
+ ],
628
+ "additionalProperties": false,
629
+ "x-procedures-handle": "node:sqlite#DatabaseSync"
630
+ }
631
+ },
632
+ "required": [
633
+ "db"
634
+ ],
635
+ "additionalProperties": false
636
+ },
637
+ "output": {
638
+ "type": "number"
639
+ },
640
+ "effects": {
641
+ "reads": [
642
+ "fs",
643
+ "handles"
644
+ ],
645
+ "writes": [],
646
+ "idempotent": true
647
+ },
648
+ "fsRoot": {}
649
+ }
650
+ ],
651
+ "exempt": [
652
+ {
653
+ "name": "confineToFile",
654
+ "reason": "function-parameter",
655
+ "detail": "db.setAuthorizer: (callback: ((actionCode: number, arg1: string | null, arg2: string | null, dbName: string | null, triggerOrView: string | null) => number) | null) => void"
656
+ },
657
+ {
658
+ "name": "eachStatement",
659
+ "reason": "input-not-json",
660
+ "detail": "db: an object with the method prepare"
661
+ },
662
+ {
663
+ "name": "ensureProjection",
664
+ "reason": "function-parameter",
665
+ "detail": "schema: (db: D) => void"
666
+ },
667
+ {
668
+ "name": "eventLog",
669
+ "reason": "function-parameter",
670
+ "detail": "options.parse.~standard.validate: (value: unknown) => StandardResult<E> | Promise<StandardResult<E>>"
671
+ },
672
+ {
673
+ "name": "listRecoveries",
674
+ "reason": "output-not-json",
675
+ "detail": "cause.fault.error: Error"
676
+ },
677
+ {
678
+ "name": "migrate",
679
+ "reason": "function-parameter",
680
+ "detail": "migrations: (db: D) => void"
681
+ },
682
+ {
683
+ "name": "openCheckedEventLog",
684
+ "reason": "function-parameter",
685
+ "detail": "parse.~standard.validate: (value: unknown) => StandardResult<E> | Promise<StandardResult<E>>"
686
+ },
687
+ {
688
+ "name": "openEventLog",
689
+ "reason": "function-parameter",
690
+ "detail": "parse.~standard.validate: (value: unknown) => StandardResult<E> | Promise<StandardResult<E>>"
691
+ },
692
+ {
693
+ "name": "openOrQuarantine",
694
+ "reason": "input-not-json",
695
+ "detail": "options.now: Date"
696
+ },
697
+ {
698
+ "name": "quarantine",
699
+ "reason": "input-not-json",
700
+ "detail": "options.now: Date"
701
+ },
702
+ {
703
+ "name": "readTransaction",
704
+ "reason": "function-parameter",
705
+ "detail": "options.onRollbackError: (error: unknown) => void"
706
+ },
707
+ {
708
+ "name": "salvageEventLog",
709
+ "reason": "input-not-json",
710
+ "detail": "target: an object with the method read"
711
+ },
712
+ {
713
+ "name": "sqlJsConnection",
714
+ "reason": "input-not-json",
715
+ "detail": "db: an object with the method exec"
716
+ },
717
+ {
718
+ "name": "sqliteFault",
719
+ "reason": "output-not-json",
720
+ "detail": "error: Error"
721
+ },
722
+ {
723
+ "name": "transaction",
724
+ "reason": "function-parameter",
725
+ "detail": "options.onRollbackError: (error: unknown) => void"
726
+ },
727
+ {
728
+ "name": "wasmConnection",
729
+ "reason": "input-not-json",
730
+ "detail": "sqlite3.capi: an object with the method sqlite3_get_autocommit"
731
+ }
732
+ ],
733
+ "others": {
734
+ "classes": [
735
+ "BrokenLogError",
736
+ "ConfineUnavailableError",
737
+ "IntegrityError",
738
+ "SchemaError"
739
+ ],
740
+ "values": 3,
741
+ "types": 63
742
+ }
743
+ };