@ykdz/template 0.0.38 → 0.0.41

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.
Files changed (227) hide show
  1. package/dist/application.d.ts +1 -52
  2. package/dist/application.js +0 -81
  3. package/dist/cli.js +14 -28
  4. package/dist/input-schemas.d.ts +30 -0
  5. package/dist/input-schemas.js +75 -0
  6. package/dist/main.d.ts +3 -14
  7. package/dist/main.js +496 -378
  8. package/dist/result-schemas.d.ts +222 -0
  9. package/dist/result-schemas.js +74 -0
  10. package/dist/standard-schema.d.ts +3 -0
  11. package/dist/standard-schema.js +29 -0
  12. package/node_modules/@standard-schema/spec/LICENSE +21 -0
  13. package/node_modules/@standard-schema/spec/README.md +198 -0
  14. package/node_modules/@standard-schema/spec/dist/index.cjs +18 -0
  15. package/node_modules/@standard-schema/spec/dist/index.d.cts +119 -0
  16. package/node_modules/@standard-schema/spec/dist/index.d.ts +119 -0
  17. package/node_modules/@standard-schema/spec/dist/index.js +0 -0
  18. package/node_modules/@standard-schema/spec/package.json +52 -0
  19. package/node_modules/@types/node/LICENSE +21 -0
  20. package/node_modules/@types/node/README.md +15 -0
  21. package/node_modules/@types/node/assert/strict.d.ts +111 -0
  22. package/node_modules/@types/node/assert.d.ts +1115 -0
  23. package/node_modules/@types/node/async_hooks.d.ts +619 -0
  24. package/node_modules/@types/node/buffer.buffer.d.ts +477 -0
  25. package/node_modules/@types/node/buffer.d.ts +1941 -0
  26. package/node_modules/@types/node/child_process.d.ts +1480 -0
  27. package/node_modules/@types/node/cluster.d.ts +578 -0
  28. package/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  29. package/node_modules/@types/node/console.d.ts +453 -0
  30. package/node_modules/@types/node/constants.d.ts +21 -0
  31. package/node_modules/@types/node/crypto.d.ts +5484 -0
  32. package/node_modules/@types/node/dgram.d.ts +715 -0
  33. package/node_modules/@types/node/diagnostics_channel.d.ts +576 -0
  34. package/node_modules/@types/node/dns/promises.d.ts +503 -0
  35. package/node_modules/@types/node/dns.d.ts +923 -0
  36. package/node_modules/@types/node/domain.d.ts +166 -0
  37. package/node_modules/@types/node/events.d.ts +967 -0
  38. package/node_modules/@types/node/fs/promises.d.ts +1354 -0
  39. package/node_modules/@types/node/fs.d.ts +4777 -0
  40. package/node_modules/@types/node/globals.d.ts +170 -0
  41. package/node_modules/@types/node/globals.typedarray.d.ts +41 -0
  42. package/node_modules/@types/node/http.d.ts +2246 -0
  43. package/node_modules/@types/node/http2.d.ts +2882 -0
  44. package/node_modules/@types/node/https.d.ts +585 -0
  45. package/node_modules/@types/node/index.d.ts +101 -0
  46. package/node_modules/@types/node/inspector.d.ts +323 -0
  47. package/node_modules/@types/node/inspector.generated.d.ts +4406 -0
  48. package/node_modules/@types/node/module.d.ts +844 -0
  49. package/node_modules/@types/node/net.d.ts +1197 -0
  50. package/node_modules/@types/node/os.d.ts +507 -0
  51. package/node_modules/@types/node/package.json +140 -0
  52. package/node_modules/@types/node/path.d.ts +200 -0
  53. package/node_modules/@types/node/perf_hooks.d.ts +1054 -0
  54. package/node_modules/@types/node/process.d.ts +2101 -0
  55. package/node_modules/@types/node/punycode.d.ts +117 -0
  56. package/node_modules/@types/node/querystring.d.ts +152 -0
  57. package/node_modules/@types/node/readline/promises.d.ts +161 -0
  58. package/node_modules/@types/node/readline.d.ts +600 -0
  59. package/node_modules/@types/node/repl.d.ts +438 -0
  60. package/node_modules/@types/node/sea.d.ts +162 -0
  61. package/node_modules/@types/node/sqlite.d.ts +1182 -0
  62. package/node_modules/@types/node/stream/consumers.d.ts +45 -0
  63. package/node_modules/@types/node/stream/promises.d.ts +90 -0
  64. package/node_modules/@types/node/stream/web.d.ts +596 -0
  65. package/node_modules/@types/node/stream.d.ts +1707 -0
  66. package/node_modules/@types/node/string_decoder.d.ts +67 -0
  67. package/node_modules/@types/node/test.d.ts +2656 -0
  68. package/node_modules/@types/node/timers/promises.d.ts +108 -0
  69. package/node_modules/@types/node/timers.d.ts +285 -0
  70. package/node_modules/@types/node/tls.d.ts +1314 -0
  71. package/node_modules/@types/node/trace_events.d.ts +197 -0
  72. package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +473 -0
  73. package/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
  74. package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
  75. package/node_modules/@types/node/ts5.6/index.d.ts +103 -0
  76. package/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
  77. package/node_modules/@types/node/ts5.7/index.d.ts +103 -0
  78. package/node_modules/@types/node/tty.d.ts +209 -0
  79. package/node_modules/@types/node/url.d.ts +1103 -0
  80. package/node_modules/@types/node/util.d.ts +2376 -0
  81. package/node_modules/@types/node/v8.d.ts +1010 -0
  82. package/node_modules/@types/node/vm.d.ts +1160 -0
  83. package/node_modules/@types/node/wasi.d.ts +202 -0
  84. package/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
  85. package/node_modules/@types/node/web-globals/crypto.d.ts +32 -0
  86. package/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
  87. package/node_modules/@types/node/web-globals/events.d.ts +97 -0
  88. package/node_modules/@types/node/web-globals/fetch.d.ts +62 -0
  89. package/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
  90. package/node_modules/@types/node/web-globals/storage.d.ts +24 -0
  91. package/node_modules/@types/node/web-globals/streams.d.ts +22 -0
  92. package/node_modules/@types/node/worker_threads.d.ts +894 -0
  93. package/node_modules/@types/node/zlib.d.ts +768 -0
  94. package/node_modules/@valibot/to-json-schema/LICENSE.md +9 -0
  95. package/node_modules/@valibot/to-json-schema/README.md +475 -0
  96. package/node_modules/@valibot/to-json-schema/dist/index.cjs +800 -0
  97. package/node_modules/@valibot/to-json-schema/dist/index.d.cts +991 -0
  98. package/node_modules/@valibot/to-json-schema/dist/index.d.mts +991 -0
  99. package/node_modules/@valibot/to-json-schema/dist/index.min.cjs +1 -0
  100. package/node_modules/@valibot/to-json-schema/dist/index.min.mjs +1 -0
  101. package/node_modules/@valibot/to-json-schema/dist/index.mjs +795 -0
  102. package/node_modules/@valibot/to-json-schema/package.json +75 -0
  103. package/node_modules/@ykdz/cli-contract/LICENSE +21 -0
  104. package/node_modules/@ykdz/cli-contract/dist/atomic-variant-compiler.d.ts +17 -0
  105. package/node_modules/@ykdz/cli-contract/dist/atomic-variant-compiler.js +55 -0
  106. package/node_modules/@ykdz/cli-contract/dist/cli-contract.d.ts +1164 -0
  107. package/node_modules/@ykdz/cli-contract/dist/cli-contract.js +1408 -0
  108. package/node_modules/@ykdz/cli-contract/dist/cli-execution.d.ts +54 -0
  109. package/node_modules/@ykdz/cli-contract/dist/cli-execution.js +708 -0
  110. package/node_modules/@ykdz/cli-contract/dist/cli-invocation.d.ts +174 -0
  111. package/node_modules/@ykdz/cli-contract/dist/cli-invocation.js +524 -0
  112. package/node_modules/@ykdz/cli-contract/dist/cli-write-error.d.ts +10 -0
  113. package/node_modules/@ykdz/cli-contract/dist/cli-write-error.js +14 -0
  114. package/node_modules/@ykdz/cli-contract/dist/contract-definition-error.d.ts +260 -0
  115. package/node_modules/@ykdz/cli-contract/dist/contract-definition-error.js +130 -0
  116. package/node_modules/@ykdz/cli-contract/dist/contract-execution-error.d.ts +63 -0
  117. package/node_modules/@ykdz/cli-contract/dist/contract-execution-error.js +17 -0
  118. package/node_modules/@ykdz/cli-contract/dist/contract-schema-compiler.d.ts +6 -0
  119. package/node_modules/@ykdz/cli-contract/dist/contract-schema-compiler.js +532 -0
  120. package/node_modules/@ykdz/cli-contract/dist/contract-schema.d.ts +14 -0
  121. package/node_modules/@ykdz/cli-contract/dist/contract-schema.js +1 -0
  122. package/node_modules/@ykdz/cli-contract/dist/description.d.ts +2 -0
  123. package/node_modules/@ykdz/cli-contract/dist/description.js +13 -0
  124. package/node_modules/@ykdz/cli-contract/dist/index.d.ts +8 -0
  125. package/node_modules/@ykdz/cli-contract/dist/index.js +7 -0
  126. package/node_modules/@ykdz/cli-contract/dist/json-value.d.ts +4 -0
  127. package/node_modules/@ykdz/cli-contract/dist/json-value.js +64 -0
  128. package/node_modules/@ykdz/cli-contract/dist/node.d.ts +21 -0
  129. package/node_modules/@ykdz/cli-contract/dist/node.js +109 -0
  130. package/node_modules/@ykdz/cli-contract/dist/outcome-fact.d.ts +162 -0
  131. package/node_modules/@ykdz/cli-contract/dist/outcome-fact.js +113 -0
  132. package/node_modules/@ykdz/cli-contract/dist/outcome-wire.d.ts +53 -0
  133. package/node_modules/@ykdz/cli-contract/dist/outcome-wire.js +189 -0
  134. package/node_modules/@ykdz/cli-contract/dist/stream-variant-compiler.d.ts +16 -0
  135. package/node_modules/@ykdz/cli-contract/dist/stream-variant-compiler.js +45 -0
  136. package/node_modules/@ykdz/cli-contract/package.json +69 -0
  137. package/node_modules/@ykdz/template-builtin-presets/dist/src/foundation.d.ts +20 -0
  138. package/node_modules/@ykdz/template-builtin-presets/dist/src/foundation.js +38 -2
  139. package/node_modules/@ykdz/template-builtin-presets/dist/src/generation-record.d.ts +19 -0
  140. package/node_modules/@ykdz/template-builtin-presets/dist/src/generation-record.js +1 -1
  141. package/node_modules/@ykdz/template-builtin-presets/dist/src/index.d.ts +2 -1
  142. package/node_modules/@ykdz/template-builtin-presets/dist/src/index.js +2 -1
  143. package/node_modules/@ykdz/template-builtin-presets/dist/src/ts-cli/definition.js +9 -5
  144. package/node_modules/@ykdz/template-builtin-presets/package.json +2 -1
  145. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/AGENTS.md.template +5 -3
  146. package/node_modules/@ykdz/template-builtin-presets/templates/{shared/devcontainer/node-pnpm.Dockerfile → foundation/devcontainer/base.Dockerfile} +14 -1
  147. package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/devcontainer/rust.Dockerfile +1 -5
  148. package/node_modules/@ykdz/template-builtin-presets/templates/shared/devcontainer/github-cli.Dockerfile +1 -3
  149. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/artifact.ts +128 -59
  150. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/handoff.ts +80 -8
  151. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/readiness.ts +7 -3
  152. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/src/cli.ts +9 -19
  153. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/src/main.ts +144 -60
  154. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/src/standard-schema.ts +37 -0
  155. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/test/e2e/journeys/lookup.journey.ts +71 -0
  156. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/test/integration/command.test.ts +118 -59
  157. package/node_modules/@ykdz/template-core/dist/dependency-catalog.d.ts +0 -1
  158. package/node_modules/@ykdz/template-core/dist/dependency-catalog.js +0 -19
  159. package/node_modules/@ykdz/template-core/dist/pnpm-workspace.yaml +3 -2
  160. package/node_modules/@ykdz/template-core/dist/project-blueprint.d.ts +15 -0
  161. package/node_modules/@ykdz/template-core/dist/project-blueprint.js +1 -1
  162. package/node_modules/@ykdz/template-core/dist/project-github.d.ts +0 -59
  163. package/node_modules/@ykdz/template-core/dist/project-github.js +0 -67
  164. package/node_modules/undici-types/LICENSE +21 -0
  165. package/node_modules/undici-types/README.md +6 -0
  166. package/node_modules/undici-types/agent.d.ts +32 -0
  167. package/node_modules/undici-types/api.d.ts +43 -0
  168. package/node_modules/undici-types/balanced-pool.d.ts +30 -0
  169. package/node_modules/undici-types/cache-interceptor.d.ts +179 -0
  170. package/node_modules/undici-types/cache.d.ts +36 -0
  171. package/node_modules/undici-types/client-stats.d.ts +15 -0
  172. package/node_modules/undici-types/client.d.ts +123 -0
  173. package/node_modules/undici-types/connector.d.ts +36 -0
  174. package/node_modules/undici-types/content-type.d.ts +21 -0
  175. package/node_modules/undici-types/cookies.d.ts +30 -0
  176. package/node_modules/undici-types/diagnostics-channel.d.ts +74 -0
  177. package/node_modules/undici-types/dispatcher.d.ts +279 -0
  178. package/node_modules/undici-types/env-http-proxy-agent.d.ts +22 -0
  179. package/node_modules/undici-types/errors.d.ts +177 -0
  180. package/node_modules/undici-types/eventsource.d.ts +66 -0
  181. package/node_modules/undici-types/fetch.d.ts +211 -0
  182. package/node_modules/undici-types/formdata.d.ts +108 -0
  183. package/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  184. package/node_modules/undici-types/global-origin.d.ts +7 -0
  185. package/node_modules/undici-types/h2c-client.d.ts +73 -0
  186. package/node_modules/undici-types/handlers.d.ts +15 -0
  187. package/node_modules/undici-types/header.d.ts +160 -0
  188. package/node_modules/undici-types/index.d.ts +91 -0
  189. package/node_modules/undici-types/interceptors.d.ts +80 -0
  190. package/node_modules/undici-types/mock-agent.d.ts +68 -0
  191. package/node_modules/undici-types/mock-call-history.d.ts +111 -0
  192. package/node_modules/undici-types/mock-client.d.ts +27 -0
  193. package/node_modules/undici-types/mock-errors.d.ts +12 -0
  194. package/node_modules/undici-types/mock-interceptor.d.ts +94 -0
  195. package/node_modules/undici-types/mock-pool.d.ts +27 -0
  196. package/node_modules/undici-types/package.json +55 -0
  197. package/node_modules/undici-types/patch.d.ts +29 -0
  198. package/node_modules/undici-types/pool-stats.d.ts +19 -0
  199. package/node_modules/undici-types/pool.d.ts +41 -0
  200. package/node_modules/undici-types/proxy-agent.d.ts +29 -0
  201. package/node_modules/undici-types/readable.d.ts +68 -0
  202. package/node_modules/undici-types/retry-agent.d.ts +8 -0
  203. package/node_modules/undici-types/retry-handler.d.ts +125 -0
  204. package/node_modules/undici-types/round-robin-pool.d.ts +41 -0
  205. package/node_modules/undici-types/snapshot-agent.d.ts +109 -0
  206. package/node_modules/undici-types/socks5-proxy-agent.d.ts +25 -0
  207. package/node_modules/undici-types/util.d.ts +18 -0
  208. package/node_modules/undici-types/utility.d.ts +7 -0
  209. package/node_modules/undici-types/webidl.d.ts +347 -0
  210. package/node_modules/undici-types/websocket.d.ts +188 -0
  211. package/package.json +5 -3
  212. package/dist/command-result.d.ts +0 -9
  213. package/dist/command-result.js +0 -231
  214. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/test/e2e/journeys/greet.journey.ts +0 -46
  215. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/test/unit/greet.test.ts +0 -15
  216. package/node_modules/commander/LICENSE +0 -22
  217. package/node_modules/commander/Readme.md +0 -1172
  218. package/node_modules/commander/index.js +0 -21
  219. package/node_modules/commander/lib/argument.js +0 -147
  220. package/node_modules/commander/lib/command.js +0 -2790
  221. package/node_modules/commander/lib/error.js +0 -36
  222. package/node_modules/commander/lib/help.js +0 -731
  223. package/node_modules/commander/lib/option.js +0 -377
  224. package/node_modules/commander/lib/suggestSimilar.js +0 -99
  225. package/node_modules/commander/package-support.json +0 -19
  226. package/node_modules/commander/package.json +0 -64
  227. package/node_modules/commander/typings/index.d.ts +0 -1113
@@ -0,0 +1,1182 @@
1
+ /**
2
+ * The `node:sqlite` module facilitates working with SQLite databases.
3
+ * To access it:
4
+ *
5
+ * ```js
6
+ * import sqlite from 'node:sqlite';
7
+ * ```
8
+ *
9
+ * This module is only available under the `node:` scheme.
10
+ *
11
+ * The following example shows the basic usage of the `node:sqlite` module to open
12
+ * an in-memory database, write data to the database, and then read the data back.
13
+ *
14
+ * ```js
15
+ * import { DatabaseSync } from 'node:sqlite';
16
+ * const database = new DatabaseSync(':memory:');
17
+ *
18
+ * // Execute SQL statements from strings.
19
+ * database.exec(`
20
+ * CREATE TABLE data(
21
+ * key INTEGER PRIMARY KEY,
22
+ * value TEXT
23
+ * ) STRICT
24
+ * `);
25
+ * // Create a prepared statement to insert data into the database.
26
+ * const insert = database.prepare('INSERT INTO data (key, value) VALUES (?, ?)');
27
+ * // Execute the prepared statement with bound values.
28
+ * insert.run(1, 'hello');
29
+ * insert.run(2, 'world');
30
+ * // Create a prepared statement to read data from the database.
31
+ * const query = database.prepare('SELECT * FROM data ORDER BY key');
32
+ * // Execute the prepared statement and log the result set.
33
+ * console.log(query.all());
34
+ * // Prints: [ { key: 1, value: 'hello' }, { key: 2, value: 'world' } ]
35
+ * ```
36
+ * @since v22.5.0
37
+ * @experimental
38
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/sqlite.js)
39
+ */
40
+ declare module "node:sqlite" {
41
+ import { PathLike } from "node:fs";
42
+ type SQLInputValue = null | number | bigint | string | NodeJS.ArrayBufferView;
43
+ type SQLOutputValue = null | number | bigint | string | NodeJS.NonSharedUint8Array;
44
+ interface DatabaseSyncOptions {
45
+ /**
46
+ * If `true`, the database is opened by the constructor. When
47
+ * this value is `false`, the database must be opened via the `open()` method.
48
+ * @since v22.5.0
49
+ * @default true
50
+ */
51
+ open?: boolean | undefined;
52
+ /**
53
+ * If `true`, foreign key constraints
54
+ * are enabled. This is recommended but can be disabled for compatibility with
55
+ * legacy database schemas. The enforcement of foreign key constraints can be
56
+ * enabled and disabled after opening the database using
57
+ * [`PRAGMA foreign_keys`](https://www.sqlite.org/pragma.html#pragma_foreign_keys).
58
+ * @since v22.10.0
59
+ * @default true
60
+ */
61
+ enableForeignKeyConstraints?: boolean | undefined;
62
+ /**
63
+ * If `true`, SQLite will accept
64
+ * [double-quoted string literals](https://www.sqlite.org/quirks.html#dblquote).
65
+ * This is not recommended but can be
66
+ * enabled for compatibility with legacy database schemas.
67
+ * @since v22.10.0
68
+ * @default false
69
+ */
70
+ enableDoubleQuotedStringLiterals?: boolean | undefined;
71
+ /**
72
+ * If `true`, the database is opened in read-only mode.
73
+ * If the database does not exist, opening it will fail.
74
+ * @since v22.12.0
75
+ * @default false
76
+ */
77
+ readOnly?: boolean | undefined;
78
+ /**
79
+ * If `true`, the `loadExtension` SQL function
80
+ * and the `loadExtension()` method are enabled.
81
+ * You can call `enableLoadExtension(false)` later to disable this feature.
82
+ * @since v22.13.0
83
+ * @default false
84
+ */
85
+ allowExtension?: boolean | undefined;
86
+ /**
87
+ * The [busy timeout](https://sqlite.org/c3ref/busy_timeout.html) in milliseconds. This is the maximum amount of
88
+ * time that SQLite will wait for a database lock to be released before
89
+ * returning an error.
90
+ * @since v24.0.0
91
+ * @default 0
92
+ */
93
+ timeout?: number | undefined;
94
+ /**
95
+ * If `true`, integer fields are read as JavaScript `BigInt` values. If `false`,
96
+ * integer fields are read as JavaScript numbers.
97
+ * @since v24.4.0
98
+ * @default false
99
+ */
100
+ readBigInts?: boolean | undefined;
101
+ /**
102
+ * If `true`, query results are returned as arrays instead of objects.
103
+ * @since v24.4.0
104
+ * @default false
105
+ */
106
+ returnArrays?: boolean | undefined;
107
+ /**
108
+ * If `true`, allows binding named parameters without the prefix
109
+ * character (e.g., `foo` instead of `:foo`).
110
+ * @since v24.4.40
111
+ * @default true
112
+ */
113
+ allowBareNamedParameters?: boolean | undefined;
114
+ /**
115
+ * If `true`, unknown named parameters are ignored when binding.
116
+ * If `false`, an exception is thrown for unknown named parameters.
117
+ * @since v24.4.40
118
+ * @default false
119
+ */
120
+ allowUnknownNamedParameters?: boolean | undefined;
121
+ /**
122
+ * If `true`, enables the defensive flag. When the defensive flag is enabled,
123
+ * language features that allow ordinary SQL to deliberately corrupt the database
124
+ * file are disabled. The defensive flag can also be set using `enableDefensive()`.
125
+ * @since v24.12.0
126
+ * @default true
127
+ */
128
+ defensive?: boolean | undefined;
129
+ /**
130
+ * Configuration for various SQLite limits. These limits
131
+ * can be used to prevent excessive resource consumption when handling
132
+ * potentially malicious input. See [Run-Time Limits](https://www.sqlite.org/c3ref/c_limit_attached.html) and [Limit Constants](https://www.sqlite.org/c3ref/limit.html)
133
+ * in the SQLite documentation for details. Default values are determined by
134
+ * SQLite's compile-time defaults and may vary depending on how SQLite was
135
+ * built. The following properties are supported:
136
+ * @since v24.15.0
137
+ */
138
+ limits?: NodeJS.PartialOptions<DatabaseLimits> | undefined;
139
+ }
140
+ interface DatabaseLimits {
141
+ length: number;
142
+ sqlLength: number;
143
+ column: number;
144
+ exprDepth: number;
145
+ compoundSelect: number;
146
+ vdbeOp: number;
147
+ functionArg: number;
148
+ attach: number;
149
+ likePatternLength: number;
150
+ variableNumber: number;
151
+ triggerDepth: number;
152
+ }
153
+ interface CreateSessionOptions {
154
+ /**
155
+ * A specific table to track changes for. By default, changes to all tables are tracked.
156
+ * @since v22.12.0
157
+ */
158
+ table?: string | undefined;
159
+ /**
160
+ * Name of the database to track. This is useful when multiple databases have been added using
161
+ * [`ATTACH DATABASE`](https://www.sqlite.org/lang_attach.html).
162
+ * @since v22.12.0
163
+ * @default 'main'
164
+ */
165
+ db?: string | undefined;
166
+ }
167
+ interface ApplyChangesetOptions {
168
+ /**
169
+ * for each table affected by at least
170
+ * one change in the changeset, the `filter` callback is invoked with the
171
+ * table name as the first argument. If the return value is falsy, then no
172
+ * attempt is made to apply any changes to the table.
173
+ * Otherwise, if the return value is truthy or no `filter` callback is provided,
174
+ * all changes related to the table are attempted.
175
+ * @since v22.12.0
176
+ */
177
+ filter?: ((tableName: string) => boolean) | undefined;
178
+ /**
179
+ * A function that determines how to handle conflicts. The function receives one argument,
180
+ * which can be one of the following values:
181
+ *
182
+ * * `SQLITE_CHANGESET_DATA`: A `DELETE` or `UPDATE` change does not contain the expected "before" values.
183
+ * * `SQLITE_CHANGESET_NOTFOUND`: A row matching the primary key of the `DELETE` or `UPDATE` change does not exist.
184
+ * * `SQLITE_CHANGESET_CONFLICT`: An `INSERT` change results in a duplicate primary key.
185
+ * * `SQLITE_CHANGESET_FOREIGN_KEY`: Applying a change would result in a foreign key violation.
186
+ * * `SQLITE_CHANGESET_CONSTRAINT`: Applying a change results in a `UNIQUE`, `CHECK`, or `NOT NULL` constraint
187
+ * violation.
188
+ *
189
+ * The function should return one of the following values:
190
+ *
191
+ * * `SQLITE_CHANGESET_OMIT`: Omit conflicting changes.
192
+ * * `SQLITE_CHANGESET_REPLACE`: Replace existing values with conflicting changes (only valid with
193
+ `SQLITE_CHANGESET_DATA` or `SQLITE_CHANGESET_CONFLICT` conflicts).
194
+ * * `SQLITE_CHANGESET_ABORT`: Abort on conflict and roll back the database.
195
+ *
196
+ * When an error is thrown in the conflict handler or when any other value is returned from the handler,
197
+ * applying the changeset is aborted and the database is rolled back.
198
+ *
199
+ * **Default**: A function that returns `SQLITE_CHANGESET_ABORT`.
200
+ * @since v22.12.0
201
+ */
202
+ onConflict?: ((conflictType: number) => number) | undefined;
203
+ }
204
+ interface DeserializeOptions {
205
+ /**
206
+ * Name of the database to deserialize into.
207
+ * @default 'main'
208
+ */
209
+ dbName?: string | undefined;
210
+ }
211
+ interface FunctionOptions {
212
+ /**
213
+ * If `true`, the [`SQLITE_DETERMINISTIC`](https://www.sqlite.org/c3ref/c_deterministic.html) flag is
214
+ * set on the created function.
215
+ * @default false
216
+ */
217
+ deterministic?: boolean | undefined;
218
+ /**
219
+ * If `true`, the [`SQLITE_DIRECTONLY`](https://www.sqlite.org/c3ref/c_directonly.html) flag is set on
220
+ * the created function.
221
+ * @default false
222
+ */
223
+ directOnly?: boolean | undefined;
224
+ /**
225
+ * If `true`, integer arguments to `function`
226
+ * are converted to `BigInt`s. If `false`, integer arguments are passed as
227
+ * JavaScript numbers.
228
+ * @default false
229
+ */
230
+ useBigIntArguments?: boolean | undefined;
231
+ /**
232
+ * If `true`, `function` may be invoked with any number of
233
+ * arguments (between zero and
234
+ * [`SQLITE_MAX_FUNCTION_ARG`](https://www.sqlite.org/limits.html#max_function_arg)). If `false`,
235
+ * `function` must be invoked with exactly `function.length` arguments.
236
+ * @default false
237
+ */
238
+ varargs?: boolean | undefined;
239
+ }
240
+ interface AggregateOptions<T extends SQLInputValue = SQLInputValue> extends FunctionOptions {
241
+ /**
242
+ * The identity value for the aggregation function. This value is used when the aggregation
243
+ * function is initialized. When a `Function` is passed the identity will be its return value.
244
+ */
245
+ start: T | (() => T);
246
+ /**
247
+ * The function to call for each row in the aggregation. The
248
+ * function receives the current state and the row value. The return value of
249
+ * this function should be the new state.
250
+ */
251
+ step: (accumulator: T, ...args: SQLOutputValue[]) => T;
252
+ /**
253
+ * The function to call to get the result of the
254
+ * aggregation. The function receives the final state and should return the
255
+ * result of the aggregation.
256
+ */
257
+ result?: ((accumulator: T) => SQLInputValue) | undefined;
258
+ /**
259
+ * When this function is provided, the `aggregate` method will work as a window function.
260
+ * The function receives the current state and the dropped row value. The return value of this function should be the
261
+ * new state.
262
+ */
263
+ inverse?: ((accumulator: T, ...args: SQLOutputValue[]) => T) | undefined;
264
+ }
265
+ interface PrepareOptions {
266
+ /**
267
+ * If `true`, integer fields are read as `BigInt`s.
268
+ * @since v24.14.0
269
+ */
270
+ readBigInts?: boolean | undefined;
271
+ /**
272
+ * If `true`, results are returned as arrays.
273
+ * @since v24.14.0
274
+ */
275
+ returnArrays?: boolean | undefined;
276
+ /**
277
+ * If `true`, allows binding named parameters without the prefix character.
278
+ * @since v24.14.0
279
+ */
280
+ allowBareNamedParameters?: boolean | undefined;
281
+ /**
282
+ * If `true`, unknown named parameters are ignored.
283
+ * @since v24.14.0
284
+ */
285
+ allowUnknownNamedParameters?: boolean | undefined;
286
+ }
287
+ /**
288
+ * This class represents a single [connection](https://www.sqlite.org/c3ref/sqlite3.html) to a SQLite database. All APIs
289
+ * exposed by this class execute synchronously.
290
+ * @since v22.5.0
291
+ */
292
+ class DatabaseSync implements Disposable {
293
+ /**
294
+ * Constructs a new `DatabaseSync` instance.
295
+ * @param path The path of the database.
296
+ * A SQLite database can be stored in a file or completely [in memory](https://www.sqlite.org/inmemorydb.html).
297
+ * To use a file-backed database, the path should be a file path.
298
+ * To use an in-memory database, the path should be the special name `':memory:'`.
299
+ * @param options Configuration options for the database connection.
300
+ */
301
+ constructor(path: PathLike, options?: DatabaseSyncOptions);
302
+ /**
303
+ * Registers a new aggregate function with the SQLite database. This method is a wrapper around
304
+ * [`sqlite3_create_window_function()`](https://www.sqlite.org/c3ref/create_function.html).
305
+ *
306
+ * When used as a window function, the `result` function will be called multiple times.
307
+ *
308
+ * ```js
309
+ * import { DatabaseSync } from 'node:sqlite';
310
+ *
311
+ * const db = new DatabaseSync(':memory:');
312
+ * db.exec(`
313
+ * CREATE TABLE t3(x, y);
314
+ * INSERT INTO t3 VALUES ('a', 4),
315
+ * ('b', 5),
316
+ * ('c', 3),
317
+ * ('d', 8),
318
+ * ('e', 1);
319
+ * `);
320
+ *
321
+ * db.aggregate('sumint', {
322
+ * start: 0,
323
+ * step: (acc, value) => acc + value,
324
+ * });
325
+ *
326
+ * db.prepare('SELECT sumint(y) as total FROM t3').get(); // { total: 21 }
327
+ * ```
328
+ * @since v24.0.0
329
+ * @param name The name of the SQLite function to create.
330
+ * @param options Function configuration settings.
331
+ */
332
+ aggregate(name: string, options: AggregateOptions): void;
333
+ aggregate<T extends SQLInputValue>(name: string, options: AggregateOptions<T>): void;
334
+ /**
335
+ * Closes the database connection. An exception is thrown if the database is not
336
+ * open. This method is a wrapper around [`sqlite3_close_v2()`](https://www.sqlite.org/c3ref/close.html).
337
+ * @since v22.5.0
338
+ */
339
+ close(): void;
340
+ /**
341
+ * Loads a shared library into the database connection. This method is a wrapper
342
+ * around [`sqlite3_load_extension()`](https://www.sqlite.org/c3ref/load_extension.html). It is required to enable the
343
+ * `allowExtension` option when constructing the `DatabaseSync` instance.
344
+ *
345
+ * ```js
346
+ * import { DatabaseSync } from 'node:sqlite';
347
+ * const database = new DatabaseSync(':memory:', { allowExtension: true });
348
+ *
349
+ * // Load using the entry point derived from the filename.
350
+ * database.loadExtension('./decimal.dylib');
351
+ *
352
+ * // Override the entry point when the derived name does not match.
353
+ * database.loadExtension('./base64.dylib', 'sqlite3_base64_init');
354
+ * @since v22.13.0
355
+ * @param path The path to the shared library to load.
356
+ * @param entryPoint The name of the extension's entry-point function. When
357
+ * omitted, SQLite derives the entry point from the shared library's filename;
358
+ * pass this argument explicitly when the derived name does not match.
359
+ */
360
+ loadExtension(path: string, entryPoint?: string): void;
361
+ /**
362
+ * Enables or disables the `loadExtension` SQL function, and the `loadExtension()`
363
+ * method. When `allowExtension` is `false` when constructing, you cannot enable
364
+ * loading extensions for security reasons.
365
+ * @since v22.13.0
366
+ * @param allow Whether to allow loading extensions.
367
+ */
368
+ enableLoadExtension(allow: boolean): void;
369
+ /**
370
+ * Enables or disables the defensive flag. When the defensive flag is active,
371
+ * language features that allow ordinary SQL to deliberately corrupt the
372
+ * database file are disabled.
373
+ * See [`SQLITE_DBCONFIG_DEFENSIVE`](https://www.sqlite.org/c3ref/c_dbconfig_defensive.html#sqlitedbconfigdefensive)
374
+ * in the SQLite documentation for details.
375
+ * @since v24.12.0
376
+ * @param active Whether to set the defensive flag.
377
+ */
378
+ enableDefensive(active: boolean): void;
379
+ /**
380
+ * This method is a wrapper around [`sqlite3_db_filename()`](https://sqlite.org/c3ref/db_filename.html)
381
+ * @since v24.0.0
382
+ * @param dbName Name of the database. This can be `'main'` (the default primary database) or any other
383
+ * database that has been added with [`ATTACH DATABASE`](https://www.sqlite.org/lang_attach.html) **Default:** `'main'`.
384
+ * @returns The location of the database file. When using an in-memory database,
385
+ * this method returns null.
386
+ */
387
+ location(dbName?: string): string | null;
388
+ /**
389
+ * This method allows one or more SQL statements to be executed without returning
390
+ * any results. This method is useful when executing SQL statements read from a
391
+ * file. This method is a wrapper around [`sqlite3_exec()`](https://www.sqlite.org/c3ref/exec.html).
392
+ * @since v22.5.0
393
+ * @param sql A SQL string to execute.
394
+ */
395
+ exec(sql: string): void;
396
+ /**
397
+ * This method is used to create SQLite user-defined functions. This method is a
398
+ * wrapper around [`sqlite3_create_function_v2()`](https://www.sqlite.org/c3ref/create_function.html).
399
+ * @since v22.13.0
400
+ * @param name The name of the SQLite function to create.
401
+ * @param options Optional configuration settings for the function.
402
+ * @param fn The JavaScript function to call when the SQLite function is
403
+ * invoked. The return value of this function should be a valid SQLite data type:
404
+ * see [Type conversion between JavaScript and SQLite](https://nodejs.org/docs/latest-v24.x/api/sqlite.html#type-conversion-between-javascript-and-sqlite). The result defaults to
405
+ * `NULL` if the return value is `undefined`.
406
+ */
407
+ function(
408
+ name: string,
409
+ options: FunctionOptions,
410
+ fn: (...args: SQLOutputValue[]) => SQLInputValue,
411
+ ): void;
412
+ function(name: string, fn: (...args: SQLOutputValue[]) => SQLInputValue): void;
413
+ /**
414
+ * Sets an authorizer callback that SQLite will invoke whenever it attempts to
415
+ * access data or modify the database schema through prepared statements.
416
+ * This can be used to implement security policies, audit access, or restrict certain operations.
417
+ * This method is a wrapper around [`sqlite3_set_authorizer()`](https://sqlite.org/c3ref/set_authorizer.html).
418
+ *
419
+ * When invoked, the callback receives five arguments:
420
+ *
421
+ * * `actionCode` {number} The type of operation being performed (e.g.,
422
+ * `SQLITE_INSERT`, `SQLITE_UPDATE`, `SQLITE_SELECT`).
423
+ * * `arg1` {string|null} The first argument (context-dependent, often a table name).
424
+ * * `arg2` {string|null} The second argument (context-dependent, often a column name).
425
+ * * `dbName` {string|null} The name of the database.
426
+ * * `triggerOrView` {string|null} The name of the trigger or view causing the access.
427
+ *
428
+ * The callback must return one of the following constants:
429
+ *
430
+ * * `SQLITE_OK` - Allow the operation.
431
+ * * `SQLITE_DENY` - Deny the operation (causes an error).
432
+ * * `SQLITE_IGNORE` - Ignore the operation (silently skip).
433
+ *
434
+ * ```js
435
+ * import { DatabaseSync, constants } from 'node:sqlite';
436
+ * const db = new DatabaseSync(':memory:');
437
+ *
438
+ * // Set up an authorizer that denies all table creation
439
+ * db.setAuthorizer((actionCode) => {
440
+ * if (actionCode === constants.SQLITE_CREATE_TABLE) {
441
+ * return constants.SQLITE_DENY;
442
+ * }
443
+ * return constants.SQLITE_OK;
444
+ * });
445
+ *
446
+ * // This will work
447
+ * db.prepare('SELECT 1').get();
448
+ *
449
+ * // This will throw an error due to authorization denial
450
+ * try {
451
+ * db.exec('CREATE TABLE blocked (id INTEGER)');
452
+ * } catch (err) {
453
+ * console.log('Operation blocked:', err.message);
454
+ * }
455
+ * ```
456
+ * @since v24.10.0
457
+ * @param callback The authorizer function to set, or `null` to
458
+ * clear the current authorizer.
459
+ */
460
+ setAuthorizer(
461
+ callback:
462
+ | ((
463
+ actionCode: number,
464
+ arg1: string | null,
465
+ arg2: string | null,
466
+ dbName: string | null,
467
+ triggerOrView: string | null,
468
+ ) => number)
469
+ | null,
470
+ ): void;
471
+ /**
472
+ * Whether the database is currently open or not.
473
+ * @since v22.15.0
474
+ */
475
+ readonly isOpen: boolean;
476
+ /**
477
+ * Whether the database is currently within a transaction. This method
478
+ * is a wrapper around [`sqlite3_get_autocommit()`](https://sqlite.org/c3ref/get_autocommit.html).
479
+ * @since v24.0.0
480
+ */
481
+ readonly isTransaction: boolean;
482
+ /**
483
+ * An object for getting and setting SQLite database limits at runtime.
484
+ * Each property corresponds to an SQLite limit and can be read or written.
485
+ *
486
+ * ```js
487
+ * const db = new DatabaseSync(':memory:');
488
+ *
489
+ * // Read current limit
490
+ * console.log(db.limits.length);
491
+ *
492
+ * // Set a new limit
493
+ * db.limits.sqlLength = 100000;
494
+ *
495
+ * // Reset a limit to its compile-time maximum
496
+ * db.limits.sqlLength = Infinity;
497
+ * ```
498
+ *
499
+ * Available properties: `length`, `sqlLength`, `column`, `exprDepth`,
500
+ * `compoundSelect`, `vdbeOp`, `functionArg`, `attach`, `likePatternLength`,
501
+ * `variableNumber`, `triggerDepth`.
502
+ *
503
+ * Setting a property to `Infinity` resets the limit to its compile-time maximum value.
504
+ * @since v24.15.0
505
+ */
506
+ readonly limits: DatabaseLimits;
507
+ /**
508
+ * Opens the database specified in the `path` argument of the `DatabaseSync`constructor. This method should only be used when the database is not opened via
509
+ * the constructor. An exception is thrown if the database is already open.
510
+ * @since v22.5.0
511
+ */
512
+ open(): void;
513
+ /**
514
+ * Serializes the database into a binary representation, returned as a
515
+ * `Uint8Array`. This is useful for saving, cloning, or transferring an in-memory
516
+ * database. This method is a wrapper around [`sqlite3_serialize()`](https://sqlite.org/c3ref/serialize.html).
517
+ *
518
+ * ```js
519
+ * import { DatabaseSync } from 'node:sqlite';
520
+ *
521
+ * const db = new DatabaseSync(':memory:');
522
+ * db.exec('CREATE TABLE t(key INTEGER PRIMARY KEY, value TEXT)');
523
+ * db.exec("INSERT INTO t VALUES (1, 'hello')");
524
+ * const buffer = db.serialize();
525
+ * console.log(buffer.length); // Prints the byte length of the database
526
+ * ```
527
+ * @since v24.16.0
528
+ * @param dbName Name of the database to serialize. This can be `'main'`
529
+ * (the default primary database) or any other database that has been added with
530
+ * [`ATTACH DATABASE`](https://www.sqlite.org/lang_attach.html). **Default:** `'main'`.
531
+ * @returns A binary representation of the database.
532
+ */
533
+ serialize(dbName?: string): NodeJS.NonSharedUint8Array;
534
+ /**
535
+ * Loads a serialized database into this connection, replacing the current
536
+ * database. The deserialized database is writable. Existing prepared statements
537
+ * are finalized before deserialization is attempted, even if the operation
538
+ * subsequently fails. This method is a wrapper around
539
+ * [`sqlite3_deserialize()`](https://sqlite.org/c3ref/deserialize.html).
540
+ *
541
+ * ```js
542
+ * import { DatabaseSync } from 'node:sqlite';
543
+ *
544
+ * const original = new DatabaseSync(':memory:');
545
+ * original.exec('CREATE TABLE t(key INTEGER PRIMARY KEY, value TEXT)');
546
+ * original.exec("INSERT INTO t VALUES (1, 'hello')");
547
+ * const buffer = original.serialize();
548
+ * original.close();
549
+ *
550
+ * const clone = new DatabaseSync(':memory:');
551
+ * clone.deserialize(buffer);
552
+ * console.log(clone.prepare('SELECT value FROM t').get());
553
+ * // Prints: { value: 'hello' }
554
+ * ```
555
+ * @since v24.16.0
556
+ * @param buffer A binary representation of a database, such as the
557
+ * output of `database.serialize()`.
558
+ * @param options Optional configuration for the deserialization.
559
+ */
560
+ deserialize(buffer: Uint8Array, options?: DeserializeOptions): void;
561
+ /**
562
+ * Compiles a SQL statement into a [prepared statement](https://www.sqlite.org/c3ref/stmt.html). This method is a wrapper
563
+ * around [`sqlite3_prepare_v2()`](https://www.sqlite.org/c3ref/prepare.html).
564
+ * @since v22.5.0
565
+ * @param sql A SQL string to compile to a prepared statement.
566
+ * @param options Optional configuration for the prepared statement.
567
+ * @return The prepared statement.
568
+ */
569
+ prepare(sql: string, options?: PrepareOptions): StatementSync;
570
+ /**
571
+ * Creates a new {@link SQLTagStore}, which is a Least Recently Used (LRU) cache
572
+ * for storing prepared statements. This allows for the efficient reuse of
573
+ * prepared statements by tagging them with a unique identifier.
574
+ *
575
+ * When a tagged SQL literal is executed, the `SQLTagStore` checks if a prepared
576
+ * statement for the corresponding SQL query string already exists in the cache.
577
+ * If it does, the cached statement is used. If not, a new prepared statement is
578
+ * created, executed, and then stored in the cache for future use. This mechanism
579
+ * helps to avoid the overhead of repeatedly parsing and preparing the same SQL
580
+ * statements.
581
+ *
582
+ * Tagged statements bind the placeholder values from the template literal as
583
+ * parameters to the underlying prepared statement. For example:
584
+ *
585
+ * ```js
586
+ * sqlTagStore.get`SELECT ${value}`;
587
+ * ```
588
+ *
589
+ * is equivalent to:
590
+ *
591
+ * ```js
592
+ * db.prepare('SELECT ?').get(value);
593
+ * ```
594
+ *
595
+ * However, in the first example, the tag store will cache the underlying prepared
596
+ * statement for future use.
597
+ *
598
+ * > **Note:** The `${value}` syntax in tagged statements _binds_ a parameter to
599
+ * > the prepared statement. This differs from its behavior in _untagged_ template
600
+ * > literals, where it performs string interpolation.
601
+ * >
602
+ * > ```js
603
+ * > // This a safe example of binding a parameter to a tagged statement.
604
+ * > sqlTagStore.run`INSERT INTO t1 (id) VALUES (${id})`;
605
+ * >
606
+ * > // This is an *unsafe* example of an untagged template string.
607
+ * > // `id` is interpolated into the query text as a string.
608
+ * > // This can lead to SQL injection and data corruption.
609
+ * > db.run(`INSERT INTO t1 (id) VALUES (${id})`);
610
+ * > ```
611
+ *
612
+ * The tag store will match a statement from the cache if the query strings
613
+ * (including the positions of any bound placeholders) are identical.
614
+ *
615
+ * ```js
616
+ * // The following statements will match in the cache:
617
+ * sqlTagStore.get`SELECT * FROM t1 WHERE id = ${id} AND active = 1`;
618
+ * sqlTagStore.get`SELECT * FROM t1 WHERE id = ${12345} AND active = 1`;
619
+ *
620
+ * // The following statements will not match, as the query strings
621
+ * // and bound placeholders differ:
622
+ * sqlTagStore.get`SELECT * FROM t1 WHERE id = ${id} AND active = 1`;
623
+ * sqlTagStore.get`SELECT * FROM t1 WHERE id = 12345 AND active = 1`;
624
+ *
625
+ * // The following statements will not match, as matches are case-sensitive:
626
+ * sqlTagStore.get`SELECT * FROM t1 WHERE id = ${id} AND active = 1`;
627
+ * sqlTagStore.get`select * from t1 where id = ${id} and active = 1`;
628
+ * ```
629
+ *
630
+ * The only way of binding parameters in tagged statements is with the `${value}`
631
+ * syntax. Do not add parameter binding placeholders (`?` etc.) to the SQL query
632
+ * string itself.
633
+ *
634
+ * ```js
635
+ * import { DatabaseSync } from 'node:sqlite';
636
+ *
637
+ * const db = new DatabaseSync(':memory:');
638
+ * const sql = db.createTagStore();
639
+ *
640
+ * db.exec('CREATE TABLE users (id INT, name TEXT)');
641
+ *
642
+ * // Using the 'run' method to insert data.
643
+ * // The tagged literal is used to identify the prepared statement.
644
+ * sql.run`INSERT INTO users VALUES (1, 'Alice')`;
645
+ * sql.run`INSERT INTO users VALUES (2, 'Bob')`;
646
+ *
647
+ * // Using the 'get' method to retrieve a single row.
648
+ * const name = 'Alice';
649
+ * const user = sql.get`SELECT * FROM users WHERE name = ${name}`;
650
+ * console.log(user); // { id: 1, name: 'Alice' }
651
+ *
652
+ * // Using the 'all' method to retrieve all rows.
653
+ * const allUsers = sql.all`SELECT * FROM users ORDER BY id`;
654
+ * console.log(allUsers);
655
+ * // [
656
+ * // { id: 1, name: 'Alice' },
657
+ * // { id: 2, name: 'Bob' }
658
+ * // ]
659
+ * ```
660
+ * @since v24.9.0
661
+ * @param maxSize The maximum number of prepared statements to cache. **Default**: `1000`.
662
+ * @returns A new SQL tag store for caching prepared statements.
663
+ */
664
+ createTagStore(maxSize?: number): SQLTagStore;
665
+ /**
666
+ * Creates and attaches a session to the database. This method is a wrapper around
667
+ * [`sqlite3session_create()`](https://www.sqlite.org/session/sqlite3session_create.html) and
668
+ * [`sqlite3session_attach()`](https://www.sqlite.org/session/sqlite3session_attach.html).
669
+ * @param options The configuration options for the session.
670
+ * @returns A session handle.
671
+ * @since v22.12.0
672
+ */
673
+ createSession(options?: CreateSessionOptions): Session;
674
+ /**
675
+ * An exception is thrown if the database is not
676
+ * open. This method is a wrapper around
677
+ * [`sqlite3changeset_apply()`](https://www.sqlite.org/session/sqlite3changeset_apply.html).
678
+ *
679
+ * ```js
680
+ * import { DatabaseSync } from 'node:sqlite';
681
+ *
682
+ * const sourceDb = new DatabaseSync(':memory:');
683
+ * const targetDb = new DatabaseSync(':memory:');
684
+ *
685
+ * sourceDb.exec('CREATE TABLE data(key INTEGER PRIMARY KEY, value TEXT)');
686
+ * targetDb.exec('CREATE TABLE data(key INTEGER PRIMARY KEY, value TEXT)');
687
+ *
688
+ * const session = sourceDb.createSession();
689
+ *
690
+ * const insert = sourceDb.prepare('INSERT INTO data (key, value) VALUES (?, ?)');
691
+ * insert.run(1, 'hello');
692
+ * insert.run(2, 'world');
693
+ *
694
+ * const changeset = session.changeset();
695
+ * targetDb.applyChangeset(changeset);
696
+ * // Now that the changeset has been applied, targetDb contains the same data as sourceDb.
697
+ * ```
698
+ * @param changeset A binary changeset or patchset.
699
+ * @param options The configuration options for how the changes will be applied.
700
+ * @returns Whether the changeset was applied successfully without being aborted.
701
+ * @since v22.12.0
702
+ */
703
+ applyChangeset(changeset: Uint8Array, options?: ApplyChangesetOptions): boolean;
704
+ /**
705
+ * Closes the database connection. If the database connection is already closed
706
+ * then this is a no-op.
707
+ * @since v22.15.0
708
+ */
709
+ [Symbol.dispose](): void;
710
+ }
711
+ /**
712
+ * @since v22.12.0
713
+ */
714
+ interface Session {
715
+ /**
716
+ * Retrieves a changeset containing all changes since the changeset was created. Can be called multiple times.
717
+ * An exception is thrown if the database or the session is not open. This method is a wrapper around
718
+ * [`sqlite3session_changeset()`](https://www.sqlite.org/session/sqlite3session_changeset.html).
719
+ * @returns Binary changeset that can be applied to other databases.
720
+ * @since v22.12.0
721
+ */
722
+ changeset(): NodeJS.NonSharedUint8Array;
723
+ /**
724
+ * Similar to the method above, but generates a more compact patchset. See
725
+ * [Changesets and Patchsets](https://www.sqlite.org/sessionintro.html#changesets_and_patchsets)
726
+ * in the documentation of SQLite. An exception is thrown if the database or the session is not open. This method is a
727
+ * wrapper around
728
+ * [`sqlite3session_patchset()`](https://www.sqlite.org/session/sqlite3session_patchset.html).
729
+ * @returns Binary patchset that can be applied to other databases.
730
+ * @since v22.12.0
731
+ */
732
+ patchset(): NodeJS.NonSharedUint8Array;
733
+ /**
734
+ * Closes the session. An exception is thrown if the database or the session is not open. This method is a
735
+ * wrapper around
736
+ * [`sqlite3session_delete()`](https://www.sqlite.org/session/sqlite3session_delete.html).
737
+ */
738
+ close(): void;
739
+ /**
740
+ * Closes the session. If the session is already closed, does nothing.
741
+ * @since v24.9.0
742
+ */
743
+ [Symbol.dispose](): void;
744
+ }
745
+ /**
746
+ * This class represents a single LRU (Least Recently Used) cache for storing
747
+ * prepared statements.
748
+ *
749
+ * Instances of this class are created via the `database.createTagStore()`
750
+ * method, not by using a constructor. The store caches prepared statements based
751
+ * on the provided SQL query string. When the same query is seen again, the store
752
+ * retrieves the cached statement and safely applies the new values through
753
+ * parameter binding, thereby preventing attacks like SQL injection.
754
+ *
755
+ * The cache has a maxSize that defaults to 1000 statements, but a custom size can
756
+ * be provided (e.g., `database.createTagStore(100)`). All APIs exposed by this
757
+ * class execute synchronously.
758
+ * @since v24.9.0
759
+ */
760
+ interface SQLTagStore {
761
+ /**
762
+ * Executes the given SQL query and returns all resulting rows as an array of
763
+ * objects.
764
+ *
765
+ * This function is intended to be used as a template literal tag, not to be
766
+ * called directly.
767
+ * @since v24.9.0
768
+ * @param stringElements Template literal elements containing the SQL
769
+ * query.
770
+ * @param boundParameters Parameter values to be bound to placeholders in the template string.
771
+ * @returns An array of objects representing the rows returned by the query.
772
+ */
773
+ all(
774
+ stringElements: TemplateStringsArray,
775
+ ...boundParameters: SQLInputValue[]
776
+ ): Record<string, SQLOutputValue>[];
777
+ /**
778
+ * Executes the given SQL query and returns the first resulting row as an object.
779
+ *
780
+ * This function is intended to be used as a template literal tag, not to be
781
+ * called directly.
782
+ * @since v24.9.0
783
+ * @param stringElements Template literal elements containing the SQL
784
+ * query.
785
+ * @param boundParameters Parameter values to be bound to placeholders in the template string.
786
+ * @returns An object representing the first row returned by
787
+ * the query, or `undefined` if no rows are returned.
788
+ */
789
+ get(
790
+ stringElements: TemplateStringsArray,
791
+ ...boundParameters: SQLInputValue[]
792
+ ): Record<string, SQLOutputValue> | undefined;
793
+ /**
794
+ * Executes the given SQL query and returns an iterator over the resulting rows.
795
+ *
796
+ * This function is intended to be used as a template literal tag, not to be
797
+ * called directly.
798
+ * @since v24.9.0
799
+ * @param stringElements Template literal elements containing the SQL
800
+ * query.
801
+ * @param boundParameters Parameter values to be bound to placeholders in the template string.
802
+ * @returns An iterator that yields objects representing the rows returned by the query.
803
+ */
804
+ iterate(
805
+ stringElements: TemplateStringsArray,
806
+ ...boundParameters: SQLInputValue[]
807
+ ): NodeJS.Iterator<Record<string, SQLOutputValue>>;
808
+ /**
809
+ * Executes the given SQL query, which is expected to not return any rows (e.g., INSERT, UPDATE, DELETE).
810
+ *
811
+ * This function is intended to be used as a template literal tag, not to be
812
+ * called directly.
813
+ * @since v24.9.0
814
+ * @param stringElements Template literal elements containing the SQL
815
+ * query.
816
+ * @param boundParameters Parameter values to be bound to placeholders in the template string.
817
+ * @returns An object containing information about the execution, including `changes` and `lastInsertRowid`.
818
+ */
819
+ run(stringElements: TemplateStringsArray, ...boundParameters: SQLInputValue[]): StatementResultingChanges;
820
+ /**
821
+ * A read-only property that returns the number of prepared statements currently in the cache.
822
+ * @since v24.9.0
823
+ */
824
+ readonly size: number;
825
+ /**
826
+ * A read-only property that returns the maximum number of prepared statements the cache can hold.
827
+ * @since v24.9.0
828
+ */
829
+ readonly capacity: number;
830
+ /**
831
+ * A read-only property that returns the `DatabaseSync` object associated with this `SQLTagStore`.
832
+ * @since v24.9.0
833
+ */
834
+ readonly db: DatabaseSync;
835
+ /**
836
+ * Resets the LRU cache, clearing all stored prepared statements.
837
+ * @since v24.9.0
838
+ */
839
+ clear(): void;
840
+ }
841
+ interface StatementColumnMetadata {
842
+ /**
843
+ * The unaliased name of the column in the origin
844
+ * table, or `null` if the column is the result of an expression or subquery.
845
+ * This property is the result of [`sqlite3_column_origin_name()`](https://www.sqlite.org/c3ref/column_database_name.html).
846
+ */
847
+ column: string | null;
848
+ /**
849
+ * The unaliased name of the origin database, or
850
+ * `null` if the column is the result of an expression or subquery. This
851
+ * property is the result of [`sqlite3_column_database_name()`](https://www.sqlite.org/c3ref/column_database_name.html).
852
+ */
853
+ database: string | null;
854
+ /**
855
+ * The name assigned to the column in the result set of a
856
+ * `SELECT` statement. This property is the result of
857
+ * [`sqlite3_column_name()`](https://www.sqlite.org/c3ref/column_name.html).
858
+ */
859
+ name: string;
860
+ /**
861
+ * The unaliased name of the origin table, or `null` if
862
+ * the column is the result of an expression or subquery. This property is the
863
+ * result of [`sqlite3_column_table_name()`](https://www.sqlite.org/c3ref/column_database_name.html).
864
+ */
865
+ table: string | null;
866
+ /**
867
+ * The declared data type of the column, or `null` if the
868
+ * column is the result of an expression or subquery. This property is the
869
+ * result of [`sqlite3_column_decltype()`](https://www.sqlite.org/c3ref/column_decltype.html).
870
+ */
871
+ type: string | null;
872
+ }
873
+ interface StatementResultingChanges {
874
+ /**
875
+ * The number of rows modified, inserted, or deleted by the most recently completed `INSERT`, `UPDATE`, or `DELETE` statement.
876
+ * This field is either a number or a `BigInt` depending on the prepared statement's configuration.
877
+ * This property is the result of [`sqlite3_changes64()`](https://www.sqlite.org/c3ref/changes.html).
878
+ */
879
+ changes: number | bigint;
880
+ /**
881
+ * The most recently inserted rowid.
882
+ * This field is either a number or a `BigInt` depending on the prepared statement's configuration.
883
+ * This property is the result of [`sqlite3_last_insert_rowid()`](https://www.sqlite.org/c3ref/last_insert_rowid.html).
884
+ */
885
+ lastInsertRowid: number | bigint;
886
+ }
887
+ /**
888
+ * This class represents a single [prepared statement](https://www.sqlite.org/c3ref/stmt.html). This class cannot be
889
+ * instantiated via its constructor. Instead, instances are created via the`database.prepare()` method. All APIs exposed by this class execute
890
+ * synchronously.
891
+ *
892
+ * A prepared statement is an efficient binary representation of the SQL used to
893
+ * create it. Prepared statements are parameterizable, and can be invoked multiple
894
+ * times with different bound values. Parameters also offer protection against [SQL injection](https://en.wikipedia.org/wiki/SQL_injection) attacks. For these reasons, prepared statements are
895
+ * preferred
896
+ * over hand-crafted SQL strings when handling user input.
897
+ * @since v22.5.0
898
+ */
899
+ class StatementSync {
900
+ private constructor();
901
+ /**
902
+ * This method executes a prepared statement and returns all results as an array of
903
+ * objects. If the prepared statement does not return any results, this method
904
+ * returns an empty array. The prepared statement [parameters are bound](https://www.sqlite.org/c3ref/bind_blob.html) using
905
+ * the values in `namedParameters` and `anonymousParameters`.
906
+ * @since v22.5.0
907
+ * @param namedParameters An optional object used to bind named parameters. The keys of this object are used to configure the mapping.
908
+ * @param anonymousParameters Zero or more values to bind to anonymous parameters.
909
+ * @return An array of objects. Each object corresponds to a row returned by executing the prepared statement. The keys and values of each object correspond to the column names and values of
910
+ * the row.
911
+ */
912
+ all(...anonymousParameters: SQLInputValue[]): Record<string, SQLOutputValue>[];
913
+ all(
914
+ namedParameters: Record<string, SQLInputValue>,
915
+ ...anonymousParameters: SQLInputValue[]
916
+ ): Record<string, SQLOutputValue>[];
917
+ /**
918
+ * This method is used to retrieve information about the columns returned by the
919
+ * prepared statement.
920
+ * @since v23.11.0
921
+ * @returns An array of objects. Each object corresponds to a column
922
+ * in the prepared statement, and contains the following properties:
923
+ */
924
+ columns(): StatementColumnMetadata[];
925
+ /**
926
+ * The source SQL text of the prepared statement with parameter
927
+ * placeholders replaced by the values that were used during the most recent
928
+ * execution of this prepared statement. This property is a wrapper around
929
+ * [`sqlite3_expanded_sql()`](https://www.sqlite.org/c3ref/expanded_sql.html).
930
+ * @since v22.5.0
931
+ */
932
+ readonly expandedSQL: string;
933
+ /**
934
+ * This method executes a prepared statement and returns the first result as an
935
+ * object. If the prepared statement does not return any results, this method
936
+ * returns `undefined`. The prepared statement [parameters are bound](https://www.sqlite.org/c3ref/bind_blob.html) using the
937
+ * values in `namedParameters` and `anonymousParameters`.
938
+ * @since v22.5.0
939
+ * @param namedParameters An optional object used to bind named parameters. The keys of this object are used to configure the mapping.
940
+ * @param anonymousParameters Zero or more values to bind to anonymous parameters.
941
+ * @return An object corresponding to the first row returned by executing the prepared statement. The keys and values of the object correspond to the column names and values of the row. If no
942
+ * rows were returned from the database then this method returns `undefined`.
943
+ */
944
+ get(...anonymousParameters: SQLInputValue[]): Record<string, SQLOutputValue> | undefined;
945
+ get(
946
+ namedParameters: Record<string, SQLInputValue>,
947
+ ...anonymousParameters: SQLInputValue[]
948
+ ): Record<string, SQLOutputValue> | undefined;
949
+ /**
950
+ * This method executes a prepared statement and returns an iterator of
951
+ * objects. If the prepared statement does not return any results, this method
952
+ * returns an empty iterator. The prepared statement [parameters are bound](https://www.sqlite.org/c3ref/bind_blob.html) using
953
+ * the values in `namedParameters` and `anonymousParameters`.
954
+ * @since v22.13.0
955
+ * @param namedParameters An optional object used to bind named parameters.
956
+ * The keys of this object are used to configure the mapping.
957
+ * @param anonymousParameters Zero or more values to bind to anonymous parameters.
958
+ * @returns An iterable iterator of objects. Each object corresponds to a row
959
+ * returned by executing the prepared statement. The keys and values of each
960
+ * object correspond to the column names and values of the row.
961
+ */
962
+ iterate(...anonymousParameters: SQLInputValue[]): NodeJS.Iterator<Record<string, SQLOutputValue>>;
963
+ iterate(
964
+ namedParameters: Record<string, SQLInputValue>,
965
+ ...anonymousParameters: SQLInputValue[]
966
+ ): NodeJS.Iterator<Record<string, SQLOutputValue>>;
967
+ /**
968
+ * This method executes a prepared statement and returns an object summarizing the
969
+ * resulting changes. The prepared statement [parameters are bound](https://www.sqlite.org/c3ref/bind_blob.html) using the
970
+ * values in `namedParameters` and `anonymousParameters`.
971
+ * @since v22.5.0
972
+ * @param namedParameters An optional object used to bind named parameters. The keys of this object are used to configure the mapping.
973
+ * @param anonymousParameters Zero or more values to bind to anonymous parameters.
974
+ */
975
+ run(...anonymousParameters: SQLInputValue[]): StatementResultingChanges;
976
+ run(
977
+ namedParameters: Record<string, SQLInputValue>,
978
+ ...anonymousParameters: SQLInputValue[]
979
+ ): StatementResultingChanges;
980
+ /**
981
+ * The names of SQLite parameters begin with a prefix character. By default,`node:sqlite` requires that this prefix character is present when binding
982
+ * parameters. However, with the exception of dollar sign character, these
983
+ * prefix characters also require extra quoting when used in object keys.
984
+ *
985
+ * To improve ergonomics, this method can be used to also allow bare named
986
+ * parameters, which do not require the prefix character in JavaScript code. There
987
+ * are several caveats to be aware of when enabling bare named parameters:
988
+ *
989
+ * * The prefix character is still required in SQL.
990
+ * * The prefix character is still allowed in JavaScript. In fact, prefixed names
991
+ * will have slightly better binding performance.
992
+ * * Using ambiguous named parameters, such as `$k` and `@k`, in the same prepared
993
+ * statement will result in an exception as it cannot be determined how to bind
994
+ * a bare name.
995
+ * @since v22.5.0
996
+ * @param enabled Enables or disables support for binding named parameters without the prefix character.
997
+ */
998
+ setAllowBareNamedParameters(enabled: boolean): void;
999
+ /**
1000
+ * By default, if an unknown name is encountered while binding parameters, an
1001
+ * exception is thrown. This method allows unknown named parameters to be ignored.
1002
+ * @since v22.15.0
1003
+ * @param enabled Enables or disables support for unknown named parameters.
1004
+ */
1005
+ setAllowUnknownNamedParameters(enabled: boolean): void;
1006
+ /**
1007
+ * When enabled, query results returned by the `all()`, `get()`, and `iterate()` methods will be returned as arrays instead
1008
+ * of objects.
1009
+ * @since v24.0.0
1010
+ * @param enabled Enables or disables the return of query results as arrays.
1011
+ */
1012
+ setReturnArrays(enabled: boolean): void;
1013
+ /**
1014
+ * When reading from the database, SQLite `INTEGER`s are mapped to JavaScript
1015
+ * numbers by default. However, SQLite `INTEGER`s can store values larger than
1016
+ * JavaScript numbers are capable of representing. In such cases, this method can
1017
+ * be used to read `INTEGER` data using JavaScript `BigInt`s. This method has no
1018
+ * impact on database write operations where numbers and `BigInt`s are both
1019
+ * supported at all times.
1020
+ * @since v22.5.0
1021
+ * @param enabled Enables or disables the use of `BigInt`s when reading `INTEGER` fields from the database.
1022
+ */
1023
+ setReadBigInts(enabled: boolean): void;
1024
+ /**
1025
+ * The source SQL text of the prepared statement. This property is a
1026
+ * wrapper around [`sqlite3_sql()`](https://www.sqlite.org/c3ref/expanded_sql.html).
1027
+ * @since v22.5.0
1028
+ */
1029
+ readonly sourceSQL: string;
1030
+ }
1031
+ interface BackupOptions {
1032
+ /**
1033
+ * Name of the source database. This can be `'main'` (the default primary database) or any other
1034
+ * database that have been added with [`ATTACH DATABASE`](https://www.sqlite.org/lang_attach.html)
1035
+ * @default 'main'
1036
+ */
1037
+ source?: string | undefined;
1038
+ /**
1039
+ * Name of the target database. This can be `'main'` (the default primary database) or any other
1040
+ * database that have been added with [`ATTACH DATABASE`](https://www.sqlite.org/lang_attach.html)
1041
+ * @default 'main'
1042
+ */
1043
+ target?: string | undefined;
1044
+ /**
1045
+ * Number of pages to be transmitted in each batch of the backup.
1046
+ * @default 100
1047
+ */
1048
+ rate?: number | undefined;
1049
+ /**
1050
+ * An optional callback function that will be called after each backup step. The argument passed
1051
+ * to this callback is an `Object` with `remainingPages` and `totalPages` properties, describing the current progress
1052
+ * of the backup operation.
1053
+ */
1054
+ progress?: ((progressInfo: BackupProgressInfo) => void) | undefined;
1055
+ }
1056
+ interface BackupProgressInfo {
1057
+ totalPages: number;
1058
+ remainingPages: number;
1059
+ }
1060
+ /**
1061
+ * This method makes a database backup. This method abstracts the
1062
+ * [`sqlite3_backup_init()`](https://www.sqlite.org/c3ref/backup_finish.html#sqlite3backupinit),
1063
+ * [`sqlite3_backup_step()`](https://www.sqlite.org/c3ref/backup_finish.html#sqlite3backupstep)
1064
+ * and [`sqlite3_backup_finish()`](https://www.sqlite.org/c3ref/backup_finish.html#sqlite3backupfinish) functions.
1065
+ *
1066
+ * The backed-up database can be used normally during the backup process. Mutations coming from the same connection - same
1067
+ * `DatabaseSync` - object will be reflected in the backup right away. However, mutations from other connections will cause
1068
+ * the backup process to restart.
1069
+ *
1070
+ * ```js
1071
+ * import { backup, DatabaseSync } from 'node:sqlite';
1072
+ *
1073
+ * const sourceDb = new DatabaseSync('source.db');
1074
+ * const totalPagesTransferred = await backup(sourceDb, 'backup.db', {
1075
+ * rate: 1, // Copy one page at a time.
1076
+ * progress: ({ totalPages, remainingPages }) => {
1077
+ * console.log('Backup in progress', { totalPages, remainingPages });
1078
+ * },
1079
+ * });
1080
+ *
1081
+ * console.log('Backup completed', totalPagesTransferred);
1082
+ * ```
1083
+ * @since v23.8.0
1084
+ * @param sourceDb The database to backup. The source database must be open.
1085
+ * @param path The path where the backup will be created. If the file already exists,
1086
+ * the contents will be overwritten.
1087
+ * @param options Optional configuration for the backup. The
1088
+ * following properties are supported:
1089
+ * @returns A promise that fulfills with the total number of backed-up pages upon completion, or rejects if an
1090
+ * error occurs.
1091
+ */
1092
+ function backup(sourceDb: DatabaseSync, path: PathLike, options?: BackupOptions): Promise<number>;
1093
+ /**
1094
+ * @since v22.13.0
1095
+ */
1096
+ namespace constants {
1097
+ /**
1098
+ * The conflict handler is invoked with this constant when processing a DELETE or UPDATE change if a row with the required PRIMARY KEY fields is present in the database, but one or more other (non primary-key) fields modified by the update do not contain the expected "before" values.
1099
+ * @since v22.14.0
1100
+ */
1101
+ const SQLITE_CHANGESET_DATA: number;
1102
+ /**
1103
+ * The conflict handler is invoked with this constant when processing a DELETE or UPDATE change if a row with the required PRIMARY KEY fields is not present in the database.
1104
+ * @since v22.14.0
1105
+ */
1106
+ const SQLITE_CHANGESET_NOTFOUND: number;
1107
+ /**
1108
+ * This constant is passed to the conflict handler while processing an INSERT change if the operation would result in duplicate primary key values.
1109
+ * @since v22.14.0
1110
+ */
1111
+ const SQLITE_CHANGESET_CONFLICT: number;
1112
+ /**
1113
+ * If foreign key handling is enabled, and applying a changeset leaves the database in a state containing foreign key violations, the conflict handler is invoked with this constant exactly once before the changeset is committed. If the conflict handler returns `SQLITE_CHANGESET_OMIT`, the changes, including those that caused the foreign key constraint violation, are committed. Or, if it returns `SQLITE_CHANGESET_ABORT`, the changeset is rolled back.
1114
+ * @since v22.14.0
1115
+ */
1116
+ const SQLITE_CHANGESET_FOREIGN_KEY: number;
1117
+ /**
1118
+ * Conflicting changes are omitted.
1119
+ * @since v22.12.0
1120
+ */
1121
+ const SQLITE_CHANGESET_OMIT: number;
1122
+ /**
1123
+ * Conflicting changes replace existing values. Note that this value can only be returned when the type of conflict is either `SQLITE_CHANGESET_DATA` or `SQLITE_CHANGESET_CONFLICT`.
1124
+ * @since v22.12.0
1125
+ */
1126
+ const SQLITE_CHANGESET_REPLACE: number;
1127
+ /**
1128
+ * Abort when a change encounters a conflict and roll back database.
1129
+ * @since v22.12.0
1130
+ */
1131
+ const SQLITE_CHANGESET_ABORT: number;
1132
+ /**
1133
+ * Deny the operation and cause an error to be returned.
1134
+ * @since v24.10.0
1135
+ */
1136
+ const SQLITE_DENY: number;
1137
+ /**
1138
+ * Ignore the operation and continue as if it had never been requested.
1139
+ * @since 24.10.0
1140
+ */
1141
+ const SQLITE_IGNORE: number;
1142
+ /**
1143
+ * Allow the operation to proceed normally.
1144
+ * @since v24.10.0
1145
+ */
1146
+ const SQLITE_OK: number;
1147
+ const SQLITE_CREATE_INDEX: number;
1148
+ const SQLITE_CREATE_TABLE: number;
1149
+ const SQLITE_CREATE_TEMP_INDEX: number;
1150
+ const SQLITE_CREATE_TEMP_TABLE: number;
1151
+ const SQLITE_CREATE_TEMP_TRIGGER: number;
1152
+ const SQLITE_CREATE_TEMP_VIEW: number;
1153
+ const SQLITE_CREATE_TRIGGER: number;
1154
+ const SQLITE_CREATE_VIEW: number;
1155
+ const SQLITE_DELETE: number;
1156
+ const SQLITE_DROP_INDEX: number;
1157
+ const SQLITE_DROP_TABLE: number;
1158
+ const SQLITE_DROP_TEMP_INDEX: number;
1159
+ const SQLITE_DROP_TEMP_TABLE: number;
1160
+ const SQLITE_DROP_TEMP_TRIGGER: number;
1161
+ const SQLITE_DROP_TEMP_VIEW: number;
1162
+ const SQLITE_DROP_TRIGGER: number;
1163
+ const SQLITE_DROP_VIEW: number;
1164
+ const SQLITE_INSERT: number;
1165
+ const SQLITE_PRAGMA: number;
1166
+ const SQLITE_READ: number;
1167
+ const SQLITE_SELECT: number;
1168
+ const SQLITE_TRANSACTION: number;
1169
+ const SQLITE_UPDATE: number;
1170
+ const SQLITE_ATTACH: number;
1171
+ const SQLITE_DETACH: number;
1172
+ const SQLITE_ALTER_TABLE: number;
1173
+ const SQLITE_REINDEX: number;
1174
+ const SQLITE_ANALYZE: number;
1175
+ const SQLITE_CREATE_VTABLE: number;
1176
+ const SQLITE_DROP_VTABLE: number;
1177
+ const SQLITE_FUNCTION: number;
1178
+ const SQLITE_SAVEPOINT: number;
1179
+ const SQLITE_COPY: number;
1180
+ const SQLITE_RECURSIVE: number;
1181
+ }
1182
+ }