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

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
@@ -5,74 +5,68 @@ import * as runtime from '../../internal/runtime/mod.js';
5
5
  import { StringLiteral } from '../../internal/utils/constraints.js';
6
6
  import type { Interval } from './interval.js';
7
7
  /**
8
- * Configures how database migrations are managed for a `Database`.
8
+ * Configures how database migrations are managed for a {@link Database}.
9
9
  */
10
10
  export interface MigrationsConfig {
11
11
  path: string;
12
12
  source?: 'prisma' | 'drizzle' | 'drizzle/v1';
13
13
  }
14
14
  /**
15
- * Configuration for a `Database`.
15
+ * Configuration options for declaring a PostgreSQL {@link Database}.
16
16
  */
17
17
  export interface DatabaseConfig {
18
18
  migrations?: string | MigrationsConfig;
19
19
  /**
20
- * Tags that classify the database, for policies to read: written out as
21
- * string literals, as in `{data: "pci"}`. Keys and values are lowercase
22
- * letters, digits, `_` and `-`, at most 63 characters; a key starts with a
23
- * letter, and not with `encore`, which is reserved. At most 32 tags.
20
+ * Static string-literal tags that classify the database for policy checks
21
+ * (e.g. `{data: "pci"}`). Keys and values may contain lowercase letters,
22
+ * digits, `_`, and `-`, up to 63 characters. Keys must start with a letter
23
+ * and cannot start with the reserved prefix `encore`. At most 32 tags.
24
24
  */
25
25
  tags?: Record<string, string>;
26
26
  }
27
27
  /**
28
- * Represents a single row from a query result, keyed by column name.
28
+ * A single query result row, keyed by column name.
29
29
  *
30
- * Integers and floats are numbers, except an `int8` beyond what a number
31
- * holds exactly (±(2^53−1)), which is a `bigint` so it is never rounded.
32
- * `numeric` is a `Decimal`, `interval` a string in ISO 8601's form
33
- * (`'P1Y2M3DT4H5M6.5S'`; see {@link Interval}), `timestamp`/`timestamptz` a
34
- * `Date`, and `bytea` an `ArrayBuffer`. A type the SDK doesn't decode (`money`, `timetz`, ranges,
35
- * `bit`, `xml`, `tsvector`, an extension's) is a string in the server's text
36
- * form, and an array of one an array of such strings; a parameter of such a
37
- * type takes a string, which the server parses.
30
+ * Column types map to JavaScript values as follows:
31
+ * - Integers and floats decode to `number`, except `int8` values outside the
32
+ * safe integer range (±(2^53−1)), which decode to `bigint` to avoid
33
+ * precision loss.
34
+ * - `numeric` decodes to `Decimal`, `interval` to an ISO 8601 string (e.g.
35
+ * `'P1Y2M3DT4H5M6.5S'`; see {@link Interval}), `timestamp`/`timestamptz` to
36
+ * `Date`, and `bytea` to `ArrayBuffer`.
37
+ * - Types without a dedicated decoder (`money`, `timetz`, ranges, `bit`,
38
+ * `xml`, `tsvector`, and extension types) decode to PostgreSQL text strings
39
+ * (or string arrays for array columns) and accept string parameters.
38
40
  */
39
41
  export type Row = Record<string, any>;
40
- /** Represents a type that can be used in query template literals */
42
+ /** Parameter value accepted in query template literals and raw queries. */
41
43
  export type Primitive = string | string[] | number | number[] | boolean | boolean[] | Buffer | Date | Date[] | Interval | Interval[] | Record<string, any> | Record<string, any>[] | BigInt | BigInt[] | null | undefined;
42
44
  type SQLQueryExecutor = runtime.SQLConn | runtime.SQLDatabase | runtime.Transaction;
43
- /** The number of affected rows, represented exactly even beyond Number.MAX_SAFE_INTEGER. */
45
+ /** Result of an `exec` statement, with an exact affected-row count even beyond `Number.MAX_SAFE_INTEGER`. */
44
46
  export interface ExecResult {
45
47
  rowsAffected: bigint;
46
48
  }
47
- /** Base class containing shared query functionality */
49
+ /** Base class containing shared query and execution methods. */
48
50
  declare class BaseQueryExecutor<I extends SQLQueryExecutor = SQLQueryExecutor> {
49
51
  private readonly handle;
50
- /** The native handle, or how to find it for each call: a database's is
51
- * the current test's instance of it, in test mode.
52
- * @internal */
52
+ /** Native handle or lazy per-test resolver. @internal */
53
53
  constructor(handle: I | (() => I));
54
- /** The native handle statements run on. */
54
+ /** Native handle on which statements execute. */
55
55
  protected get impl(): I;
56
56
  /**
57
- * query queries the database using a template string, replacing your placeholders in the template
58
- * with parametrised values without risking SQL injections.
59
- *
60
- * It returns an async generator, that allows iterating over the results
61
- * in a streaming fashion using `for await`.
57
+ * Streams rows from a parameterized tagged-template SQL query, replacing
58
+ * `${value}` placeholders with `$1`, `$2`, ... to prevent SQL injection.
59
+ * Iterate over results with `for await`.
62
60
  *
63
61
  * @example
64
- *
65
62
  * const email = "foo@example.com";
66
- * const result = database.query`SELECT id FROM users WHERE email=${email}`
67
- *
68
- * This produces the query: "SELECT id FROM users WHERE email=$1".
63
+ * const result = database.query`SELECT id FROM users WHERE email=${email}`;
64
+ * // Executes: "SELECT id FROM users WHERE email=$1"
69
65
  */
70
66
  query<T extends Row = Record<string, any>>(strings: TemplateStringsArray, ...params: Primitive[]): AsyncGenerator<T>;
71
67
  /**
72
- * rawQuery queries the database using a raw parametrised SQL query and parameters.
73
- *
74
- * It returns an async generator, that allows iterating over the results
75
- * in a streaming fashion using `for await`.
68
+ * Streams rows from a raw parameterized SQL query using `$1`, `$2`, ...
69
+ * placeholders. Iterate over results with `for await`.
76
70
  *
77
71
  * @example
78
72
  * const query = "SELECT id FROM users WHERE email=$1";
@@ -82,72 +76,64 @@ declare class BaseQueryExecutor<I extends SQLQueryExecutor = SQLQueryExecutor> {
82
76
  * }
83
77
  *
84
78
  * @param query - The raw SQL query string.
85
- * @param params - The parameters to be used in the query.
86
- * @returns An async generator that yields rows from the query result.
79
+ * @param params - Positional parameters for the query.
80
+ * @returns An async generator yielding rows from the query result.
87
81
  */
88
82
  rawQuery<T extends Row = Record<string, any>>(query: string, ...params: Primitive[]): AsyncGenerator<T>;
89
83
  /**
90
- * queryAll queries the database using a template string, replacing your placeholders in the template
91
- * with parametrised values without risking SQL injections.
92
- *
93
- * It returns an array of all results.
84
+ * Executes a parameterized tagged-template SQL query and collects all rows
85
+ * into an array.
94
86
  *
95
87
  * @example
96
- *
97
88
  * const email = "foo@example.com";
98
- * const result = database.queryAll`SELECT id FROM users WHERE email=${email}`
99
- *
100
- * This produces the query: "SELECT id FROM users WHERE email=$1".
89
+ * const rows = await database.queryAll`SELECT id FROM users WHERE email=${email}`;
101
90
  */
102
91
  queryAll<T extends Row = Record<string, any>>(strings: TemplateStringsArray, ...params: Primitive[]): Promise<T[]>;
103
92
  /**
104
- * rawQueryAll queries the database using a raw parametrised SQL query and parameters.
105
- *
106
- * It returns an array of all results.
93
+ * Executes a raw parameterized SQL query and collects all rows into an array.
107
94
  *
108
95
  * @example
109
- *
110
96
  * const query = "SELECT id FROM users WHERE email=$1";
111
97
  * const email = "foo@example.com";
112
98
  * const rows = await database.rawQueryAll(query, email);
113
99
  */
114
100
  rawQueryAll<T extends Row = Record<string, any>>(query: string, ...params: Primitive[]): Promise<T[]>;
115
101
  /**
116
- * queryRow is like query but returns only a single row.
117
- * If the query selects no rows it returns null.
118
- * It throws a {@link TooManyRowsError} if more than one row matches.
102
+ * Executes a parameterized tagged-template SQL query expecting at most one
103
+ * row. Returns `null` if no rows match, or throws {@link TooManyRowsError}
104
+ * if more than one row matches.
119
105
  *
120
106
  * @example
121
107
  * const email = "foo@example.com";
122
- * const result = database.queryRow`SELECT id FROM users WHERE email=${email}`
108
+ * const row = await database.queryRow`SELECT id FROM users WHERE email=${email}`;
123
109
  */
124
110
  queryRow<T extends Row = Record<string, any>>(strings: TemplateStringsArray, ...params: Primitive[]): Promise<T | null>;
125
111
  /**
126
- * rawQueryRow is like rawQuery but returns only a single row.
127
- * If the query selects no rows, it returns null.
128
- * It throws a {@link TooManyRowsError} if more than one row matches.
112
+ * Executes a raw parameterized SQL query expecting at most one row. Returns
113
+ * `null` if no rows match, or throws {@link TooManyRowsError} if more than
114
+ * one row matches.
129
115
  *
130
116
  * @example
131
117
  * const query = "SELECT id FROM users WHERE email=$1";
132
118
  * const email = "foo@example.com";
133
119
  * const result = await database.rawQueryRow(query, email);
134
- * console.log(result);
135
120
  *
136
121
  * @param query - The raw SQL query string.
137
- * @param params - The parameters to be used in the query.
138
- * @returns A promise that resolves to a single row or null.
122
+ * @param params - Positional parameters for the query.
123
+ * @returns A promise resolving to the single matching row or `null`.
139
124
  */
140
125
  rawQueryRow<T extends Row = Record<string, any>>(query: string, ...params: Primitive[]): Promise<T | null>;
141
126
  /**
142
- * exec executes a query and returns its affected-row count.
127
+ * Executes a parameterized tagged-template statement and returns the
128
+ * affected row count.
143
129
  *
144
130
  * @example
145
131
  * const email = "foo@example.com";
146
- * const result = database.exec`DELETE FROM users WHERE email=${email}`
132
+ * const result = await database.exec`DELETE FROM users WHERE email=${email}`;
147
133
  */
148
134
  exec(strings: TemplateStringsArray, ...params: Primitive[]): Promise<ExecResult>;
149
135
  /**
150
- * rawExec executes a query and returns its affected-row count.
136
+ * Executes a raw parameterized statement and returns the affected row count.
151
137
  *
152
138
  * @example
153
139
  * const query = "DELETE FROM users WHERE email=$1";
@@ -155,142 +141,137 @@ declare class BaseQueryExecutor<I extends SQLQueryExecutor = SQLQueryExecutor> {
155
141
  * await database.rawExec(query, email);
156
142
  *
157
143
  * @param query - The raw SQL query string.
158
- * @param params - The parameters to be used in the query.
159
- * @returns The affected-row count after the statement completes.
144
+ * @param params - Positional parameters for the statement.
145
+ * @returns The affected row count after the statement completes.
160
146
  */
161
147
  rawExec(query: string, ...params: Primitive[]): Promise<ExecResult>;
162
148
  }
163
- /** The isolation level of a transaction. */
149
+ /** PostgreSQL transaction isolation level. */
164
150
  export type IsolationLevel = 'read_committed' | 'repeatable_read' | 'serializable';
165
151
  /**
166
- * How a transaction runs. What isn't set is the database's default:
167
- * `read_committed`, read-write (read-only on a read handle), not deferrable.
152
+ * Options for starting a PostgreSQL transaction. Unspecified options use the
153
+ * database defaults (`read_committed`, read-write — or read-only on a read
154
+ * handle — and non-deferrable).
168
155
  */
169
156
  export interface TransactionOptions {
170
157
  isolation?: IsolationLevel;
171
158
  /**
172
- * Begin the transaction `READ ONLY`, or with `false` `READ WRITE`. A read
173
- * handle's transactions are read-only whatever this says, so `false`
174
- * throws a `TypeError` on one.
159
+ * Starts the transaction as `READ ONLY` (`true`) or `READ WRITE` (`false`).
160
+ * Passing `false` on a read handle throws a `TypeError`.
175
161
  */
176
162
  readOnly?: boolean;
177
163
  /**
178
- * Begin the transaction `DEFERRABLE`, or with `false` `NOT DEFERRABLE`. It
179
- * matters only to a serializable, read-only transaction, which then waits
180
- * until it can run without serialization failures.
164
+ * Starts the transaction as `DEFERRABLE` (`true`) or `NOT DEFERRABLE`
165
+ * (`false`). Applies only to serializable read-only transactions, allowing
166
+ * them to wait for a safe snapshot instead of failing with serialization
167
+ * errors.
181
168
  */
182
169
  deferrable?: boolean;
183
170
  }
184
171
  /**
185
- * A query handle that can be passed to application/library code.
186
- * Obtain one with read(), write(), or admin(), or use a connection/transaction.
187
- * A Database declaration deliberately does not implement this interface.
172
+ * A scoped query handle safe to pass into application or library code. Obtain
173
+ * one with `read()`, `write()`, `admin()`, `acquire()`, or `begin()`.
174
+ * {@link Database} deliberately does not extend `Queryable`.
188
175
  */
189
176
  export declare abstract class Queryable<I extends SQLQueryExecutor = SQLQueryExecutor> extends BaseQueryExecutor<I> {
190
177
  private readonly queryableBrand;
191
178
  }
192
- /** Options for selecting read access. */
179
+ /** Options for {@link Database.read}. */
193
180
  export interface ReadOptions {
194
181
  /**
195
- * Read from the primary rather than a read replica. Without it, a database
196
- * whose runtime config has a read-only pool on a replica reads from that.
182
+ * Route reads to the primary instance instead of a read replica. When
183
+ * omitted, Encore uses a read-replica pool if one is configured.
197
184
  */
198
185
  primary?: boolean;
199
186
  }
200
187
  /**
201
- * A database handle with access recorded by Encore's parser at its creation site.
188
+ * A database handle with an access level recorded statically by Encore at its
189
+ * creation site (`read()`, `write()`, or `admin()`).
202
190
  *
203
- * Handles share the declaration's pool. A read handle runs on read-only
204
- * connections: a statement that writes fails with a `DatabaseError` whose
205
- * code is `read_only_transaction` (SQLSTATE 25006), and the transactions it
206
- * begins, and those of the connections it acquires, are read-only. A write
207
- * or admin handle runs read-write.
191
+ * Read handles execute on read-only connections where writes fail with a
192
+ * `DatabaseError` (`code: "read_only_transaction"`, SQLSTATE 25006), and any
193
+ * transactions or connections they create are also read-only. Write and admin
194
+ * handles execute read-write.
208
195
  *
209
- * On the database's own pool, which a read handle shares when there is no
210
- * read-only pool for it, that refuses mistaken writes, not deliberate ones:
211
- * SQL that changes the session's `default_transaction_read_only` on the same
212
- * connection (`SET default_transaction_read_only = off`) lifts it. Against
213
- * untrusted code, the read-only pool's database role is what refuses writes.
196
+ * When no dedicated read-only pool is configured, read handles share the
197
+ * primary pool with `default_transaction_read_only = on` (which guards against
198
+ * accidental writes, though explicit `SET default_transaction_read_only = off`
199
+ * would lift it); with a dedicated read-only pool, the database role itself
200
+ * enforces read-only permissions.
214
201
  */
215
202
  export declare class DatabaseRef extends Queryable<runtime.SQLDatabase> {
216
203
  /** @internal */
217
204
  constructor(impl: runtime.SQLDatabase | (() => runtime.SQLDatabase));
218
205
  /**
219
- * The connection string to connect to the database with another client.
220
- * A write or admin handle's connects read-write. A read handle's connects
221
- * as its statements run: through the database's read-only pool, as that
222
- * pool's role, if they would run on it (from a read replica, unless
223
- * `primary` is set), and otherwise to the primary. Either way its session
224
- * is read-only (`default_transaction_read_only` is on), so a write fails
225
- * with SQLSTATE 25006 until SQL on it turns that off; through the
226
- * read-only pool, its role refuses writes still.
206
+ * PostgreSQL connection string for connecting with an external client using
207
+ * this handle's access level. Write/admin handles connect read-write; read
208
+ * handles connect to the read-only replica pool if configured (unless
209
+ * `primary: true` was passed) with `default_transaction_read_only` enabled.
227
210
  */
228
211
  get connectionString(): string;
229
212
  /**
230
- * Acquires a database connection from the pool, with this handle's access.
231
- * See {@link Database.acquire}.
213
+ * Acquires a dedicated connection from the pool with this handle's access
214
+ * level. See {@link Database.acquire}.
232
215
  */
233
216
  acquire(): Promise<Connection>;
234
217
  /**
235
- * Begins a transaction with this handle's access. See {@link Database.begin}.
236
- * A read handle's transactions are read-only.
218
+ * Begins a transaction with this handle's access level (always read-only for
219
+ * read handles). See {@link Database.begin}.
237
220
  */
238
221
  begin(options?: TransactionOptions): Promise<Transaction>;
239
222
  }
240
223
  /**
241
- * Constructing a new database object will result in Encore provisioning a database with
242
- * that name and returning this object to represent it.
224
+ * Declares a PostgreSQL database. Encore provisions the database, runs its
225
+ * migrations, and returns this handle.
243
226
  *
244
- * If you want to reference an existing database, use `Database.named(name)` as it is a
245
- * compile error to create duplicate databases.
227
+ * To reference an existing database without declaring a duplicate, use
228
+ * {@link Database.named}.
246
229
  */
247
230
  export declare class Database extends BaseQueryExecutor<runtime.SQLDatabase> {
248
- /** The read handles, made on first use. */
231
+ /** Cached read handles, created on first use. */
249
232
  private reader?;
250
233
  private primaryReader?;
251
234
  private readonly dbName;
252
235
  constructor(name: string, _cfg?: DatabaseConfig);
253
236
  /**
254
- * Reference an existing database by name, if the database doesn't
255
- * exist yet, use `new Database(name)` instead.
237
+ * References an existing database by name. Use `new Database(name)` to
238
+ * declare a new database.
256
239
  */
257
240
  static named<name extends string>(name: StringLiteral<name>): Database;
258
241
  /**
259
- * Select reader access. The handle runs on read-only connections, from a
260
- * read replica if the database has a read-only pool on one and `primary`
261
- * is not set, and its writes fail.
242
+ * Returns a read-only handle. Queries run on read-only connections (routed
243
+ * to a read replica when available unless `options.primary` is `true`), and
244
+ * write statements fail.
262
245
  */
263
246
  read(options?: ReadOptions): DatabaseRef;
264
- /** Select reader and writer access. */
247
+ /** Returns a read-write handle. */
265
248
  write(): DatabaseRef;
266
- /** Select reader, writer, and admin access. */
249
+ /** Returns an admin handle with read, write, and admin access. */
267
250
  admin(): DatabaseRef;
268
251
  private ref;
269
252
  /**
270
- * Returns the connection string for the database, which connects
271
- * read-write. A read handle's connects read-only: see
272
- * {@link DatabaseRef.connectionString}.
253
+ * Returns a read-write PostgreSQL connection string for external clients.
254
+ * For a read-only connection string, use {@link DatabaseRef.connectionString}.
273
255
  */
274
256
  get connectionString(): string;
275
257
  /**
276
- * Acquires a database connection from the database pool.
258
+ * Acquires a dedicated connection from the pool.
277
259
  *
278
- * When the connection is closed or is garbage-collected, it is returned to the pool.
279
- * Settings and the role its session was given (`SET`, `set_config`,
280
- * `SET ROLE`) are reset before the pool lends it again, when a statement
281
- * sent on it did so: one a function or procedure changes is not noticed,
282
- * and stays for the next borrower. To scope a setting to a unit of work,
283
- * such as a tenant id for row-level security, set it in a transaction with
284
- * `set_config(name, value, true)`, which ends with it.
285
- * @returns a new connection to the database
260
+ * When closed or garbage-collected, the connection is returned to the pool.
261
+ * Session settings and roles changed directly via `SET`, `set_config`, or
262
+ * `SET ROLE` are reset before reuse (changes made inside stored functions or
263
+ * procedures are not tracked automatically). To scope a setting such as a
264
+ * tenant ID for row-level security to one unit of work, use
265
+ * `set_config(name, value, true)` inside a transaction.
266
+ *
267
+ * @returns A dedicated {@link Connection} implementing `AsyncDisposable`.
286
268
  */
287
269
  acquire(): Promise<Connection>;
288
270
  /**
289
271
  * Begins a database transaction.
290
272
  *
291
- * Prefer the `await using` pattern, which automatically rolls back
292
- * the transaction if neither `commit` nor `rollback` is called before
293
- * the variable goes out of scope:
273
+ * Prefer `await using`, which automatically rolls back the transaction if
274
+ * neither `commit()` nor `rollback()` is called before leaving the scope:
294
275
  *
295
276
  * ```ts
296
277
  * await using tx = await db.begin();
@@ -298,61 +279,55 @@ export declare class Database extends BaseQueryExecutor<runtime.SQLDatabase> {
298
279
  * await tx.commit();
299
280
  * ```
300
281
  *
301
- * If you can't use `await using`, make sure to always call `commit`
302
- * or `rollback` yourself to prevent hanging transactions.
303
- *
304
- * `options` sets the transaction's isolation level and whether it is
305
- * read-only or deferrable:
282
+ * Otherwise, always call `commit()` or `rollback()` explicitly to avoid
283
+ * leaked transactions. Pass `options` to configure isolation level,
284
+ * read-only mode, or deferrability:
306
285
  *
307
286
  * ```ts
308
287
  * await using tx = await db.begin({isolation: 'serializable'});
309
288
  * ```
310
289
  *
311
- * @returns a transaction object that implements `AsyncDisposable`
290
+ * @returns A {@link Transaction} implementing `AsyncDisposable`.
312
291
  */
313
292
  begin(options?: TransactionOptions): Promise<Transaction>;
314
293
  }
315
294
  /**
316
- * Represents a database transaction.
295
+ * Represents an active database transaction.
317
296
  *
318
- * `Transaction` implements `AsyncDisposable`, so the recommended usage is
319
- * the `await using` pattern — it automatically rolls back the transaction
320
- * if neither `commit` nor `rollback` is called before the variable goes
321
- * out of scope:
297
+ * Implements `AsyncDisposable` for use with `await using`, automatically
298
+ * rolling back if neither `commit()` nor `rollback()` is called before leaving
299
+ * the scope:
322
300
  *
323
301
  * ```ts
324
302
  * await using tx = await db.begin();
325
303
  * await tx.exec`INSERT INTO ...`;
326
304
  * await tx.commit();
327
305
  * ```
328
- *
329
- * If you can't use `await using`, make sure to always call `commit` or
330
- * `rollback` yourself to prevent hanging transactions.
331
306
  */
332
307
  export declare class Transaction extends Queryable<runtime.Transaction> implements AsyncDisposable {
333
308
  private done;
334
309
  /** @internal */
335
310
  constructor(impl: runtime.Transaction);
336
311
  /**
337
- * Commit the transaction.
312
+ * Commits the transaction.
338
313
  */
339
314
  commit(): Promise<void>;
340
315
  /**
341
- * Rollback the transaction.
316
+ * Rolls back the transaction.
342
317
  */
343
318
  rollback(): Promise<void>;
344
319
  [Symbol.asyncDispose](): Promise<void>;
345
320
  }
346
321
  /**
347
- * Represents a dedicated connection to a database.
322
+ * Represents a dedicated PostgreSQL connection acquired from the pool.
348
323
  */
349
324
  export declare class Connection extends Queryable<runtime.SQLConn> implements AsyncDisposable {
350
325
  /** @internal */
351
326
  constructor(impl: runtime.SQLConn);
352
327
  /**
353
- * Begin a transaction that exclusively borrows this connection until
354
- * completion. See {@link Database.begin}. A connection acquired from a
355
- * read handle begins read-only transactions.
328
+ * Begins a transaction that exclusively borrows this connection until it
329
+ * completes (always read-only on connections acquired from a read handle).
330
+ * See {@link Database.begin}.
356
331
  */
357
332
  begin(options?: TransactionOptions): Promise<Transaction>;
358
333
  [Symbol.asyncDispose](): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../../storage/postgres/database.ts"],"names":[],"mappings":";;;AACA,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AAEtD,OAAO,EAAC,aAAa,EAAC,MAAM,kCAAkC,CAAC;AAE/D,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAEzC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,YAAY,CAAC;CAC9C;AACD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,UAAU,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAAC;IAEvC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B;AAED;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,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