@encore.dev/sdk 2.0.0-beta.15 → 2.0.0-beta.17

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 (235) hide show
  1. package/README.md +111 -101
  2. package/app_meta.ts +56 -54
  3. package/config/config.ts +60 -57
  4. package/config/secrets.ts +45 -52
  5. package/config/value.ts +23 -26
  6. package/cron/mod.ts +28 -29
  7. package/dist/app_meta.d.ts +52 -50
  8. package/dist/app_meta.d.ts.map +1 -1
  9. package/dist/app_meta.js +2 -2
  10. package/dist/app_meta.js.map +1 -1
  11. package/dist/config/config.d.ts +58 -55
  12. package/dist/config/config.d.ts.map +1 -1
  13. package/dist/config/config.js +8 -9
  14. package/dist/config/config.js.map +1 -1
  15. package/dist/config/secrets.d.ts +45 -52
  16. package/dist/config/secrets.d.ts.map +1 -1
  17. package/dist/config/secrets.js +8 -9
  18. package/dist/config/secrets.js.map +1 -1
  19. package/dist/config/value.d.ts +20 -23
  20. package/dist/config/value.d.ts.map +1 -1
  21. package/dist/config/value.js +20 -23
  22. package/dist/config/value.js.map +1 -1
  23. package/dist/cron/mod.d.ts +26 -27
  24. package/dist/cron/mod.d.ts.map +1 -1
  25. package/dist/cron/mod.js +13 -14
  26. package/dist/cron/mod.js.map +1 -1
  27. package/dist/frontends/mod.d.ts +20 -19
  28. package/dist/frontends/mod.d.ts.map +1 -1
  29. package/dist/frontends/mod.js +20 -19
  30. package/dist/frontends/mod.js.map +1 -1
  31. package/dist/gateway/errors.d.ts +28 -30
  32. package/dist/gateway/errors.d.ts.map +1 -1
  33. package/dist/gateway/errors.js +29 -31
  34. package/dist/gateway/errors.js.map +1 -1
  35. package/dist/gateway/match.d.ts +54 -54
  36. package/dist/gateway/match.d.ts.map +1 -1
  37. package/dist/gateway/match.js +56 -56
  38. package/dist/gateway/match.js.map +1 -1
  39. package/dist/gateway/middleware.d.ts +62 -64
  40. package/dist/gateway/middleware.d.ts.map +1 -1
  41. package/dist/gateway/middleware.js +1 -1
  42. package/dist/gateway/middleware.js.map +1 -1
  43. package/dist/gateway/mod.d.ts +64 -67
  44. package/dist/gateway/mod.d.ts.map +1 -1
  45. package/dist/gateway/mod.js +72 -76
  46. package/dist/gateway/mod.js.map +1 -1
  47. package/dist/gateway/request.d.ts +138 -134
  48. package/dist/gateway/request.d.ts.map +1 -1
  49. package/dist/gateway/request.js +117 -108
  50. package/dist/gateway/request.js.map +1 -1
  51. package/dist/gateway/serve.d.ts +29 -34
  52. package/dist/gateway/serve.d.ts.map +1 -1
  53. package/dist/gateway/serve.js +51 -56
  54. package/dist/gateway/serve.js.map +1 -1
  55. package/dist/gateways/mod.d.ts +23 -21
  56. package/dist/gateways/mod.d.ts.map +1 -1
  57. package/dist/gateways/mod.js +25 -23
  58. package/dist/gateways/mod.js.map +1 -1
  59. package/dist/internal/runtime/napi/napi.cjs +1 -1
  60. package/dist/internal/runtime/napi/napi.d.cts +10 -3
  61. package/dist/internal/runtime/shutdown.d.ts +75 -57
  62. package/dist/internal/runtime/shutdown.d.ts.map +1 -1
  63. package/dist/internal/runtime/shutdown.js +88 -84
  64. package/dist/internal/runtime/shutdown.js.map +1 -1
  65. package/dist/log/logger.d.ts +43 -37
  66. package/dist/log/logger.d.ts.map +1 -1
  67. package/dist/log/logger.js +26 -25
  68. package/dist/log/logger.js.map +1 -1
  69. package/dist/metrics/mod.d.ts +133 -114
  70. package/dist/metrics/mod.d.ts.map +1 -1
  71. package/dist/metrics/mod.js +109 -101
  72. package/dist/metrics/mod.js.map +1 -1
  73. package/dist/otel.d.ts +6 -3
  74. package/dist/otel.d.ts.map +1 -1
  75. package/dist/otel.js +6 -3
  76. package/dist/otel.js.map +1 -1
  77. package/dist/pubsub/subscription.d.ts +88 -116
  78. package/dist/pubsub/subscription.d.ts.map +1 -1
  79. package/dist/pubsub/subscription.js +14 -17
  80. package/dist/pubsub/subscription.js.map +1 -1
  81. package/dist/pubsub/topic.d.ts +86 -113
  82. package/dist/pubsub/topic.d.ts.map +1 -1
  83. package/dist/pubsub/topic.js +68 -82
  84. package/dist/pubsub/topic.js.map +1 -1
  85. package/dist/reqctx/mod.d.ts +83 -86
  86. package/dist/reqctx/mod.d.ts.map +1 -1
  87. package/dist/reqctx/mod.js +39 -41
  88. package/dist/reqctx/mod.js.map +1 -1
  89. package/dist/services/index.d.ts +76 -75
  90. package/dist/services/index.d.ts.map +1 -1
  91. package/dist/services/index.js +73 -71
  92. package/dist/services/index.js.map +1 -1
  93. package/dist/shutdown/mod.d.ts +26 -25
  94. package/dist/shutdown/mod.d.ts.map +1 -1
  95. package/dist/shutdown/mod.js +26 -25
  96. package/dist/shutdown/mod.js.map +1 -1
  97. package/dist/storage/clickhouse/database.d.ts +113 -115
  98. package/dist/storage/clickhouse/database.d.ts.map +1 -1
  99. package/dist/storage/clickhouse/database.js +65 -79
  100. package/dist/storage/clickhouse/database.js.map +1 -1
  101. package/dist/storage/clickhouse/errors.d.ts +25 -26
  102. package/dist/storage/clickhouse/errors.d.ts.map +1 -1
  103. package/dist/storage/clickhouse/errors.js +15 -17
  104. package/dist/storage/clickhouse/errors.js.map +1 -1
  105. package/dist/storage/clickhouse/mod.d.ts +10 -10
  106. package/dist/storage/clickhouse/mod.js +10 -10
  107. package/dist/storage/objects/bucket.d.ts +196 -225
  108. package/dist/storage/objects/bucket.d.ts.map +1 -1
  109. package/dist/storage/objects/bucket.js +71 -84
  110. package/dist/storage/objects/bucket.js.map +1 -1
  111. package/dist/storage/objects/error.d.ts +4 -4
  112. package/dist/storage/objects/error.js +4 -4
  113. package/dist/storage/postgres/database.d.ts +124 -149
  114. package/dist/storage/postgres/database.d.ts.map +1 -1
  115. package/dist/storage/postgres/database.js +98 -135
  116. package/dist/storage/postgres/database.js.map +1 -1
  117. package/dist/storage/postgres/errors.d.ts +42 -48
  118. package/dist/storage/postgres/errors.d.ts.map +1 -1
  119. package/dist/storage/postgres/errors.js +44 -51
  120. package/dist/storage/postgres/errors.js.map +1 -1
  121. package/dist/storage/postgres/interval.d.ts +19 -19
  122. package/dist/storage/postgres/interval.d.ts.map +1 -1
  123. package/dist/storage/postgres/interval.js +21 -21
  124. package/dist/storage/postgres/interval.js.map +1 -1
  125. package/dist/storage/redis/bitfield.d.ts +48 -23
  126. package/dist/storage/redis/bitfield.d.ts.map +1 -1
  127. package/dist/storage/redis/bitfield.js +38 -19
  128. package/dist/storage/redis/bitfield.js.map +1 -1
  129. package/dist/storage/redis/command.d.ts +16 -12
  130. package/dist/storage/redis/command.d.ts.map +1 -1
  131. package/dist/storage/redis/command.js +16 -12
  132. package/dist/storage/redis/command.js.map +1 -1
  133. package/dist/storage/redis/commands.d.ts +99 -100
  134. package/dist/storage/redis/commands.d.ts.map +1 -1
  135. package/dist/storage/redis/commands.js +84 -85
  136. package/dist/storage/redis/commands.js.map +1 -1
  137. package/dist/storage/redis/database.d.ts +138 -122
  138. package/dist/storage/redis/database.d.ts.map +1 -1
  139. package/dist/storage/redis/database.js +120 -101
  140. package/dist/storage/redis/database.js.map +1 -1
  141. package/dist/storage/redis/mod.d.ts +52 -48
  142. package/dist/storage/redis/mod.d.ts.map +1 -1
  143. package/dist/storage/redis/mod.js +52 -48
  144. package/dist/storage/redis/mod.js.map +1 -1
  145. package/dist/storage/redis/options.d.ts +26 -24
  146. package/dist/storage/redis/options.d.ts.map +1 -1
  147. package/dist/storage/redis/options.js.map +1 -1
  148. package/dist/storage/redis/pubsub.d.ts +16 -16
  149. package/dist/storage/redis/pubsub.d.ts.map +1 -1
  150. package/dist/storage/redis/pubsub.js +14 -14
  151. package/dist/storage/redis/pubsub.js.map +1 -1
  152. package/dist/storage/redis/reply.d.ts +80 -72
  153. package/dist/storage/redis/reply.d.ts.map +1 -1
  154. package/dist/storage/redis/reply.js +53 -46
  155. package/dist/storage/redis/reply.js.map +1 -1
  156. package/dist/storage/redis/scan.d.ts +4 -4
  157. package/dist/storage/redis/scan.d.ts.map +1 -1
  158. package/dist/storage/redis/scan.js +6 -6
  159. package/dist/storage/redis/scan.js.map +1 -1
  160. package/dist/storage/redis/script.d.ts +28 -21
  161. package/dist/storage/redis/script.d.ts.map +1 -1
  162. package/dist/storage/redis/script.js +29 -22
  163. package/dist/storage/redis/script.js.map +1 -1
  164. package/dist/storage/redis/target.d.ts +17 -1
  165. package/dist/storage/redis/target.d.ts.map +1 -1
  166. package/dist/storage/redis/target.js +30 -1
  167. package/dist/storage/redis/target.js.map +1 -1
  168. package/dist/storage/redis/wire.d.ts +6 -6
  169. package/dist/storage/redis/wire.d.ts.map +1 -1
  170. package/dist/storage/redis/wire.js +6 -6
  171. package/dist/storage/redis/wire.js.map +1 -1
  172. package/dist/testing/mod.d.ts +83 -88
  173. package/dist/testing/mod.d.ts.map +1 -1
  174. package/dist/testing/mod.js +75 -81
  175. package/dist/testing/mod.js.map +1 -1
  176. package/dist/testing/playwright.d.ts +28 -32
  177. package/dist/testing/playwright.d.ts.map +1 -1
  178. package/dist/testing/playwright.js +22 -27
  179. package/dist/testing/playwright.js.map +1 -1
  180. package/dist/testing/puppeteer.d.ts +11 -12
  181. package/dist/testing/puppeteer.d.ts.map +1 -1
  182. package/dist/testing/puppeteer.js +17 -18
  183. package/dist/testing/puppeteer.js.map +1 -1
  184. package/dist/testing/system.d.ts +72 -90
  185. package/dist/testing/system.d.ts.map +1 -1
  186. package/dist/testing/system.js +90 -107
  187. package/dist/testing/system.js.map +1 -1
  188. package/dist/tsconfig.build.tsbuildinfo +1 -1
  189. package/frontends/mod.test.ts +6 -2
  190. package/frontends/mod.ts +20 -19
  191. package/gateway/errors.ts +30 -32
  192. package/gateway/match.ts +61 -57
  193. package/gateway/middleware.ts +62 -64
  194. package/gateway/mod.ts +73 -76
  195. package/gateway/request.ts +143 -140
  196. package/gateway/serve.ts +58 -63
  197. package/gateways/mod.ts +25 -23
  198. package/internal/runtime/napi/napi.cjs +1 -1
  199. package/internal/runtime/napi/napi.d.cts +10 -3
  200. package/internal/runtime/shutdown.ts +113 -101
  201. package/log/logger.test.ts +8 -0
  202. package/log/logger.ts +48 -45
  203. package/metrics/mod.ts +138 -122
  204. package/otel.ts +6 -3
  205. package/package.json +1 -1
  206. package/pubsub/subscription.ts +93 -123
  207. package/pubsub/topic.ts +96 -130
  208. package/reqctx/mod.ts +83 -86
  209. package/services/index.ts +78 -78
  210. package/shutdown/mod.ts +26 -25
  211. package/storage/clickhouse/database.ts +115 -129
  212. package/storage/clickhouse/errors.ts +27 -29
  213. package/storage/clickhouse/mod.ts +10 -10
  214. package/storage/objects/bucket.ts +209 -239
  215. package/storage/objects/error.ts +4 -4
  216. package/storage/postgres/database.ts +131 -164
  217. package/storage/postgres/errors.ts +45 -52
  218. package/storage/postgres/interval.ts +21 -21
  219. package/storage/redis/bitfield.ts +51 -26
  220. package/storage/redis/command.ts +16 -12
  221. package/storage/redis/commands.ts +99 -100
  222. package/storage/redis/database.ts +145 -123
  223. package/storage/redis/mod.ts +52 -48
  224. package/storage/redis/options.ts +26 -24
  225. package/storage/redis/pubsub.ts +14 -14
  226. package/storage/redis/redis.test.ts +17 -2
  227. package/storage/redis/reply.ts +85 -77
  228. package/storage/redis/scan.ts +6 -6
  229. package/storage/redis/script.ts +29 -22
  230. package/storage/redis/target.ts +34 -1
  231. package/storage/redis/wire.ts +8 -8
  232. package/testing/mod.ts +99 -105
  233. package/testing/playwright.ts +32 -37
  234. package/testing/puppeteer.ts +22 -23
  235. package/testing/system.ts +117 -133
@@ -1,14 +1,15 @@
1
1
  /**
2
- * Graceful shutdown on SIGTERM or SIGINT.
2
+ * Graceful shutdown on `SIGTERM` or `SIGINT`.
3
3
  *
4
- * On the signal Encore stops Pub/Sub intake, waits for in-flight message
5
- * handlers and for the app's own work, closes its resources, flushes metrics
6
- * and telemetry, and exits: with `process.exitCode` (0 unless the app set it)
7
- * when this finished within the shutdown deadline, else 1. A second SIGINT,
8
- * a second Ctrl-C, stops waiting for the app.
4
+ * When a shutdown signal arrives, Encore stops accepting new Pub/Sub messages,
5
+ * waits for in-flight message handlers and application work to finish, closes
6
+ * managed resources, flushes metrics and telemetry, and exits. If cleanup
7
+ * finishes within the shutdown deadline, the process exits with
8
+ * `process.exitCode` (0 unless set by the application); otherwise it exits
9
+ * with 1. A second `SIGINT` (Ctrl-C) skips waiting for application work and
10
+ * forces immediate cleanup.
9
11
  *
10
- * The app tells Encore what to wait for. A server drains its requests in an
11
- * {@link onShutdown} callback:
12
+ * Use {@link onShutdown} to drain servers or close frameworks cleanly:
12
13
  *
13
14
  * ```typescript
14
15
  * import { onShutdown } from "@encore.dev/sdk/shutdown";
@@ -17,17 +18,17 @@
17
18
  * onShutdown(() => new Promise((resolve) => server.close(() => resolve())));
18
19
  * ```
19
20
  *
20
- * A framework that runs shutdown hooks of its own closes in one, rather than
21
- * on a signal listener of its own; with NestJS, instead of
22
- * `enableShutdownHooks()`:
21
+ * If your framework has its own shutdown hooks, invoke them inside
22
+ * `onShutdown` instead of registering separate signal handlers. For example,
23
+ * with NestJS (instead of `enableShutdownHooks()`):
23
24
  *
24
25
  * ```typescript
25
26
  * onShutdown(() => app.close());
26
27
  * ```
27
28
  *
28
- * Work that isn't a callback holds the shutdown back with {@link hold}, or
29
- * {@link waitUntil} for a promise. `using` releases a hold at the end of its
30
- * scope, a job's for example:
29
+ * For in-flight background work that isn't a shutdown callback, delay cleanup
30
+ * with {@link hold} or {@link waitUntil}. With `using`, a hold is released
31
+ * automatically when the block exits:
31
32
  *
32
33
  * ```typescript
33
34
  * import * as shutdown from "@encore.dev/sdk/shutdown";
@@ -38,19 +39,19 @@
38
39
  * }
39
40
  * ```
40
41
  *
41
- * Encore cleans up once every hold is released, or the shutdown deadline
42
- * passes, whichever comes first. {@link signal} aborts when the shutdown
43
- * begins; a callback's own signal aborts when cleanup does.
42
+ * Encore begins resource cleanup once all holds are released or the shutdown
43
+ * deadline expires, whichever comes first. {@link signal} aborts when shutdown
44
+ * starts; each callback's `ctx.signal` aborts when cleanup starts.
44
45
  *
45
- * An app that listens for the signal itself and holds nothing, as NestJS's
46
- * `enableShutdownHooks()` does, is waited for: Encore stops taking work at
47
- * once and cleans up once the app raises the signal again, exits, or has
48
- * closed everything it had open. The process then ends as the app meant it
49
- * to, with its own exit code, unless the shutdown deadline passed first:
50
- * then the exit code is 1.
46
+ * If an application registers its own signal listener without using Encore's
47
+ * shutdown APIs (such as NestJS's `enableShutdownHooks()`), Encore stops
48
+ * taking new work immediately and waits for the application to re-raise the
49
+ * signal, exit, or drain its event loop before cleaning up. The process then
50
+ * exits with the application's own exit code, or with 1 if the shutdown
51
+ * deadline expires first.
51
52
  *
52
- * Connections the app's own database pools hold, as `pg` and Drizzle's do,
53
- * stay open until the app closes them or the process exits.
53
+ * Database connections owned by third-party pools (such as `pg` or Drizzle)
54
+ * stay open until the application closes them or the process exits.
54
55
  *
55
56
  * @module
56
57
  */
@@ -1 +1 @@
1
- {"version":3,"file":"mod.js","sourceRoot":"","sources":["../../shutdown/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EACL,KAAK,EACL,OAAO,EACP,SAAS,EACT,YAAY,EACZ,IAAI,EACJ,UAAU,EACV,KAAK,EACL,MAAM,EACN,OAAO,EACP,SAAS,EACT,aAAa,GACd,MAAM,8BAA8B,CAAC"}
1
+ {"version":3,"file":"mod.js","sourceRoot":"","sources":["../../shutdown/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EACL,KAAK,EACL,OAAO,EACP,SAAS,EACT,YAAY,EACZ,IAAI,EACJ,UAAU,EACV,KAAK,EACL,MAAM,EACN,OAAO,EACP,SAAS,EACT,aAAa,GACd,MAAM,8BAA8B,CAAC"}
@@ -4,186 +4,185 @@ import * as runtime from '../../internal/runtime/mod.js';
4
4
  import { StringLiteral } from '../../internal/utils/constraints.js';
5
5
  import { Decimal } from '../../types/mod.js';
6
6
  /**
7
- * Configuration for a ClickHouse `Database`.
7
+ * Configuration for a ClickHouse {@link Database}.
8
8
  */
9
9
  export interface DatabaseConfig {
10
10
  /**
11
- * The directory of the database's migrations, relative to the file that
12
- * declares it: `1_create_events.up.sql` and so on, with optional
13
- * `.down.sql` files. Each file's statements run one at a time; a failed
14
- * one leaves the database's version dirty, as ClickHouse can't roll DDL
15
- * back.
11
+ * Path to the migrations directory relative to the declaring file (containing
12
+ * files such as `1_create_events.up.sql` and optional `.down.sql` files).
13
+ * Statements in each file run sequentially; because ClickHouse cannot roll
14
+ * back DDL, a failed migration leaves the schema version dirty.
16
15
  */
17
16
  migrations?: string;
18
17
  /**
19
- * Tags that classify the database, for policies to read: written out as
20
- * string literals, as in `{data: "pci"}`. Keys and values are lowercase
21
- * letters, digits, `_` and `-`, at most 63 characters; a key starts with a
22
- * letter, and not with `encore`, which is reserved. At most 32 tags.
18
+ * Static string-literal tags that classify the database for policy checks
19
+ * (e.g. `{data: "pci"}`). Keys and values may contain lowercase letters,
20
+ * digits, `_`, and `-`, up to 63 characters. Keys must start with a letter
21
+ * and cannot start with the reserved prefix `encore`. At most 32 tags.
23
22
  */
24
23
  tags?: Record<string, string>;
25
24
  }
26
25
  /**
27
- * A row of a query's result, keyed by column name.
26
+ * A single query result row, keyed by column name.
28
27
  *
29
- * - Integers and floats are numbers, but for 64-bit integers beyond what a
30
- * number holds exactly (±(2^53−1)), and `Int128`/`UInt128`/`Int256`/
31
- * `UInt256`, which are `bigint`s, so they are never rounded.
32
- * - `Decimal` is its exact text: `'12.30'`.
33
- * - `String` is a string (invalid UTF-8 replaced), and a `FixedString`
34
- * that isn't UTF-8 a `Buffer`.
35
- * - `UUID`, `Enum`, `IPv4` and `IPv6` are strings.
36
- * - `Date`/`Date32` is a `'YYYY-MM-DD'` string, `DateTime`/`DateTime64` a
37
- * `Date` (to the millisecond), and `Time`/`Time64` a number of seconds.
38
- * - `Array` and `Tuple` are arrays, a `Map` with string keys an object and
39
- * any other `Map` a `Map`, and `JSON` its parsed value.
40
- * - `NULL` is `null`.
28
+ * Column types map to JavaScript values as follows:
29
+ * - Integers and floats decode to `number`, except 64-bit integers outside the
30
+ * safe integer range (±(2^53−1)) and `Int128`/`UInt128`/`Int256`/`UInt256`,
31
+ * which decode to `bigint` to avoid precision loss.
32
+ * - `Decimal` decodes to its exact string representation (e.g. `'12.30'`).
33
+ * - `String` decodes to `string` (invalid UTF-8 replaced); non-UTF-8
34
+ * `FixedString` decodes to `Buffer`.
35
+ * - `UUID`, `Enum`, `IPv4`, and `IPv6` decode to `string`.
36
+ * - `Date`/`Date32` decode to `'YYYY-MM-DD'`, `DateTime`/`DateTime64` to
37
+ * `Date` (millisecond precision), and `Time`/`Time64` to seconds (`number`).
38
+ * - `Array` and `Tuple` decode to arrays; `Map` with string keys decodes to a
39
+ * plain object (other key types decode to `Map`); `JSON` decodes to its
40
+ * parsed value.
41
+ * - `NULL` decodes to `null`.
41
42
  */
42
43
  export type Row = Record<string, any>;
43
44
  /**
44
- * A value a query parameter or an inserted column takes. Its ClickHouse type,
45
- * when a tagged template names it for you, is inferred from it:
45
+ * A value accepted as a query parameter or inserted column. In tagged-template
46
+ * queries, the ClickHouse parameter type is inferred automatically:
46
47
  *
47
- * - `boolean`: `Bool`
48
- * - an integer `number` (to ±(2^53−1)): `Int64`; any other `number`: `Float64`
49
- * - `bigint`: `Int64`, or `UInt64` above its maximum (wider ones up to 256 bits)
50
- * - `string`: `String`; `Buffer`/`Uint8Array`: `String` (its bytes)
51
- * - `Date`: `DateTime64(6, 'UTC')`
52
- * - `Decimal`: `Decimal(76, s)`, `s` its digits after the point
53
- * - an array: `Array(T)`, `T` its first non-null element's type, made
54
- * `Nullable` if it holds a null
55
- * - a plain object, or a `Map`: `Map(String, T)` (a `Map`'s keys as their
56
- * own type)
57
- * - `null`/`undefined`: `Nullable(String)`, `NULL`
48
+ * - `boolean` → `Bool`
49
+ * - safe integer `number` → `Int64`; other `number` → `Float64`
50
+ * - `bigint` → `Int64`, or `UInt64` (and wider types up to 256 bits) as needed
51
+ * - `string`, `Buffer`, `Uint8Array` → `String`
52
+ * - `Date` → `DateTime64(6, 'UTC')`
53
+ * - `Decimal` → `Decimal(76, s)` where `s` is the decimal scale
54
+ * - array → `Array(T)` inferred from the first non-null element (`Nullable(T)`
55
+ * if the array contains `null`)
56
+ * - plain object or `Map` → `Map(K, V)`
57
+ * - `null`/`undefined` → `Nullable(String)` (`NULL`)
58
58
  *
59
- * Wrap a value whose type should be another in {@link typed}.
59
+ * Wrap a value with {@link typed} to specify an explicit ClickHouse type.
60
60
  */
61
61
  export type Param = string | number | bigint | boolean | Date | Buffer | Uint8Array | Decimal | Typed | null | undefined | readonly Param[] | Map<Param, Param> | {
62
62
  [key: string]: Param;
63
63
  };
64
- /** A setting's value: sent as its text, a boolean as `1` or `0`. */
64
+ /** ClickHouse query setting value (booleans are sent as `1` or `0`). */
65
65
  export type SettingValue = string | number | boolean;
66
- /** Options for one call. */
66
+ /** Per-call options for ClickHouse queries and statements. */
67
67
  export interface QueryOptions {
68
68
  /**
69
- * ClickHouse settings for this call only, such as `{max_execution_time: 5}`
70
- * or `{async_insert: true}`. There are no sessions: each call is a request
71
- * of its own, so `SET` doesn't carry over to the next one. An unknown
72
- * setting is the server's error.
69
+ * ClickHouse settings applied only to this call (e.g.
70
+ * `{max_execution_time: 5}` or `{async_insert: true}`). Because calls are
71
+ * stateless, `SET` does not carry over between calls. Unknown settings cause
72
+ * a server error.
73
73
  */
74
74
  settings?: Record<string, SettingValue>;
75
- /** The query's id on the server, for `system.query_log`: one is made if not given. */
75
+ /** Custom server query ID for `system.query_log` (auto-generated if omitted). */
76
76
  queryId?: string;
77
77
  }
78
- /** What a statement or insert did, as the server summarizes it. */
78
+ /** Execution statistics returned by ClickHouse for a statement or insert. */
79
79
  export interface ExecResult {
80
- /** How many rows it wrote. */
80
+ /** Number of rows written. */
81
81
  rowsWritten: number;
82
- /** How many bytes it wrote, uncompressed. */
82
+ /** Number of uncompressed bytes written. */
83
83
  bytesWritten: number;
84
- /** How many rows it read. */
84
+ /** Number of rows read. */
85
85
  rowsRead: number;
86
- /** The query's id on the server. */
86
+ /** Server-assigned or caller-provided query ID. */
87
87
  queryId: string;
88
88
  }
89
89
  /**
90
- * A value with the ClickHouse type it is bound as: see {@link typed}.
90
+ * Wraps a query parameter value with an explicit ClickHouse type (see
91
+ * {@link typed}).
91
92
  */
92
93
  export declare class Typed<T = unknown> {
93
- /** The value. */
94
+ /** The parameter value. */
94
95
  readonly value: T;
95
- /** Its ClickHouse type, such as `'UUID'` or `'Array(UInt32)'`. */
96
+ /** Explicit ClickHouse type name (e.g. `'UUID'` or `'Array(UInt32)'`). */
96
97
  readonly type: string;
97
98
  /** @internal */
98
99
  constructor(
99
- /** The value. */
100
+ /** The parameter value. */
100
101
  value: T,
101
- /** Its ClickHouse type, such as `'UUID'` or `'Array(UInt32)'`. */
102
+ /** Explicit ClickHouse type name (e.g. `'UUID'` or `'Array(UInt32)'`). */
102
103
  type: string);
103
104
  }
104
105
  /**
105
- * Binds `value` as the ClickHouse type `type` rather than the one inferred
106
- * from it, in a tagged template: `` ${typed(id, 'UUID')} `` becomes
107
- * `{p0:UUID}`. A `Date` bound as `DateTime` is its whole seconds, and as
108
- * `Date` or `Date32` its day in UTC.
106
+ * Binds `value` as the explicit ClickHouse type `type` instead of inferring
107
+ * one in tagged-template queries (e.g. `` ${typed(id, 'UUID')} `` emits
108
+ * `{p0:UUID}`). A `Date` bound as `DateTime` truncates to whole seconds; bound
109
+ * as `Date` or `Date32`, it uses the UTC calendar date.
109
110
  *
110
111
  * @example
111
112
  * await db.queryAll`SELECT * FROM events WHERE user_id = ${typed(userId, 'UUID')}`;
112
113
  */
113
114
  export declare function typed<T>(value: T, type: string): Typed<T>;
114
- /** The native database a handle's calls go to. */
115
+ /** Native ClickHouse handle or lazy test-scoped resolver. */
115
116
  type Handle = runtime.ClickHouseDatabase | (() => runtime.ClickHouseDatabase);
116
- /** Base class with the query methods every handle has. */
117
+ /** Base class providing shared ClickHouse query and execution methods. */
117
118
  declare class BaseQueryExecutor {
118
119
  private readonly handle;
119
120
  private readonly access;
120
121
  /** @internal */
121
122
  constructor(handle: Handle, access: runtime.ClickHouseAccess);
122
- /** The native database: in test mode the current test's instance. */
123
+ /** Native database handle (resolves to the current test's instance in test mode). */
123
124
  protected get impl(): runtime.ClickHouseDatabase;
124
125
  /**
125
- * The connection string to connect to the database with another client,
126
- * as this handle's user: `http://user:password@host:port/database`.
127
- * `@clickhouse/client` reads it as its `url`.
126
+ * HTTP connection string (`http://user:password@host:port/database`) scoped
127
+ * to this handle's access level, compatible with `@clickhouse/client`'s `url`
128
+ * option.
128
129
  */
129
130
  get connectionString(): string;
130
131
  /**
131
- * Queries the database with a template string, binding each `${value}` as
132
- * a parameter of the type inferred from it (see {@link Param}):
133
- * `` query`SELECT * FROM events WHERE id = ${id}` `` runs `SELECT * FROM
134
- * events WHERE id = {p0:Int64}`. Wrap a value in {@link typed} to bind it
135
- * as another type.
136
- *
137
- * It streams the rows: iterate it with `for await`.
132
+ * Streams rows from a tagged-template query, binding each `${value}` as a
133
+ * typed server parameter (see {@link Param}). For example,
134
+ * `` query`SELECT * FROM events WHERE id = ${id}` `` sends
135
+ * `SELECT * FROM events WHERE id = {p0:Int64}`. Use {@link typed} to
136
+ * override the inferred type. Iterate results with `for await`.
138
137
  */
139
138
  query<T extends Row = Record<string, any>>(strings: TemplateStringsArray, ...params: Param[]): AsyncGenerator<T>;
140
139
  /**
141
- * Queries the database with SQL whose parameters it names, with their
142
- * types, as `{name:Type}`, and `params` their values by name:
140
+ * Streams rows from a raw SQL query with named typed placeholders (such as
141
+ * `{id:UInt64}`) and matching entries in `params`. Iterate results with
142
+ * `for await`.
143
143
  *
144
144
  * ```ts
145
145
  * db.rawQuery('SELECT * FROM events WHERE id = {id:UInt64}', {id: 5});
146
146
  * ```
147
- *
148
- * It streams the rows: iterate it with `for await`.
149
147
  */
150
148
  rawQuery<T extends Row = Record<string, any>>(sql: string, params?: Record<string, Param>, options?: QueryOptions): AsyncGenerator<T>;
151
- /** {@link query}, returning every row. */
149
+ /** Runs a tagged-template query (like {@link query}) and collects all rows into an array. */
152
150
  queryAll<T extends Row = Record<string, any>>(strings: TemplateStringsArray, ...params: Param[]): Promise<T[]>;
153
- /** {@link rawQuery}, returning every row. */
151
+ /** Runs a raw query (like {@link rawQuery}) and collects all rows into an array. */
154
152
  rawQueryAll<T extends Row = Record<string, any>>(sql: string, params?: Record<string, Param>, options?: QueryOptions): Promise<T[]>;
155
153
  /**
156
- * {@link query}, returning its one row: `null` if there is none, and a
157
- * {@link TooManyRowsError} if there is more than one.
154
+ * Runs a tagged-template query (like {@link query}) expecting at most one
155
+ * row. Returns `null` if no rows match, or throws {@link TooManyRowsError}
156
+ * if more than one row is returned.
158
157
  */
159
158
  queryRow<T extends Row = Record<string, any>>(strings: TemplateStringsArray, ...params: Param[]): Promise<T | null>;
160
159
  /**
161
- * {@link rawQuery}, returning its one row: `null` if there is none, and a
162
- * {@link TooManyRowsError} if there is more than one.
160
+ * Runs a raw query (like {@link rawQuery}) expecting at most one row.
161
+ * Returns `null` if no rows match, or throws {@link TooManyRowsError} if
162
+ * more than one row is returned.
163
163
  */
164
164
  rawQueryRow<T extends Row = Record<string, any>>(sql: string, params?: Record<string, Param>, options?: QueryOptions): Promise<T | null>;
165
165
  /**
166
- * Runs a statement with a template string, binding each `${value}` as
167
- * {@link query} does, and discards any rows it returns.
166
+ * Executes a tagged-template statement (binding `${value}` placeholders like
167
+ * {@link query}) and discards any returned rows.
168
168
  *
169
169
  * @example
170
170
  * await db.exec`ALTER TABLE events DELETE WHERE user_id = ${id}`;
171
171
  */
172
172
  exec(strings: TemplateStringsArray, ...params: Param[]): Promise<ExecResult>;
173
173
  /**
174
- * Runs a statement whose parameters it names, as {@link rawQuery} does,
175
- * and discards any rows it returns.
174
+ * Executes a raw statement with named typed parameters (like
175
+ * {@link rawQuery}) and discards any returned rows.
176
176
  */
177
177
  rawExec(sql: string, params?: Record<string, Param>, options?: QueryOptions): Promise<ExecResult>;
178
178
  /**
179
- * Inserts `rows` into `table` (`table`, or `database.table`). Each row is
180
- * an object, or a `Map`, keyed by column name. The columns are those the
181
- * rows have keys for; a row without one of them, or with it `undefined`,
182
- * leaves it out, so it gets the column's default. `null` is `NULL`, which
183
- * a column that isn't `Nullable` also takes as its default.
179
+ * Bulk-inserts `rows` into `table` (`table` or `database.table`). Each row
180
+ * is an object or `Map` keyed by column name. Omitted or `undefined` fields
181
+ * use the column's default; `null` inserts `NULL` (or the column default for
182
+ * non-`Nullable` columns).
184
183
  *
185
- * The rows travel as JSON: binary strings that aren't UTF-8 don't survive
186
- * it, so insert those with a parameterized `INSERT … VALUES`.
184
+ * Rows are serialized as JSON, so non-UTF-8 binary strings are not preserved
185
+ * — use a parameterized `INSERT ... VALUES` statement for binary data.
187
186
  *
188
187
  * @example
189
188
  * await db.insert('events', [
@@ -199,39 +198,38 @@ declare class BaseQueryExecutor {
199
198
  private run;
200
199
  }
201
200
  /**
202
- * A query handle that can be passed to application/library code. Obtain one
203
- * with `read()`, `write()` or `admin()`. A `Database` declaration
204
- * deliberately does not implement this class.
201
+ * A scoped query handle safe to pass into application or library code. Obtain
202
+ * one with `read()`, `write()`, or `admin()`. {@link Database} deliberately
203
+ * does not extend `Queryable`.
205
204
  */
206
205
  export declare abstract class Queryable extends BaseQueryExecutor {
207
206
  private readonly queryableBrand;
208
207
  }
209
208
  /**
210
- * A handle to a database with one access level, which Encore's parser
211
- * records where it is made:
209
+ * A ClickHouse database handle scoped to a specific access level recorded by
210
+ * Encore's parser where it is created:
212
211
  *
213
- * - `read()`: `SELECT` and `SHOW`. Its writes are refused, by its user's
214
- * grants, or the `readonly` setting when the runtime config gives the read
215
- * level no user of its own.
216
- * - `write()`: reads, and `INSERT`, `ALTER … UPDATE/DELETE` and lightweight
212
+ * - `read()`: `SELECT` and `SHOW` only (writes are rejected by the user's
213
+ * grants or the `readonly` setting).
214
+ * - `write()`: reads plus `INSERT`, `ALTER ... UPDATE/DELETE`, and lightweight
217
215
  * `DELETE`.
218
- * - `admin()`: anything on the database: DDL, `TRUNCATE`, `OPTIMIZE`.
216
+ * - `admin()`: full access including DDL, `TRUNCATE`, and `OPTIMIZE`.
219
217
  *
220
- * Each level is its own ClickHouse user, so its connection string connects
221
- * with that level's grants.
218
+ * Each access level uses its own ClickHouse user, so `connectionString`
219
+ * connects with matching grants.
222
220
  */
223
221
  export declare class DatabaseRef extends Queryable {
224
222
  /** @internal */
225
223
  constructor(handle: Handle, access: runtime.ClickHouseAccess);
226
224
  }
227
225
  /**
228
- * A ClickHouse database. Constructing one makes Encore provision a database
229
- * with that name, run its migrations, and return this object to represent
230
- * it. Its own methods have write access; `read()`, `write()` and `admin()`
231
- * select a level.
226
+ * Declares a ClickHouse database. Encore provisions the database, runs its
227
+ * migrations, and returns this handle. Methods called directly on `Database`
228
+ * run with write access; call `read()`, `write()`, or `admin()` to obtain a
229
+ * handle with a specific access level.
232
230
  *
233
- * If you want to reference an existing database, use `Database.named(name)`,
234
- * as it is a compile error to create duplicate databases.
231
+ * To reference an existing database without declaring a duplicate, use
232
+ * {@link Database.named}.
235
233
  *
236
234
  * @example
237
235
  * import { Database } from "@encore.dev/sdk/storage/clickhouse";
@@ -246,15 +244,15 @@ export declare class Database extends BaseQueryExecutor {
246
244
  private readonly refs;
247
245
  constructor(name: string, _cfg?: DatabaseConfig);
248
246
  /**
249
- * Reference an existing database by name. If the database doesn't exist
250
- * yet, use `new Database(name)` instead.
247
+ * References an existing ClickHouse database by name. Use
248
+ * `new Database(name)` to declare a new database.
251
249
  */
252
250
  static named<name extends string>(name: StringLiteral<name>): Database;
253
- /** Select read access: `SELECT` and `SHOW`. */
251
+ /** Returns a read-only handle (`SELECT` and `SHOW`). */
254
252
  read(): DatabaseRef;
255
- /** Select read and write access: also `INSERT` and mutations. */
253
+ /** Returns a read-write handle (`SELECT`, `INSERT`, and mutations). */
256
254
  write(): DatabaseRef;
257
- /** Select read, write and admin access: anything on the database. */
255
+ /** Returns an admin handle with full access (including DDL). */
258
256
  admin(): DatabaseRef;
259
257
  private ref;
260
258
  }
@@ -1 +1 @@
1
- {"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../../storage/clickhouse/database.ts"],"names":[],"mappings":";;AACA,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AAEtD,OAAO,EAAC,aAAa,EAAC,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAC,OAAO,EAAC,MAAM,iBAAiB,CAAC;AAGxC;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAEtC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,KAAK,GACb,MAAM,GACN,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,MAAM,GACN,UAAU,GACV,OAAO,GACP,KAAK,GACL,IAAI,GACJ,SAAS,GACT,SAAS,KAAK,EAAE,GAChB,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,GACjB;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAA;CAAC,CAAC;AAE3B,oEAAoE;AACpE,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAErD,4BAA4B;AAC5B,MAAM,WAAW,YAAY;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACxC,sFAAsF;IACtF,OAAO,CAAC,EAAE,MAAM,CAAC;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