@sqlbraid/core 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,277 +1,302 @@
1
1
  import { StandardSchemaV1, StandardSchemaV1 as StandardSchemaV1$1 } from "@standard-schema/spec";
2
- //#region src/authoring-modules.d.ts
3
- /** Data-only authoring identity shared by compiler, tooling, and editor consumers. */
4
- type AuthoringModuleCatalogEntry = {
5
- readonly moduleSpecifier: string;
6
- readonly dialectId?: "postgres" | "mysql" | "mariadb" | "sqlite" | "oracle" | "mssql";
7
- readonly helperFamily: "template" | "facade";
8
- };
9
- export declare const AUTHORING_MODULE_CATALOG: readonly AuthoringModuleCatalogEntry[];
2
+ //#region src/errors.d.ts
3
+ /** Thrown when a driver value cannot be represented without losing database information. */
4
+ export declare class ResultExactnessError extends Error {
5
+ static readonly code: "BRAID_RESULT_EXACTNESS";
6
+ readonly code: "BRAID_RESULT_EXACTNESS";
7
+ constructor(message?: string);
8
+ }
9
+ export type PublicErrorCategory = "runtime" | "adapter" | "compiler";
10
+ /** One deliberately public SQLBraid error code; an arbitrary `BRAID_` message is not automatically public. */
11
+ export interface PublicErrorDefinition {
12
+ readonly code: string;
13
+ readonly category: PublicErrorCategory;
14
+ readonly owner: string;
15
+ /**
16
+ * UnsupportedFeatureError only: features for which this code is a public
17
+ * contract. Other public errors intentionally omit this metadata.
18
+ */
19
+ readonly features?: readonly string[];
20
+ }
21
+ /**
22
+ * The intentionally small compatibility boundary for SQLBraid-owned errors.
23
+ *
24
+ * Keep this registry explicit. In particular, a BRAID_ token in a driver
25
+ * message or an internal compiler fallback is not public merely because it
26
+ * happens to use the project prefix.
27
+ */
28
+ export declare const PUBLIC_ERROR_DEFINITIONS: readonly PublicErrorDefinition[];
29
+ /** Public adapter capability failure. Unsupported features reject explicitly rather than being buffered or simulated. */
30
+ export declare class UnsupportedFeatureError extends Error {
31
+ readonly feature: string;
32
+ readonly code: `BRAID_${string}`;
33
+ constructor(feature: string, code: `BRAID_${string}`, message: string, options?: ErrorOptions);
34
+ }
35
+ /** Return true only for a registered, semantically valid feature/code pair. */
36
+ export declare function isPublicUnsupportedFeatureError(error: unknown): error is UnsupportedFeatureError;
37
+ /** An adapter-owned input/transport failure that retains TypeError semantics. */
38
+ export declare class AdapterError extends TypeError {
39
+ readonly code: `BRAID_${string}`;
40
+ constructor(code: `BRAID_${string}`, message: string, options?: ErrorOptions);
41
+ }
42
+ /** Rendering/authoring failure with a stable diagnostic code, raised before driver execution. */
43
+ export declare class SqlRenderError extends Error {
44
+ readonly code: string;
45
+ constructor(code: string, message: string);
46
+ }
10
47
  //#endregion
11
- //#region src/capabilities.d.ts
48
+ //#region src/numeric.d.ts
49
+ export type NumericSemantics = "exact-integer" | "exact-decimal" | "approximate-binary";
50
+ export type NumericRepresentation = "string" | "number";
51
+ export type TransportFidelity = "lossless" | "guarded" | "lossy" | "unsupported";
52
+ /** Database type semantics, JavaScript representation, and transport-fidelity claim for one mapping. */
53
+ export interface NumericTypeContract {
54
+ readonly semantics: NumericSemantics;
55
+ readonly representation: NumericRepresentation;
56
+ readonly fidelity: TransportFidelity;
57
+ readonly binaryPrecision?: 32 | 64;
58
+ }
59
+ export interface ExactIntegerRange {
60
+ readonly min?: bigint;
61
+ readonly max?: bigint;
62
+ }
12
63
  /**
13
- * The machine-readable capability vocabulary shared by adapters, support data,
14
- * and documentation. A capability's family describes what its status proves;
15
- * representation and metadata evidence are not execution support aliases.
64
+ * Decode an exact integer from driver output, optionally enforcing bigint bounds.
65
+ *
66
+ * @throws {ResultExactnessError} When the value is not an exact integer or violates the requested range.
16
67
  */
17
- type CapabilityFamily = "support" | "representation" | "metadata";
18
- interface WellKnownCapability {
19
- readonly id: string;
20
- readonly family: CapabilityFamily;
68
+ export declare function decodeExactInteger(value: unknown, range?: ExactIntegerRange): bigint;
69
+ /**
70
+ * Normalize an exact integer at the raw SQLBraid boundary without changing
71
+ * its textual spelling. This is intentionally not a bigint decoder: callers
72
+ * that need arithmetic may opt in to decodeExactInteger().
73
+ */
74
+ export declare function normalizeExactInteger(value: unknown): string;
75
+ /**
76
+ * Convert a database-reported count to a safe operational Number. Counts are
77
+ * not application values, so unlike exact SQL numerics they remain numbers,
78
+ * but narrowing an unsafe value is never implicit.
79
+ */
80
+ export declare function safeDatabaseCount(value: unknown): number;
81
+ /**
82
+ * Preserve an exact decimal as text; numeric JavaScript values are rejected because they may already be rounded.
83
+ *
84
+ * @throws {ResultExactnessError} When the value cannot prove exact decimal fidelity.
85
+ */
86
+ export declare function decodeExactDecimal(value: unknown, options?: {
87
+ readonly allowBigInt?: boolean;
88
+ }): string;
89
+ //#endregion
90
+ //#region src/parameter.d.ts
91
+ declare const boundParameterBrand: unique symbol;
92
+ export type RoutineParameterDirection = "in" | "out" | "inout";
93
+ /** Explicit database-type metadata for one bound value; this is not application validation or an input codec. */
94
+ export interface ParameterTypeHint<Input = unknown> {
95
+ readonly databaseType: string;
96
+ readonly length?: number | "max";
97
+ readonly precision?: number;
98
+ readonly scale?: number;
99
+ readonly __input?: Input;
21
100
  }
22
- declare const definitions: readonly [{
23
- readonly id: "sql.native-transparency";
24
- readonly family: "support";
25
- }, {
26
- readonly id: "sql.generated-structure";
27
- readonly family: "support";
28
- }, {
29
- readonly id: "result.rows";
30
- readonly family: "support";
31
- }, {
32
- readonly id: "result.command";
33
- readonly family: "support";
34
- }, {
35
- readonly id: "result.multiple-sets";
36
- readonly family: "support";
37
- }, {
38
- readonly id: "result.standard-schema";
39
- readonly family: "support";
40
- }, {
41
- readonly id: "numeric.exact-integer";
42
- readonly family: "representation";
43
- }, {
44
- readonly id: "numeric.exact-decimal";
45
- readonly family: "representation";
46
- }, {
47
- readonly id: "numeric.approximate-float";
48
- readonly family: "representation";
49
- }, {
50
- readonly id: "numeric.approximate-special";
51
- readonly family: "representation";
52
- }, {
53
- readonly id: "numeric.bind-exact";
54
- readonly family: "representation";
55
- }, {
56
- readonly id: "numeric.aggregate";
57
- readonly family: "representation";
58
- }, {
59
- readonly id: "numeric.command-metadata";
60
- readonly family: "representation";
61
- }, {
62
- readonly id: "numeric.special-values";
63
- readonly family: "representation";
64
- }, {
65
- readonly id: "numeric.scale-greater-than-precision";
66
- readonly family: "representation";
67
- }, {
68
- readonly id: "numeric.negative-scale";
69
- readonly family: "representation";
70
- }, {
71
- readonly id: "data.json-parsed";
72
- readonly family: "representation";
73
- }, {
74
- readonly id: "data.json-lossless-text";
75
- readonly family: "representation";
76
- }, {
77
- readonly id: "data.sql-variant";
78
- readonly family: "representation";
79
- }, {
80
- readonly id: "data.oracle-object";
81
- readonly family: "representation";
82
- }, {
83
- readonly id: "data.oracle-collection";
84
- readonly family: "representation";
85
- }, {
86
- readonly id: "data.vector";
87
- readonly family: "representation";
88
- }, {
89
- readonly id: "data.binary";
90
- readonly family: "representation";
91
- }, {
92
- readonly id: "data.uuid";
93
- readonly family: "representation";
94
- }, {
95
- readonly id: "data.temporal-native";
96
- readonly family: "representation";
97
- }, {
98
- readonly id: "data.temporal-lossless";
99
- readonly family: "representation";
100
- }, {
101
- readonly id: "data.timezone";
102
- readonly family: "representation";
103
- }, {
104
- readonly id: "metadata.command-safe";
105
- readonly family: "metadata";
106
- }, {
107
- readonly id: "dml.insert-returning";
108
- readonly family: "support";
109
- }, {
110
- readonly id: "dml.update-returning";
111
- readonly family: "support";
112
- }, {
113
- readonly id: "dml.delete-returning";
114
- readonly family: "support";
115
- }, {
116
- readonly id: "dml.merge-returning";
117
- readonly family: "support";
118
- }, {
119
- readonly id: "dml.upsert-returning";
120
- readonly family: "support";
121
- }, {
122
- readonly id: "session.pinned";
123
- readonly family: "support";
124
- }, {
125
- readonly id: "statement.prepare";
126
- readonly family: "support";
127
- }, {
128
- readonly id: "statement.cancel";
129
- readonly family: "support";
130
- }, {
131
- readonly id: "statement.stream";
132
- readonly family: "support";
133
- }, {
134
- readonly id: "statement.bulk";
135
- readonly family: "support";
136
- }, {
137
- readonly id: "execution.bulk-fidelity";
138
- readonly family: "support";
139
- }, {
140
- readonly id: "transaction";
141
- readonly family: "support";
142
- }, {
143
- readonly id: "transaction.savepoint";
144
- readonly family: "support";
145
- }, {
146
- readonly id: "transaction.read-only";
147
- readonly family: "support";
148
- }, {
149
- readonly id: "transaction.isolation.read-uncommitted";
150
- readonly family: "support";
151
- }, {
152
- readonly id: "transaction.isolation.read-committed";
153
- readonly family: "support";
154
- }, {
155
- readonly id: "transaction.isolation.repeatable-read";
156
- readonly family: "support";
157
- }, {
158
- readonly id: "transaction.isolation.serializable";
159
- readonly family: "support";
160
- }, {
161
- readonly id: "routine.call";
162
- readonly family: "support";
163
- }, {
164
- readonly id: "routine.out";
165
- readonly family: "support";
166
- }, {
167
- readonly id: "routine.inout";
168
- readonly family: "support";
169
- }, {
170
- readonly id: "routine.result-sets";
171
- readonly family: "support";
172
- }, {
173
- readonly id: "routine.out-cursor";
174
- readonly family: "support";
175
- }, {
176
- readonly id: "routine.return-value";
177
- readonly family: "support";
178
- }, {
179
- readonly id: "metadata.identity";
180
- readonly family: "metadata";
181
- }, {
182
- readonly id: "metadata.generated";
183
- readonly family: "metadata";
184
- }, {
185
- readonly id: "metadata.routines";
186
- readonly family: "metadata";
187
- }, {
188
- readonly id: "metadata.types";
189
- readonly family: "metadata";
190
- }];
191
- export declare const WELL_KNOWN_CAPABILITIES: readonly WellKnownCapability[];
192
- type WellKnownCapabilityId = (typeof definitions)[number]["id"];
193
- export declare const WELL_KNOWN_CAPABILITY_IDS: readonly WellKnownCapabilityId[];
194
- export declare function isWellKnownCapabilityId(value: string): value is WellKnownCapabilityId;
101
+ /** Value plus an explicit database type hint, created by `sql.bind()`. */
102
+ export interface BoundParameter<Input = unknown> {
103
+ readonly value: Input;
104
+ readonly hint: ParameterTypeHint<Input>;
105
+ readonly [boundParameterBrand]: true;
106
+ }
107
+ /** Value-only routine OUT/INOUT marker; the direction and output name are interpreted by the adapter. */
108
+ export interface RoutineParameter<Input = unknown> {
109
+ readonly value: Input;
110
+ readonly hint?: ParameterTypeHint;
111
+ readonly direction: Exclude<RoutineParameterDirection, "in">;
112
+ readonly outputName: string;
113
+ }
114
+ /** Validate and freeze an explicit database parameter-type hint. */
115
+ export declare function createParameterTypeHint<Input = unknown>(hint: ParameterTypeHint<Input>): ParameterTypeHint<Input>;
116
+ /** Create the value-only marker consumed by adapter binding for an explicitly typed input. */
117
+ export declare function createBoundParameter<Input>(value: NoInfer<Input>, hint: ParameterTypeHint<Input>): BoundParameter<Input>;
118
+ /** Recognize only bound-parameter objects created by SQLBraid's own constructor. */
119
+ export declare function isBoundParameter(value: unknown): value is BoundParameter;
120
+ /** Create a value-only OUT parameter descriptor; the adapter supplies the native carrier. */
121
+ export declare function createRoutineOutParameter(name: string, hint?: ParameterTypeHint): RoutineParameter<null>;
122
+ /** Create a value-only INOUT parameter descriptor; input value and output channel stay distinct. */
123
+ export declare function createRoutineInOutParameter<Input>(name: string, value: NoInfer<Input>, hint?: ParameterTypeHint<Input>): RoutineParameter<Input>;
124
+ /** Recognize only routine OUT/INOUT descriptors created by SQLBraid's own constructor. */
125
+ export declare function isRoutineParameter(value: unknown): value is RoutineParameter;
195
126
  //#endregion
196
- //#region src/index.d.ts
127
+ //#region src/routine.d.ts
128
+ /** Optional routine identity metadata used by procedure-aware adapters and prepared-shape checks. */
129
+ export interface RoutineProcedure {
130
+ readonly name: string;
131
+ readonly parameterNames: readonly string[];
132
+ }
133
+ export type RoutineSchema = StandardSchemaV1$1<any, any>;
134
+ /**
135
+ * Application mapping contracts for routine OUT values, result sets, and return values.
136
+ * Each channel is independent; an OUT cursor is represented as a result set, not as scalar output.
137
+ */
138
+ export interface RoutineContract<Output extends Readonly<Record<string, unknown>> = Readonly<Record<string, unknown>>, Sets extends readonly RoutineSchema[] = readonly RoutineSchema[], ReturnValue = unknown> {
139
+ readonly output?: StandardSchemaV1$1<any, Output>;
140
+ readonly resultSets?: Sets;
141
+ readonly returnValue?: StandardSchemaV1$1<any, ReturnValue>;
142
+ readonly procedure?: RoutineProcedure;
143
+ }
144
+ /** One materialized routine result set, kept separate from scalar OUT and return-value channels. */
145
+ export interface RoutineResultSet<Row = unknown> {
146
+ readonly rows: readonly Row[];
147
+ }
148
+ export type RoutineResultSetTuple<Sets extends readonly unknown[]> = { readonly [K in keyof Sets]: RoutineResultSet<Sets[K]>; };
149
+ /** Application-facing routine result with independent output, result-set, and return-value channels. */
150
+ export interface RoutineCallResult<Output extends Readonly<Record<string, unknown>> = Readonly<Record<string, unknown>>, Sets extends readonly unknown[] = readonly unknown[], ReturnValue = unknown> {
151
+ readonly output: Output;
152
+ readonly resultSets: RoutineResultSetTuple<Sets>;
153
+ readonly returnValue?: ReturnValue;
154
+ }
155
+ export type RoutineSchemaOutput<Schema> = Schema extends StandardSchemaV1$1<any, infer Output> ? Output : never;
156
+ type RoutineRowsFromSchemas<Schemas extends readonly RoutineSchema[]> = { readonly [K in keyof Schemas]: RoutineSchemaOutput<Schemas[K]>; };
157
+ export type RoutineResultFromContract<Contract extends RoutineContract> = RoutineCallResult<Contract["output"] extends RoutineSchema ? RoutineSchemaOutput<Contract["output"]> extends Readonly<Record<string, unknown>> ? RoutineSchemaOutput<Contract["output"]> : Readonly<Record<string, unknown>> : Readonly<Record<string, unknown>>, Contract["resultSets"] extends (infer Schemas extends readonly RoutineSchema[]) ? RoutineRowsFromSchemas<Schemas> : readonly unknown[], Contract["returnValue"] extends RoutineSchema ? RoutineSchemaOutput<Contract["returnValue"]> : unknown> & (Contract extends {
158
+ readonly returnValue: RoutineSchema;
159
+ } ? {
160
+ readonly returnValue: RoutineSchemaOutput<Contract["returnValue"]>;
161
+ } : {});
162
+ export type RoutineResultSource = {
163
+ readonly kind: "out-cursor";
164
+ readonly name?: string;
165
+ readonly parameterIndex?: number;
166
+ } | {
167
+ readonly kind: "implicit";
168
+ readonly index: number;
169
+ } | {
170
+ readonly kind: "emitted";
171
+ readonly index: number;
172
+ };
173
+ /** Driver result-set payload with provenance for OUT cursors and emitted/implicit sets. */
174
+ export interface DriverRoutineResultSet {
175
+ readonly rows: readonly unknown[];
176
+ readonly source: RoutineResultSource;
177
+ }
178
+ /** Fully materialized routine result; native cursors, requests, and LOB handles must not escape this boundary. */
179
+ export interface DriverRoutineResult {
180
+ readonly output: Readonly<Record<string, unknown>>;
181
+ readonly returnValue?: unknown;
182
+ readonly resultSets: readonly DriverRoutineResultSet[];
183
+ }
184
+ export type RoutineMappingLocation = {
185
+ readonly kind: "output";
186
+ } | {
187
+ readonly kind: "return-value";
188
+ } | {
189
+ readonly kind: "result-set";
190
+ readonly resultSetIndex: number;
191
+ readonly rowIndex: number;
192
+ };
193
+ export type DriverCapabilityErrorCode = "BRAID_STREAM_UNSUPPORTED" | "BRAID_CALL_UNSUPPORTED" | "BRAID_CALL_RESULT_SETS" | "BRAID_CALL_CURSOR_TX_REQUIRED" | "BRAID_CALL_OUT_UNSUPPORTED" | "BRAID_CALL_RETURN_UNSUPPORTED" | "BRAID_CALL_CURSOR_UNSUPPORTED" | "BRAID_RESOURCE_CLEANUP";
194
+ /** Identifies which routine channel or row failed during Standard Schema mapping. */
195
+ export declare class RoutineMappingError extends Error {
196
+ static readonly code: "BRAID_CALL_MAP";
197
+ readonly code: "BRAID_CALL_MAP";
198
+ readonly location: RoutineMappingLocation;
199
+ constructor(message: string, location: RoutineMappingLocation, options?: {
200
+ readonly cause?: unknown;
201
+ });
202
+ }
203
+ //#endregion
204
+ //#region src/template-ir.d.ts
197
205
  export declare const SQL_FRAGMENT: unique symbol;
198
- declare const boundParameterBrand: unique symbol;
206
+ /** Half-open source range in the cooked template text, used for diagnostics and source mapping. */
199
207
  export interface SourceRange {
200
208
  readonly start: number;
201
209
  readonly end: number;
202
210
  }
203
- export interface RenderLimits {
204
- readonly maxSqlBytes?: number;
205
- readonly maxBindCount?: number;
206
- readonly maxStructuralItems?: number;
207
- readonly maxNestingDepth?: number;
211
+ /** Safety bounds applied while parsing and rendering dynamic SQL. */
212
+ export interface RenderLimits {
213
+ readonly maxSqlBytes?: number;
214
+ readonly maxBindCount?: number;
215
+ readonly maxStructuralItems?: number;
216
+ readonly maxNestingDepth?: number;
217
+ }
218
+ /** Declared logical result channel; runtime checks the driver's actual result kind against it. */
219
+ export type QueryResultKind = "rows" | "command" | "call" | "unknown";
220
+ export interface TextNode {
221
+ readonly kind: "text";
222
+ readonly text: string;
223
+ readonly range: SourceRange;
224
+ }
225
+ export interface BindNode {
226
+ readonly kind: "bind";
227
+ readonly interpolation: number;
228
+ readonly range: SourceRange;
229
+ }
230
+ export interface FragmentNode {
231
+ readonly kind: "fragment";
232
+ readonly fragment: SqlFragment;
233
+ readonly range: SourceRange;
234
+ }
235
+ export interface IdentifierNode {
236
+ readonly kind: "identifier";
237
+ readonly value: string | readonly string[];
238
+ readonly range: SourceRange;
239
+ }
240
+ export interface RawNode {
241
+ readonly kind: "raw";
242
+ readonly text: string;
243
+ readonly range: SourceRange;
208
244
  }
209
- export type QueryResultKind = "rows" | "command" | "call" | "unknown";
210
- export type NumericSemantics = "exact-integer" | "exact-decimal" | "approximate-binary";
211
- export type NumericRepresentation = "string" | "number";
212
- export type TransportFidelity = "lossless" | "guarded" | "lossy" | "unsupported";
213
- export interface NumericTypeContract {
214
- readonly semantics: NumericSemantics;
215
- readonly representation: NumericRepresentation;
216
- readonly fidelity: TransportFidelity;
217
- readonly binaryPrecision?: 32 | 64;
245
+ export interface ListNode {
246
+ readonly kind: "list";
247
+ readonly values: readonly unknown[];
248
+ readonly range: SourceRange;
218
249
  }
219
- export interface ExactIntegerRange {
220
- readonly min?: bigint;
221
- readonly max?: bigint;
250
+ export interface IfNode {
251
+ readonly kind: "if";
252
+ readonly condition: number;
253
+ readonly children: readonly TemplateNode[];
254
+ readonly range: SourceRange;
222
255
  }
223
- export declare class ResultExactnessError extends Error {
224
- static readonly code: "BRAID_RESULT_EXACTNESS";
225
- readonly code: "BRAID_RESULT_EXACTNESS";
226
- constructor(message?: string);
256
+ export interface ChooseWhen {
257
+ readonly condition: number;
258
+ readonly children: readonly TemplateNode[];
259
+ readonly range: SourceRange;
227
260
  }
228
- export type PublicErrorCategory = "runtime" | "adapter" | "compiler";
229
- export interface PublicErrorDefinition {
230
- readonly code: string;
231
- readonly category: PublicErrorCategory;
232
- readonly owner: string;
261
+ export interface ChooseNode {
262
+ readonly kind: "choose";
263
+ readonly whens: readonly ChooseWhen[];
264
+ readonly otherwise?: readonly TemplateNode[];
265
+ readonly range: SourceRange;
266
+ }
267
+ export interface TrimAttributes {
268
+ readonly prefix: string;
269
+ readonly prefixOverrides: readonly string[];
270
+ readonly suffix: string;
271
+ readonly suffixOverrides: readonly string[];
272
+ }
273
+ export interface TrimNode {
274
+ readonly kind: "trim";
275
+ readonly attributes: TrimAttributes;
276
+ readonly children: readonly TemplateNode[];
277
+ readonly range: SourceRange;
278
+ }
279
+ export type TemplateNode = TextNode | BindNode | FragmentNode | IdentifierNode | RawNode | ListNode | IfNode | ChooseNode | TrimNode;
280
+ /** Frozen template intermediate representation with source ranges and optional raw-text parallel nodes. */
281
+ export interface TemplateIr {
282
+ readonly version: 1;
283
+ readonly nodes: readonly TemplateNode[];
284
+ readonly sourceLength: number;
233
285
  /**
234
- * UnsupportedFeatureError only: features for which this code is a public
235
- * contract. Other public errors intentionally omit this metadata.
286
+ * Optional parallel node tree preserving raw JavaScript template text for
287
+ * native tagged-template transports. The logical node tree remains cooked.
236
288
  */
237
- readonly features?: readonly string[];
238
- }
239
- /**
240
- * The intentionally small compatibility boundary for SQLBraid-owned errors.
241
- *
242
- * Keep this registry explicit. In particular, a BRAID_ token in a driver
243
- * message or an internal compiler fallback is not public merely because it
244
- * happens to use the project prefix.
245
- */
246
- export declare const PUBLIC_ERROR_DEFINITIONS: readonly PublicErrorDefinition[];
247
- export declare function decodeExactInteger(value: unknown, range?: ExactIntegerRange): bigint;
248
- /**
249
- * Normalize an exact integer at the raw SQLBraid boundary without changing
250
- * its textual spelling. This is intentionally not a bigint decoder: callers
251
- * that need arithmetic may opt in to decodeExactInteger().
252
- */
253
- export declare function normalizeExactInteger(value: unknown): string;
254
- /**
255
- * Convert a database-reported count to a safe operational Number. Counts are
256
- * not application values, so unlike exact SQL numerics they remain numbers,
257
- * but narrowing an unsafe value is never implicit.
258
- */
259
- export declare function safeDatabaseCount(value: unknown): number;
260
- export declare function decodeExactDecimal(value: unknown, options?: {
261
- readonly allowBigInt?: boolean;
262
- }): string;
263
- export type RoutineParameterDirection = "in" | "out" | "inout";
264
- export interface RoutineProcedure {
265
- readonly name: string;
266
- readonly parameterNames: readonly string[];
289
+ readonly rawNodes?: readonly TemplateNode[];
267
290
  }
268
- export type RoutineSchema = StandardSchemaV1$1<any, any>;
269
- export interface RoutineContract<Output extends Readonly<Record<string, unknown>> = Readonly<Record<string, unknown>>, Sets extends readonly RoutineSchema[] = readonly RoutineSchema[], ReturnValue = unknown> {
270
- readonly output?: StandardSchemaV1$1<any, Output>;
271
- readonly resultSets?: Sets;
272
- readonly returnValue?: StandardSchemaV1$1<any, ReturnValue>;
273
- readonly procedure?: RoutineProcedure;
291
+ /** Explicit structural SQL fragment. Ordinary interpolations are values; fragments opt into SQL structure. */
292
+ export interface SqlFragment {
293
+ readonly [SQL_FRAGMENT]: true;
294
+ readonly ir: TemplateIr;
295
+ readonly values: readonly unknown[];
296
+ readonly dialectId: string;
274
297
  }
298
+ //#endregion
299
+ //#region src/statement.d.ts
275
300
  /**
276
301
  * A rendered parameter is always a value. Adapters MUST NOT interpret it as
277
302
  * raw SQL, an identifier, a nested query, a driver-specific fragment, or a
@@ -284,6 +309,10 @@ export interface RenderedParameter {
284
309
  readonly direction?: RoutineParameterDirection;
285
310
  readonly outputName?: string;
286
311
  }
312
+ /**
313
+ * Immutable logical statement before driver materialization.
314
+ * `segments.length` is always `parameters.length + 1`; structural SQL lives in segments and parameters remain values.
315
+ */
287
316
  export interface RenderedStatement {
288
317
  readonly segments: readonly string[];
289
318
  readonly parameters: readonly RenderedParameter[];
@@ -299,34 +328,31 @@ export interface RenderedStatement {
299
328
  readonly fingerprint?: string;
300
329
  readonly variantFingerprint?: string;
301
330
  }
302
- export interface ParameterTypeHint<Input = unknown> {
303
- readonly databaseType: string;
304
- readonly length?: number | "max";
305
- readonly precision?: number;
306
- readonly scale?: number;
307
- readonly __input?: Input;
308
- }
309
- export interface BoundParameter<Input = unknown> {
310
- readonly value: Input;
311
- readonly hint: ParameterTypeHint<Input>;
312
- readonly [boundParameterBrand]: true;
313
- }
314
- export interface RoutineParameter<Input = unknown> {
315
- readonly value: Input;
316
- readonly hint?: ParameterTypeHint;
317
- readonly direction: Exclude<RoutineParameterDirection, "in">;
318
- readonly outputName: string;
331
+ /** One logical command shape plus its value matrix; all rows must remain homogeneous. */
332
+ export interface RenderedBulk {
333
+ readonly statement: RenderedStatement;
334
+ readonly parameterSets: readonly (readonly unknown[])[];
319
335
  }
320
- export declare function createParameterTypeHint<Input = unknown>(hint: ParameterTypeHint<Input>): ParameterTypeHint<Input>;
321
- export declare function createBoundParameter<Input>(value: NoInfer<Input>, hint: ParameterTypeHint<Input>): BoundParameter<Input>;
322
- export declare function isBoundParameter(value: unknown): value is BoundParameter;
323
- export declare function createRoutineOutParameter(name: string, hint?: ParameterTypeHint): RoutineParameter<null>;
324
- export declare function createRoutineInOutParameter<Input>(name: string, value: NoInfer<Input>, hint?: ParameterTypeHint<Input>): RoutineParameter<Input>;
325
- export declare function isRoutineParameter(value: unknown): value is RoutineParameter;
336
+ export declare function createRenderedBulk(bulk: RenderedBulk): RenderedBulk;
337
+ /** Validate and freeze one logical statement without creating a second mutable SQL/value source of truth. */
338
+ /** @throws {TypeError|SqlRenderError} For broken segment/parameter invariants or unsupported bind values. */
339
+ export declare function createRenderedStatement(statement: {
340
+ readonly segments: readonly string[];
341
+ readonly parameters: readonly RenderedParameter[];
342
+ readonly nativeTemplate?: TemplateStringsArray;
343
+ readonly resultKind: QueryResultKind;
344
+ readonly routineProcedure?: RoutineProcedure;
345
+ readonly dialectId: string;
346
+ readonly fingerprint?: string;
347
+ readonly variantFingerprint?: string;
348
+ }): RenderedStatement;
349
+ //#endregion
350
+ //#region src/binding.d.ts
326
351
  export type ParameterTransportKind = "native-value-template" | "text-positional" | "text-named" | "typed-request";
327
352
  export type RequestedReuse = "auto" | "simple" | "reuse";
328
353
  export type EffectiveReuse = "simple" | "reuse";
329
354
  export type ReuseOwner = "sqlbraid" | "driver" | "server";
355
+ /** Inputs to pure binding description. Placeholder syntax and prepared reuse remain adapter-owned. */
330
356
  export interface StatementBindingContext {
331
357
  readonly dialectId: string;
332
358
  readonly requestedReuse: RequestedReuse;
@@ -341,12 +367,14 @@ export interface BindingDescription {
341
367
  readonly direction?: RoutineParameterDirection;
342
368
  readonly outputName?: string;
343
369
  }
370
+ /** Diagnostic-only literalization controls; the result must never be sent to a database. */
344
371
  export interface LiteralizeOptions {
345
372
  readonly values?: "inline" | "redacted";
346
373
  readonly maxValueLength?: number;
347
374
  readonly binary?: "summary" | "full";
348
375
  readonly redact?: (parameter: RenderedParameter, index: number) => boolean;
349
376
  }
377
+ /** Diagnostic SQL reconstruction with explicit redaction/truncation evidence. */
350
378
  export interface LiteralizedSqlResult {
351
379
  readonly text: string;
352
380
  /**
@@ -358,6 +386,10 @@ export interface LiteralizedSqlResult {
358
386
  readonly redactedParameters: number;
359
387
  readonly truncatedParameters: number;
360
388
  }
389
+ /**
390
+ * Immutable transport description derived from one logical statement.
391
+ * `literalizedSql()` reconstructs diagnostics from segments and values; it is never execution input.
392
+ */
361
393
  export interface StatementBindingDescription {
362
394
  readonly adapterId: string;
363
395
  readonly dialectId: string;
@@ -373,6 +405,10 @@ export interface StatementBindingDescription {
373
405
  /** Diagnostic reconstruction only; never use this text as execution input. */
374
406
  readonly literalizedSql: (options?: LiteralizeOptions) => LiteralizedSqlResult;
375
407
  }
408
+ /**
409
+ * Driver-owned binding policy. Implementations choose transport, placeholders, type encoding, and reuse ownership.
410
+ * `describe` must be pure and safe to run before connection acquisition.
411
+ */
376
412
  export interface StatementBindingAdapter {
377
413
  readonly id: string;
378
414
  describe(statement: RenderedStatement, context: StatementBindingContext): StatementBindingDescription;
@@ -389,10 +425,7 @@ export interface StatementBindingDescriptionOptions {
389
425
  };
390
426
  readonly formatLiteral?: (parameter: RenderedParameter, index: number, options: LiteralizeOptions) => string | undefined;
391
427
  }
392
- export interface RenderedBulk {
393
- readonly statement: RenderedStatement;
394
- readonly parameterSets: readonly (readonly unknown[])[];
395
- }
428
+ /** Binding metadata for a homogeneous bulk operation; values are fetched by item index. */
396
429
  export interface BulkBindingDescription {
397
430
  readonly adapterId: string;
398
431
  readonly dialectId: string;
@@ -403,29 +436,18 @@ export interface BulkBindingDescription {
403
436
  valuesAt(index: number): readonly unknown[];
404
437
  literalizedSql(index: number, options?: LiteralizeOptions): LiteralizedSqlResult;
405
438
  }
406
- /**
407
- * Normalize and snapshot a homogeneous bulk's logical statement and value
408
- * matrix. Values themselves are application-owned and are not cloned.
409
- */
410
- export declare function createRenderedBulk(bulk: RenderedBulk): RenderedBulk;
411
- export declare function createRenderedStatement(statement: {
412
- readonly segments: readonly string[];
413
- readonly parameters: readonly RenderedParameter[];
414
- readonly nativeTemplate?: TemplateStringsArray;
415
- readonly resultKind: QueryResultKind;
416
- readonly routineProcedure?: RoutineProcedure;
417
- readonly dialectId: string;
418
- readonly fingerprint?: string;
419
- readonly variantFingerprint?: string;
420
- }): RenderedStatement;
439
+ /** Materialize placeholder text as a derived view; this helper does not own reuse or driver transport policy. */
421
440
  export declare function parameterizedSql(statement: RenderedStatement, placeholder: (index: number) => string): string;
441
+ /** Build an immutable binding description before I/O, including adapter reuse policy and diagnostic literalization. */
422
442
  export declare function createStatementBindingDescription(statement: RenderedStatement, context: StatementBindingContext, options: StatementBindingDescriptionOptions): StatementBindingDescription;
423
443
  /**
424
- * Build one binding description for a logical bulk statement. The statement
425
- * metadata is shared by every parameter set; values and diagnostics are
426
- * addressed only when requested for a particular item.
444
+ * Build one binding description for a homogeneous bulk statement without cloning application-owned values.
445
+ * Statement metadata is shared by every parameter set; values and diagnostics are addressed by item index.
427
446
  */
428
447
  export declare function createBulkBindingDescription(bulk: RenderedBulk, context: StatementBindingContext, options: StatementBindingDescriptionOptions): BulkBindingDescription;
448
+ //#endregion
449
+ //#region src/dialect.d.ts
450
+ /** Lexical features the template parser must know to avoid treating SQL text inside comments/quotes as directives. */
429
451
  export interface DialectLexicalProfile {
430
452
  readonly lineCommentPrefixes: readonly string[];
431
453
  /** Require whitespace/control after -- (MySQL/MariaDB). Defaults to false. */
@@ -436,104 +458,37 @@ export interface DialectLexicalProfile {
436
458
  readonly supportsDollarQuotes?: boolean;
437
459
  readonly supportsBacktickIdentifiers?: boolean;
438
460
  readonly supportsBracketIdentifiers?: boolean;
439
- readonly supportsOracleQQuotes?: boolean;
440
- readonly backslashEscapes?: boolean;
441
- }
442
- export interface Dialect {
443
- readonly id: string;
444
- quoteIdentifier(identifier: string): string;
445
- readonly lexicalProfile?: DialectLexicalProfile;
446
- }
447
- export interface TypeMapping {
448
- readonly databaseType: string;
449
- readonly inputType: string;
450
- readonly outputType: string;
451
- readonly nullable: boolean;
452
- readonly numeric?: NumericTypeContract;
453
- }
454
- export interface TypePolicy {
455
- readonly id: string;
456
- readonly hash: string;
457
- readonly mappings: readonly TypeMapping[];
458
- decode(databaseType: string, value: unknown): unknown;
459
- encode(databaseType: string, value: unknown): unknown;
460
- }
461
- export interface TextNode {
462
- readonly kind: "text";
463
- readonly text: string;
464
- readonly range: SourceRange;
465
- }
466
- export interface BindNode {
467
- readonly kind: "bind";
468
- readonly interpolation: number;
469
- readonly range: SourceRange;
470
- }
471
- export interface FragmentNode {
472
- readonly kind: "fragment";
473
- readonly fragment: SqlFragment;
474
- readonly range: SourceRange;
475
- }
476
- export interface IdentifierNode {
477
- readonly kind: "identifier";
478
- readonly value: string | readonly string[];
479
- readonly range: SourceRange;
480
- }
481
- export interface RawNode {
482
- readonly kind: "raw";
483
- readonly text: string;
484
- readonly range: SourceRange;
485
- }
486
- export interface ListNode {
487
- readonly kind: "list";
488
- readonly values: readonly unknown[];
489
- readonly range: SourceRange;
490
- }
491
- export interface IfNode {
492
- readonly kind: "if";
493
- readonly condition: number;
494
- readonly children: readonly TemplateNode[];
495
- readonly range: SourceRange;
496
- }
497
- export interface ChooseWhen {
498
- readonly condition: number;
499
- readonly children: readonly TemplateNode[];
500
- readonly range: SourceRange;
501
- }
502
- export interface ChooseNode {
503
- readonly kind: "choose";
504
- readonly whens: readonly ChooseWhen[];
505
- readonly otherwise?: readonly TemplateNode[];
506
- readonly range: SourceRange;
507
- }
508
- export interface TrimAttributes {
509
- readonly prefix: string;
510
- readonly prefixOverrides: readonly string[];
511
- readonly suffix: string;
512
- readonly suffixOverrides: readonly string[];
513
- }
514
- export interface TrimNode {
515
- readonly kind: "trim";
516
- readonly attributes: TrimAttributes;
517
- readonly children: readonly TemplateNode[];
518
- readonly range: SourceRange;
461
+ readonly supportsOracleQQuotes?: boolean;
462
+ readonly backslashEscapes?: boolean;
519
463
  }
520
- export type TemplateNode = TextNode | BindNode | FragmentNode | IdentifierNode | RawNode | ListNode | IfNode | ChooseNode | TrimNode;
521
- export interface TemplateIr {
522
- readonly version: 1;
523
- readonly nodes: readonly TemplateNode[];
524
- readonly sourceLength: number;
525
- /**
526
- * Optional parallel node tree preserving raw JavaScript template text for
527
- * native tagged-template transports. The logical node tree remains cooked.
528
- */
529
- readonly rawNodes?: readonly TemplateNode[];
464
+ /** SQL dialect boundary: identifier quoting plus lexical behavior used by template parsing and trimming. */
465
+ export interface Dialect {
466
+ readonly id: string;
467
+ quoteIdentifier(identifier: string): string;
468
+ readonly lexicalProfile?: DialectLexicalProfile;
530
469
  }
531
- export interface SqlFragment {
532
- readonly [SQL_FRAGMENT]: true;
533
- readonly ir: TemplateIr;
534
- readonly values: readonly unknown[];
535
- readonly dialectId: string;
470
+ /** One database type's input/output representation and numeric fidelity claim. */
471
+ export interface TypeMapping {
472
+ readonly databaseType: string;
473
+ readonly inputType: string;
474
+ readonly outputType: string;
475
+ readonly nullable: boolean;
476
+ readonly numeric?: NumericTypeContract;
477
+ }
478
+ /** Adapter type policy; it normalizes driver values and encodes inputs without becoming a schema validator. */
479
+ export interface TypePolicy {
480
+ readonly id: string;
481
+ readonly hash: string;
482
+ readonly mappings: readonly TypeMapping[];
483
+ decode(databaseType: string, value: unknown): unknown;
484
+ encode(databaseType: string, value: unknown): unknown;
536
485
  }
486
+ //#endregion
487
+ //#region src/query.d.ts
488
+ /**
489
+ * SQLBraid query value. It retains template IR and application mapping metadata until runtime rendering.
490
+ * `resultSchema` is applied after driver materialization and is never forwarded to the driver.
491
+ */
537
492
  export interface Query<Row = unknown, Kind extends QueryResultKind = "unknown"> {
538
493
  readonly ir: TemplateIr;
539
494
  readonly values: readonly unknown[];
@@ -549,17 +504,20 @@ export interface Query<Row = unknown, Kind extends QueryResultKind = "unknown">
549
504
  export type RowQuery<Row = unknown> = Query<Row, "rows">;
550
505
  export type CommandQuery = Query<CommandResult, "command">;
551
506
  export type CallQuery<Result extends RoutineCallResult = RoutineCallResult> = Query<Result, "call">;
507
+ /** Driver-normalized command metadata; adapters may expose additional native fields without changing the kind. */
552
508
  export interface CommandResult {
553
509
  readonly affectedRows?: number;
554
510
  readonly insertId?: string;
555
511
  readonly [key: string]: unknown;
556
512
  }
513
+ /** Materialized row result. Runtime validates that it matches a rows query declaration. */
557
514
  export interface RowsExecutionResult<Row = unknown> {
558
515
  readonly kind: "rows";
559
516
  readonly rows: readonly Row[];
560
517
  readonly rowCount?: number;
561
518
  readonly command?: never;
562
519
  }
520
+ /** Materialized command result. Command executions intentionally expose no row payload. */
563
521
  export interface CommandExecutionResult {
564
522
  readonly kind: "command";
565
523
  readonly rows: readonly [];
@@ -567,125 +525,173 @@ export interface CommandExecutionResult {
567
525
  readonly command: CommandResult;
568
526
  }
569
527
  export type QueryExecutionResult<Row = unknown> = RowsExecutionResult<Row> | CommandExecutionResult;
528
+ /** Execution controls shared by materialized, routine, batch, and stream operations. */
570
529
  export interface ExecutionOptions {
571
530
  readonly signal?: AbortSignal;
572
531
  }
532
+ /** Physical SPI may complete synchronously; the public database surface remains asynchronous. */
573
533
  export type Awaitable<T> = T | PromiseLike<T>;
534
+ /** Optional Standard Schema mapping applied after query-bound mapping and driver materialization. */
574
535
  export interface RowValidationOptions<Row> extends ExecutionOptions {
575
536
  readonly schema?: StandardSchemaV1$1<unknown, NoInfer<Row>>;
576
537
  }
577
538
  export interface StreamOptions<Row> extends RowValidationOptions<Row> {}
539
+ /** Portable transaction isolation vocabulary; adapters reject levels they cannot provide. */
578
540
  export type TransactionIsolation = "read-uncommitted" | "read-committed" | "repeatable-read" | "serializable";
541
+ /** Options for the outer physical transaction. Nested `db.tx()` calls are savepoints and accept no second option set. */
579
542
  export interface TransactionOptions {
580
543
  readonly isolation?: TransactionIsolation;
581
544
  readonly readOnly?: boolean;
582
545
  }
583
- export declare class UnsupportedFeatureError extends Error {
584
- readonly feature: string;
585
- readonly code: `BRAID_${string}`;
586
- constructor(feature: string, code: `BRAID_${string}`, message: string, options?: ErrorOptions);
587
- }
588
- /** Return true only for a registered, semantically valid feature/code pair. */
589
- export declare function isPublicUnsupportedFeatureError(error: unknown): error is UnsupportedFeatureError;
590
- /** An adapter-owned input/transport failure that retains TypeError semantics. */
591
- export declare class AdapterError extends TypeError {
592
- readonly code: `BRAID_${string}`;
593
- constructor(code: `BRAID_${string}`, message: string, options?: ErrorOptions);
594
- }
595
- export interface RoutineResultSet<Row = unknown> {
596
- readonly rows: readonly Row[];
546
+ //#endregion
547
+ //#region src/environment.d.ts
548
+ export interface EnvironmentCapability {
549
+ readonly status: "guaranteed" | "guarded" | "unsupported";
550
+ readonly canonical?: "string" | "number" | "Uint8Array";
551
+ readonly rawRepresentations?: readonly string[];
552
+ readonly conditionCode?: string;
597
553
  }
598
- export type RoutineResultSetTuple<Sets extends readonly unknown[]> = { readonly [K in keyof Sets]: RoutineResultSet<Sets[K]>; };
599
- export interface RoutineCallResult<Output extends Readonly<Record<string, unknown>> = Readonly<Record<string, unknown>>, Sets extends readonly unknown[] = readonly unknown[], ReturnValue = unknown> {
600
- readonly output: Output;
601
- readonly resultSets: RoutineResultSetTuple<Sets>;
602
- readonly returnValue?: ReturnValue;
554
+ /** Observed database/driver/runtime evidence plus exact support-target matching. */
555
+ export interface DatabaseEnvironment {
556
+ readonly database: {
557
+ readonly product: string;
558
+ readonly version?: string;
559
+ readonly edition?: string;
560
+ };
561
+ readonly driver: {
562
+ readonly id: string;
563
+ readonly version?: string;
564
+ readonly profile?: string;
565
+ };
566
+ readonly runtime: {
567
+ readonly id: string;
568
+ readonly version?: string;
569
+ };
570
+ readonly typePolicy?: {
571
+ readonly id: string;
572
+ readonly hash: string;
573
+ };
574
+ readonly capabilities: Readonly<Record<string, EnvironmentCapability>>;
575
+ readonly supportMatch: {
576
+ readonly status: "official" | "conditional" | "compatible";
577
+ readonly targetId?: string;
578
+ readonly reason?: string;
579
+ };
603
580
  }
604
- export type RoutineSchemaOutput<Schema> = Schema extends StandardSchemaV1$1<any, infer Output> ? Output : never;
605
- type RoutineRowsFromSchemas<Schemas extends readonly RoutineSchema[]> = { readonly [K in keyof Schemas]: RoutineSchemaOutput<Schemas[K]>; };
606
- export type RoutineResultFromContract<Contract extends RoutineContract> = RoutineCallResult<Contract["output"] extends RoutineSchema ? RoutineSchemaOutput<Contract["output"]> extends Readonly<Record<string, unknown>> ? RoutineSchemaOutput<Contract["output"]> : Readonly<Record<string, unknown>> : Readonly<Record<string, unknown>>, Contract["resultSets"] extends (infer Schemas extends readonly RoutineSchema[]) ? RoutineRowsFromSchemas<Schemas> : readonly unknown[], Contract["returnValue"] extends RoutineSchema ? RoutineSchemaOutput<Contract["returnValue"]> : unknown> & (Contract extends {
607
- readonly returnValue: RoutineSchema;
608
- } ? {
609
- readonly returnValue: RoutineSchemaOutput<Contract["returnValue"]>;
610
- } : {});
611
- export type RoutineResultSource = {
612
- readonly kind: "out-cursor";
613
- readonly name?: string;
614
- readonly parameterIndex?: number;
615
- } | {
616
- readonly kind: "implicit";
617
- readonly index: number;
618
- } | {
619
- readonly kind: "emitted";
620
- readonly index: number;
621
- };
622
- export interface DriverRoutineResultSet {
623
- readonly rows: readonly unknown[];
624
- readonly source: RoutineResultSource;
581
+ /** Adapter evidence only. Probes run through the ordinary observed, leased query path. */
582
+ export interface DriverEnvironment {
583
+ readonly database: DatabaseEnvironment["database"];
584
+ readonly driver: DatabaseEnvironment["driver"];
585
+ readonly typePolicy?: {
586
+ readonly id: string;
587
+ readonly hash: string;
588
+ };
589
+ readonly capabilities: DatabaseEnvironment["capabilities"];
590
+ readonly probe?: {
591
+ readonly statement: RenderedStatement;
592
+ readonly read: (rows: readonly unknown[]) => {
593
+ readonly version?: string;
594
+ readonly edition?: string;
595
+ readonly capabilities?: Readonly<Record<string, EnvironmentCapability>>;
596
+ };
597
+ };
625
598
  }
626
- export interface DriverRoutineResult {
627
- readonly output: Readonly<Record<string, unknown>>;
628
- readonly returnValue?: unknown;
629
- readonly resultSets: readonly DriverRoutineResultSet[];
599
+ /** Structural subset of a support manifest; importing support tooling is unnecessary. */
600
+ export interface EnvironmentSupportTarget {
601
+ readonly id: string;
602
+ readonly status: string;
603
+ readonly database: {
604
+ readonly product: string;
605
+ readonly version: string;
606
+ readonly edition: string;
607
+ };
608
+ readonly driver: {
609
+ readonly id: string;
610
+ readonly version: string;
611
+ readonly profile: string;
612
+ };
613
+ readonly runtime: {
614
+ readonly id: string;
615
+ readonly version: string;
616
+ };
617
+ readonly typePolicy: {
618
+ readonly id: string;
619
+ readonly hash: string;
620
+ };
621
+ readonly evidence: {
622
+ readonly status: string;
623
+ };
630
624
  }
631
- export type RoutineMappingLocation = {
632
- readonly kind: "output";
633
- } | {
634
- readonly kind: "return-value";
635
- } | {
636
- readonly kind: "result-set";
637
- readonly resultSetIndex: number;
638
- readonly rowIndex: number;
639
- };
640
- export type DriverCapabilityErrorCode = "BRAID_STREAM_UNSUPPORTED" | "BRAID_CALL_UNSUPPORTED" | "BRAID_CALL_RESULT_SETS" | "BRAID_CALL_CURSOR_TX_REQUIRED" | "BRAID_CALL_OUT_UNSUPPORTED" | "BRAID_CALL_RETURN_UNSUPPORTED" | "BRAID_CALL_CURSOR_UNSUPPORTED" | "BRAID_RESOURCE_CLEANUP";
641
- export declare class RoutineMappingError extends Error {
642
- static readonly code: "BRAID_CALL_MAP";
643
- readonly code: "BRAID_CALL_MAP";
644
- readonly location: RoutineMappingLocation;
645
- constructor(message: string, location: RoutineMappingLocation, options?: {
646
- readonly cause?: unknown;
647
- });
625
+ export interface EnvironmentOptions {
626
+ readonly targets?: readonly EnvironmentSupportTarget[];
627
+ /** Re-probe the current lease instead of returning the cached observation. */
628
+ readonly refresh?: boolean;
648
629
  }
630
+ //#endregion
631
+ //#region src/executor.d.ts
632
+ /** Native or adapter execution strategy reported for a bulk operation; the label does not imply atomicity. */
649
633
  export type BulkExecutionMode = "native-bulk" | "pipeline" | "prepared-loop" | "remote-batch";
634
+ /** Driver bulk result normalized for runtime accounting and observer events. */
650
635
  export interface BulkExecutionResult {
651
636
  readonly inputCount: number;
652
637
  readonly affectedRows?: number;
653
638
  readonly executionMode: BulkExecutionMode;
654
639
  }
640
+ /**
641
+ * Physical execution SPI for one serialized resource.
642
+ * Query/call/control methods may be synchronous at this boundary; streams remain async iterables and retain ownership until closed.
643
+ */
655
644
  export interface QueryExecutor {
656
645
  /** Stable identity for the physical execution resource shared by wrappers; pools must use a leased resource. */
657
646
  readonly ownershipKey?: object;
658
647
  readonly statementBinding: StatementBindingAdapter;
659
648
  readonly environment?: DriverEnvironment;
649
+ /** Execute one materialized statement on this physical resource. */
660
650
  query<Row>(rendered: RenderedStatement, binding?: StatementBindingDescription, options?: ExecutionOptions): Awaitable<QueryExecutionResult<Row>>;
651
+ /** Open a true driver stream; the physical resource remains owned until iteration closes. */
661
652
  stream<Row>(rendered: RenderedStatement, binding?: StatementBindingDescription, options?: ExecutionOptions): AsyncIterable<Row>;
653
+ /** Execute a routine call and return normalized scalar/result-set channels. */
662
654
  call(rendered: RenderedStatement, binding?: StatementBindingDescription, options?: ExecutionOptions): Awaitable<DriverRoutineResult>;
655
+ /** Optional homogeneous bulk protocol. The reported execution mode does not imply atomicity. */
663
656
  bulk?(bulk: RenderedBulk, binding: BulkBindingDescription, options?: ExecutionOptions): Awaitable<BulkExecutionResult>;
657
+ /** Pure pre-acquire validation for adapter-specific transaction option support. */
664
658
  validateTransactionOptions?(options: TransactionOptions): void;
659
+ /** Begin the outer transaction on this physical resource. */
665
660
  begin?(options?: TransactionOptions): Awaitable<void>;
661
+ /** Commit the outer transaction on this physical resource. */
666
662
  commit?(): Awaitable<void>;
663
+ /** Roll back the outer transaction on this physical resource. */
667
664
  rollback?(): Awaitable<void>;
665
+ /** Create a nested transaction boundary on the current resource. */
668
666
  savepoint?(name: string): Awaitable<void>;
667
+ /** Roll back the current resource to a previously created savepoint. */
669
668
  rollbackTo?(name: string): Awaitable<void>;
669
+ /** End the logical savepoint boundary; adapters may implement this as a no-op when the database releases implicitly. */
670
670
  releaseSavepoint?(name: string): Awaitable<void>;
671
671
  }
672
+ /** Acquired physical resource. The lease owns release/discard, while runtime owns operation serialization. */
672
673
  export interface ConnectionLease extends QueryExecutor {
673
674
  release(options?: {
674
675
  readonly discard?: boolean;
675
676
  }): void | Promise<void>;
676
677
  }
678
+ /** Lease factory for pools; acquiring one lease is the boundary that establishes physical connection ownership. */
677
679
  export interface ConnectionProvider {
678
680
  readonly statementBinding: StatementBindingAdapter;
679
681
  readonly environment?: DriverEnvironment;
680
682
  validateTransactionOptions?(options: TransactionOptions): void;
681
683
  acquire(): Promise<ConnectionLease>;
682
684
  }
685
+ //#endregion
686
+ //#region src/observers.d.ts
687
+ /** Immutable observer projection of adapter transport and reuse decisions. */
683
688
  export interface QueryExecutionPlan {
684
689
  readonly adapterId: string;
685
690
  readonly dialectId: string;
686
691
  readonly transport: ParameterTransportKind;
687
692
  readonly reuse: StatementBindingDescription["reuse"];
688
693
  }
694
+ /** Observer event emitted after rendering and binding, before physical execution. */
689
695
  export interface QueryReadyEvent {
690
696
  readonly type: "query:ready";
691
697
  readonly purpose?: "environment";
@@ -709,6 +715,7 @@ export interface QueryReadyEvent {
709
715
  readonly transactionDepth: number;
710
716
  readonly transactionScoped: boolean;
711
717
  }
718
+ /** Observer event emitted after driver materialization and result-kind validation, before mapping. */
712
719
  export interface QueryResultEvent {
713
720
  readonly type: "query:result";
714
721
  readonly purpose?: "environment";
@@ -725,6 +732,7 @@ export interface QueryResultEvent {
725
732
  readonly transactionDepth: number;
726
733
  readonly transactionScoped: boolean;
727
734
  }
735
+ /** Observer event emitted after query-bound and execution-level mapping completes. */
728
736
  export interface QueryMappedEvent {
729
737
  readonly type: "query:mapped";
730
738
  readonly purpose?: "environment";
@@ -738,6 +746,7 @@ export interface QueryMappedEvent {
738
746
  readonly transactionDepth: number;
739
747
  readonly transactionScoped: boolean;
740
748
  }
749
+ /** Observer event emitted after the complete homogeneous bulk is prepared, before physical execution. */
741
750
  export interface BulkReadyEvent {
742
751
  readonly type: "bulk:ready";
743
752
  readonly operationId: string;
@@ -748,6 +757,7 @@ export interface BulkReadyEvent {
748
757
  readonly valuesAt: (index: number) => readonly unknown[];
749
758
  readonly literalizedSql: (index: number, options?: LiteralizeOptions) => LiteralizedSqlResult;
750
759
  }
760
+ /** Observer event emitted after bulk execution and result normalization. */
751
761
  export interface BulkResultEvent {
752
762
  readonly type: "bulk:result";
753
763
  readonly operationId: string;
@@ -759,6 +769,7 @@ export interface BulkResultEvent {
759
769
  readonly transactionScoped: boolean;
760
770
  }
761
771
  export type QueryErrorStage = "render" | "prepared" | "observer-before" | "materialize" | "acquire" | "driver" | "result-kind" | "cardinality" | "query-map" | "execution-map" | "observer-after" | "release" | "stream" | "transaction";
772
+ /** Observer event describing the stage and truthful execution flags for a failed operation. */
762
773
  export interface QueryErrorEvent {
763
774
  readonly type: "query:error";
764
775
  readonly purpose?: "environment";
@@ -773,6 +784,7 @@ export interface QueryErrorEvent {
773
784
  readonly transactionDepth: number;
774
785
  readonly transactionScoped: boolean;
775
786
  }
787
+ /** Observer event emitted when a stream is admitted and its lease is about to be retained. */
776
788
  export interface StreamStartEvent {
777
789
  readonly type: "stream:start";
778
790
  readonly operationId: string;
@@ -790,115 +802,40 @@ export interface StreamStartEvent {
790
802
  readonly declaredKind: "rows";
791
803
  readonly variantFingerprint?: string;
792
804
  readonly preparedName?: string;
793
- readonly transactionDepth: number;
794
- readonly transactionScoped: boolean;
795
- }
796
- export interface StreamEndEvent {
797
- readonly type: "stream:end";
798
- readonly operationId: string;
799
- readonly status: "completed" | "error";
800
- readonly durationMs: number;
801
- readonly rowCount: number;
802
- readonly error?: unknown;
803
- readonly transactionDepth: number;
804
- readonly transactionScoped: boolean;
805
- }
806
- export type TransactionEventPhase = "begin" | "commit" | "rollback" | "savepoint" | "rollback-to-savepoint" | "release-savepoint";
807
- export interface TransactionEvent {
808
- readonly type: "transaction";
809
- readonly transactionId: string;
810
- readonly phase: TransactionEventPhase;
811
- readonly status: "requested" | "completed" | "failed";
812
- readonly depth: number;
813
- readonly savepointName?: string;
814
- readonly durationMs?: number;
815
- readonly error?: unknown;
816
- }
817
- export type ExecutionEvent = QueryReadyEvent | QueryResultEvent | QueryMappedEvent | BulkReadyEvent | BulkResultEvent | QueryErrorEvent | StreamStartEvent | StreamEndEvent | TransactionEvent;
818
- export interface ExecutionObserver {
819
- onEvent(event: ExecutionEvent): void | Promise<void>;
820
- }
821
- export interface EnvironmentCapability {
822
- readonly status: "guaranteed" | "guarded" | "unsupported";
823
- readonly canonical?: "string" | "number" | "Uint8Array";
824
- readonly rawRepresentations?: readonly string[];
825
- readonly conditionCode?: string;
826
- }
827
- export interface DatabaseEnvironment {
828
- readonly database: {
829
- readonly product: string;
830
- readonly version?: string;
831
- readonly edition?: string;
832
- };
833
- readonly driver: {
834
- readonly id: string;
835
- readonly version?: string;
836
- readonly profile?: string;
837
- };
838
- readonly runtime: {
839
- readonly id: string;
840
- readonly version?: string;
841
- };
842
- readonly typePolicy?: {
843
- readonly id: string;
844
- readonly hash: string;
845
- };
846
- readonly capabilities: Readonly<Record<string, EnvironmentCapability>>;
847
- readonly supportMatch: {
848
- readonly status: "official" | "conditional" | "compatible";
849
- readonly targetId?: string;
850
- readonly reason?: string;
851
- };
852
- }
853
- /** Adapter evidence only. Probes run through the ordinary observed, leased query path. */
854
- export interface DriverEnvironment {
855
- readonly database: DatabaseEnvironment["database"];
856
- readonly driver: DatabaseEnvironment["driver"];
857
- readonly typePolicy?: {
858
- readonly id: string;
859
- readonly hash: string;
860
- };
861
- readonly capabilities: DatabaseEnvironment["capabilities"];
862
- readonly probe?: {
863
- readonly statement: RenderedStatement;
864
- readonly read: (rows: readonly unknown[]) => {
865
- readonly version?: string;
866
- readonly edition?: string;
867
- readonly capabilities?: Readonly<Record<string, EnvironmentCapability>>;
868
- };
869
- };
805
+ readonly transactionDepth: number;
806
+ readonly transactionScoped: boolean;
870
807
  }
871
- /** Structural subset of a support manifest; importing support tooling is unnecessary. */
872
- export interface EnvironmentSupportTarget {
873
- readonly id: string;
874
- readonly status: string;
875
- readonly database: {
876
- readonly product: string;
877
- readonly version: string;
878
- readonly edition: string;
879
- };
880
- readonly driver: {
881
- readonly id: string;
882
- readonly version: string;
883
- readonly profile: string;
884
- };
885
- readonly runtime: {
886
- readonly id: string;
887
- readonly version: string;
888
- };
889
- readonly typePolicy: {
890
- readonly id: string;
891
- readonly hash: string;
892
- };
893
- readonly evidence: {
894
- readonly status: string;
895
- };
808
+ /** Terminal stream event; delivery is attempted for every observer even if one observer fails. */
809
+ export interface StreamEndEvent {
810
+ readonly type: "stream:end";
811
+ readonly operationId: string;
812
+ readonly status: "completed" | "error";
813
+ readonly durationMs: number;
814
+ readonly rowCount: number;
815
+ readonly error?: unknown;
816
+ readonly transactionDepth: number;
817
+ readonly transactionScoped: boolean;
896
818
  }
897
- export interface EnvironmentOptions {
898
- readonly targets?: readonly EnvironmentSupportTarget[];
899
- /** Re-probe the current lease instead of returning the cached observation. */
900
- readonly refresh?: boolean;
819
+ export type TransactionEventPhase = "begin" | "commit" | "rollback" | "savepoint" | "rollback-to-savepoint" | "release-savepoint";
820
+ /** Transaction-control lifecycle event for outer transactions and nested savepoints. */
821
+ export interface TransactionEvent {
822
+ readonly type: "transaction";
823
+ readonly transactionId: string;
824
+ readonly phase: TransactionEventPhase;
825
+ readonly status: "requested" | "completed" | "failed";
826
+ readonly depth: number;
827
+ readonly savepointName?: string;
828
+ readonly durationMs?: number;
829
+ readonly error?: unknown;
830
+ }
831
+ export type ExecutionEvent = QueryReadyEvent | QueryResultEvent | QueryMappedEvent | BulkReadyEvent | BulkResultEvent | QueryErrorEvent | StreamStartEvent | StreamEndEvent | TransactionEvent;
832
+ /** Readonly observer hook. Observers may fail execution, but cannot rewrite SQL, binds, routing, or results. */
833
+ export interface ExecutionObserver {
834
+ onEvent(event: ExecutionEvent): void | Promise<void>;
901
835
  }
836
+ //#endregion
837
+ //#region src/database.d.ts
838
+ /** Root database behavior: observers and default prepared-reuse preference. */
902
839
  export interface DatabaseOptions {
903
840
  readonly observers?: readonly ExecutionObserver[];
904
841
  readonly reuse?: RequestedReuse;
@@ -910,6 +847,7 @@ export type PreparedFactoryOptions = {
910
847
  readonly input: "required";
911
848
  };
912
849
  export type PreparedArguments<Input, Options> = [Input] extends [never] ? [options?: Options] : [input: Input, options?: Options];
850
+ /** Prepared handle whose input arity and result helpers are fixed by the factory's query kind. */
913
851
  export type PreparedQuery<Input, Q extends PreparableQuery> = {
914
852
  readonly name: string;
915
853
  } & (Q extends CallQuery<infer Result> ? {
@@ -924,15 +862,29 @@ export type PreparedQuery<Input, Q extends PreparableQuery> = {
924
862
  } : {}));
925
863
  export type ExecutableQuery = RowQuery<unknown> | Query<unknown, "command"> | Query<unknown, "unknown">;
926
864
  export type ExecutionResultOf<Q> = Q extends RowQuery<infer Row> ? RowsExecutionResult<Row> : Q extends Query<unknown, "command"> ? CommandExecutionResult : Q extends Query<infer Row, "unknown"> ? QueryExecutionResult<Row> : never;
865
+ /**
866
+ * Async application database surface.
867
+ * Root pooled operations acquire/release per operation; `session()` and `tx()` callbacks pin a scoped resource.
868
+ * Scoped handles expire when their callback returns, and streams must close before a scope can finish.
869
+ */
927
870
  export interface Database {
871
+ /** Observe database/driver/runtime evidence and optionally match it against exact support targets. */
928
872
  environment(options?: EnvironmentOptions): Promise<DatabaseEnvironment>;
873
+ /** Materialize every row and apply query/execution mapping after the root lease is released. */
929
874
  all<Row>(query: RowQuery<Row>, options?: RowValidationOptions<Row>): Promise<readonly Row[]>;
875
+ /** Require exactly one row; cardinality is checked before application mapping. */
930
876
  one<Row>(query: RowQuery<Row>, options?: RowValidationOptions<Row>): Promise<Row>;
877
+ /** Return `undefined` for zero rows and reject when more than one row is returned. */
931
878
  maybeOne<Row>(query: RowQuery<Row>, options?: RowValidationOptions<Row>): Promise<Row | undefined>;
879
+ /** Execute a row, command, or unknown query and preserve its normalized result kind. */
932
880
  execute<Q extends ExecutableQuery>(query: Q, options?: ExecutionOptions): Promise<ExecutionResultOf<Q>>;
881
+ /** Execute a routine query and materialize all normalized routine channels before mapping. */
933
882
  call<Result extends RoutineCallResult>(query: CallQuery<Result>, options?: ExecutionOptions): Promise<Result>;
883
+ /** Execute different queries sequentially on one physical use/lease. This is not an implicit transaction. */
934
884
  batch<const Queries extends readonly ExecutableQuery[]>(queries: Queries, options?: ExecutionOptions): Promise<{ readonly [K in keyof Queries]: ExecutionResultOf<Queries[K]>; }>;
885
+ /** Execute one homogeneous command shape for many inputs using the adapter's bulk strategy. */
935
886
  bulk<Input>(inputs: readonly Input[], factory: (input: Input, index: number) => CommandQuery, options?: ExecutionOptions): Promise<BulkResult>;
887
+ /** Create a prepared handle whose first successful execution locks the logical SQLBraid shape. */
936
888
  prepare<Factory extends () => PreparableQuery>(name: string, factory: Factory & (Parameters<Factory> extends [] ? unknown : never), options: {
937
889
  readonly input: "none";
938
890
  }): PreparedQuery<never, ReturnType<Factory>>;
@@ -940,47 +892,260 @@ export interface Database {
940
892
  prepare<Factory extends (input: never) => PreparableQuery>(name: string, factory: Factory & (number extends Parameters<Factory>["length"] ? unknown : Parameters<Factory>["length"] extends 0 | 1 ? unknown : never), options: {
941
893
  readonly input: "required";
942
894
  }): PreparedQuery<Parameters<Factory>[0], ReturnType<Factory>>;
895
+ /** Stream rows without full buffering; the physical resource remains pinned until iteration closes. */
943
896
  stream<Row>(query: RowQuery<Row>, options?: StreamOptions<Row>): AsyncIterable<Row>;
897
+ /** Pin one physical resource for the callback without implicitly starting a transaction. */
944
898
  session<T>(callback: (database: Database) => Promise<T>): Promise<T>;
899
+ /** Run the callback in one physical transaction; nested calls use savepoints on the same resource. */
945
900
  tx<T>(callback: (database: Database) => Promise<T>): Promise<T>;
946
901
  tx<T>(options: TransactionOptions, callback: (database: Database) => Promise<T>): Promise<T>;
947
902
  }
903
+ /** Normalized bulk accounting; root bulk is not implicitly transactional. */
948
904
  export interface BulkResult {
949
905
  readonly inputCount: number;
950
906
  readonly affectedRows?: number;
951
907
  }
952
908
  export type QueryRow<Q> = Q extends Query<infer Row, QueryResultKind> ? Row : never;
909
+ //#endregion
910
+ //#region src/authoring.d.ts
911
+ /** Generic SQL tag shape used by configured dialect/query-kind specializations. */
953
912
  export interface SqlTagLike<Kind extends QueryResultKind = QueryResultKind, Row = unknown> {
954
913
  (strings: TemplateStringsArray, ...values: readonly unknown[]): Query<Row, Kind>;
955
914
  }
956
915
  export interface RoutineContractTag<Contract extends RoutineContract> {
957
916
  (strings: TemplateStringsArray, ...values: readonly unknown[]): CallQuery<RoutineResultFromContract<Contract>>;
958
917
  }
918
+ /** Row-specialized tag supporting either a TypeScript row type or a Standard Schema mapper. */
959
919
  export interface RowsTag {
960
920
  <Input, Output>(schema: StandardSchemaV1$1<Input, Output>): SqlTagLike<"rows", Output>;
961
921
  <Row = unknown>(strings: TemplateStringsArray, ...values: readonly unknown[]): RowQuery<Row>;
962
922
  }
923
+ /**
924
+ * SQL authoring surface. Values are bound by default; `ident`, `fragment`, `list`, `join`, and `raw` are explicit structure.
925
+ */
963
926
  export interface SqlTag extends SqlTagLike<"unknown"> {
927
+ /** Declare a row-producing query, optionally with query-bound Standard Schema mapping. */
964
928
  rows: RowsTag;
929
+ /** Declare a command query that must normalize to command metadata. */
965
930
  command: (strings: TemplateStringsArray, ...values: readonly unknown[]) => CommandQuery;
931
+ /** Declare a routine query, optionally with explicit output/result-set/return mapping contracts. */
966
932
  call: {
967
933
  <Result extends RoutineCallResult = RoutineCallResult>(strings: TemplateStringsArray, ...values: readonly unknown[]): CallQuery<Result>;
968
934
  <Contract extends RoutineContract>(contract: Contract): RoutineContractTag<Contract>;
969
935
  };
936
+ /** Attach explicit database parameter metadata without turning the value into SQL structure. */
970
937
  bind<Input>(value: NoInfer<Input>, hint: ParameterTypeHint<Input>): BoundParameter<Input>;
938
+ /** Declare a routine OUT parameter owned by the adapter. */
971
939
  out(name: string, hint?: ParameterTypeHint): RoutineParameter<null>;
940
+ /** Declare a routine INOUT parameter owned by the adapter. */
972
941
  inOut<Input>(name: string, value: NoInfer<Input>, hint?: ParameterTypeHint<Input>): RoutineParameter<Input>;
942
+ /** Create explicit SQL structure while preserving ordinary interpolations as values. */
973
943
  fragment: (strings: TemplateStringsArray, ...values: readonly unknown[]) => SqlFragment;
944
+ /** Empty structural fragment for conditional composition. */
974
945
  empty: SqlFragment;
946
+ /** Create a dialect-quoted identifier or qualified identifier path. */
975
947
  ident: (identifier: string | readonly string[]) => SqlFragment;
948
+ /** Insert verbatim SQL structure. Never pass user-controlled or otherwise untrusted text. */
976
949
  raw: (text: string) => SqlFragment;
950
+ /** Join already-structural fragments with a structural separator. */
977
951
  join: (items: readonly SqlFragment[], separator?: SqlFragment) => SqlFragment;
952
+ /** Expand an array as a structural comma-separated list of value binds. */
978
953
  list: (values: readonly unknown[]) => SqlFragment;
979
954
  }
980
- export declare class SqlRenderError extends Error {
981
- readonly code: string;
982
- constructor(code: string, message: string);
955
+ //#endregion
956
+ //#region src/authoring-modules.d.ts
957
+ /** Data-only authoring identity shared by compiler, tooling, and editor consumers. */
958
+ type AuthoringModuleCatalogEntry = {
959
+ readonly moduleSpecifier: string;
960
+ readonly dialectId?: "postgres" | "mysql" | "mariadb" | "sqlite" | "oracle" | "mssql";
961
+ readonly helperFamily: "template" | "facade";
962
+ };
963
+ export declare const AUTHORING_MODULE_CATALOG: readonly AuthoringModuleCatalogEntry[];
964
+ //#endregion
965
+ //#region src/capabilities.d.ts
966
+ /**
967
+ * The machine-readable capability vocabulary shared by adapters, support data,
968
+ * and documentation. A capability's family describes what its status proves;
969
+ * representation and metadata evidence are not execution support aliases.
970
+ */
971
+ type CapabilityFamily = "support" | "representation" | "metadata";
972
+ interface WellKnownCapability {
973
+ readonly id: string;
974
+ readonly family: CapabilityFamily;
983
975
  }
976
+ declare const definitions: readonly [{
977
+ readonly id: "sql.native-transparency";
978
+ readonly family: "support";
979
+ }, {
980
+ readonly id: "sql.generated-structure";
981
+ readonly family: "support";
982
+ }, {
983
+ readonly id: "result.rows";
984
+ readonly family: "support";
985
+ }, {
986
+ readonly id: "result.command";
987
+ readonly family: "support";
988
+ }, {
989
+ readonly id: "result.multiple-sets";
990
+ readonly family: "support";
991
+ }, {
992
+ readonly id: "result.standard-schema";
993
+ readonly family: "support";
994
+ }, {
995
+ readonly id: "numeric.exact-integer";
996
+ readonly family: "representation";
997
+ }, {
998
+ readonly id: "numeric.exact-decimal";
999
+ readonly family: "representation";
1000
+ }, {
1001
+ readonly id: "numeric.approximate-float";
1002
+ readonly family: "representation";
1003
+ }, {
1004
+ readonly id: "numeric.approximate-special";
1005
+ readonly family: "representation";
1006
+ }, {
1007
+ readonly id: "numeric.bind-exact";
1008
+ readonly family: "representation";
1009
+ }, {
1010
+ readonly id: "numeric.aggregate";
1011
+ readonly family: "representation";
1012
+ }, {
1013
+ readonly id: "numeric.command-metadata";
1014
+ readonly family: "representation";
1015
+ }, {
1016
+ readonly id: "numeric.special-values";
1017
+ readonly family: "representation";
1018
+ }, {
1019
+ readonly id: "numeric.scale-greater-than-precision";
1020
+ readonly family: "representation";
1021
+ }, {
1022
+ readonly id: "numeric.negative-scale";
1023
+ readonly family: "representation";
1024
+ }, {
1025
+ readonly id: "data.json-parsed";
1026
+ readonly family: "representation";
1027
+ }, {
1028
+ readonly id: "data.json-lossless-text";
1029
+ readonly family: "representation";
1030
+ }, {
1031
+ readonly id: "data.sql-variant";
1032
+ readonly family: "representation";
1033
+ }, {
1034
+ readonly id: "data.oracle-object";
1035
+ readonly family: "representation";
1036
+ }, {
1037
+ readonly id: "data.oracle-collection";
1038
+ readonly family: "representation";
1039
+ }, {
1040
+ readonly id: "data.vector";
1041
+ readonly family: "representation";
1042
+ }, {
1043
+ readonly id: "data.binary";
1044
+ readonly family: "representation";
1045
+ }, {
1046
+ readonly id: "data.uuid";
1047
+ readonly family: "representation";
1048
+ }, {
1049
+ readonly id: "data.temporal-native";
1050
+ readonly family: "representation";
1051
+ }, {
1052
+ readonly id: "data.temporal-lossless";
1053
+ readonly family: "representation";
1054
+ }, {
1055
+ readonly id: "data.timezone";
1056
+ readonly family: "representation";
1057
+ }, {
1058
+ readonly id: "metadata.command-safe";
1059
+ readonly family: "metadata";
1060
+ }, {
1061
+ readonly id: "dml.insert-returning";
1062
+ readonly family: "support";
1063
+ }, {
1064
+ readonly id: "dml.update-returning";
1065
+ readonly family: "support";
1066
+ }, {
1067
+ readonly id: "dml.delete-returning";
1068
+ readonly family: "support";
1069
+ }, {
1070
+ readonly id: "dml.merge-returning";
1071
+ readonly family: "support";
1072
+ }, {
1073
+ readonly id: "dml.upsert-returning";
1074
+ readonly family: "support";
1075
+ }, {
1076
+ readonly id: "session.pinned";
1077
+ readonly family: "support";
1078
+ }, {
1079
+ readonly id: "statement.prepare";
1080
+ readonly family: "support";
1081
+ }, {
1082
+ readonly id: "statement.cancel";
1083
+ readonly family: "support";
1084
+ }, {
1085
+ readonly id: "statement.stream";
1086
+ readonly family: "support";
1087
+ }, {
1088
+ readonly id: "statement.bulk";
1089
+ readonly family: "support";
1090
+ }, {
1091
+ readonly id: "execution.bulk-fidelity";
1092
+ readonly family: "support";
1093
+ }, {
1094
+ readonly id: "transaction";
1095
+ readonly family: "support";
1096
+ }, {
1097
+ readonly id: "transaction.savepoint";
1098
+ readonly family: "support";
1099
+ }, {
1100
+ readonly id: "transaction.read-only";
1101
+ readonly family: "support";
1102
+ }, {
1103
+ readonly id: "transaction.isolation.read-uncommitted";
1104
+ readonly family: "support";
1105
+ }, {
1106
+ readonly id: "transaction.isolation.read-committed";
1107
+ readonly family: "support";
1108
+ }, {
1109
+ readonly id: "transaction.isolation.repeatable-read";
1110
+ readonly family: "support";
1111
+ }, {
1112
+ readonly id: "transaction.isolation.serializable";
1113
+ readonly family: "support";
1114
+ }, {
1115
+ readonly id: "routine.call";
1116
+ readonly family: "support";
1117
+ }, {
1118
+ readonly id: "routine.out";
1119
+ readonly family: "support";
1120
+ }, {
1121
+ readonly id: "routine.inout";
1122
+ readonly family: "support";
1123
+ }, {
1124
+ readonly id: "routine.result-sets";
1125
+ readonly family: "support";
1126
+ }, {
1127
+ readonly id: "routine.out-cursor";
1128
+ readonly family: "support";
1129
+ }, {
1130
+ readonly id: "routine.return-value";
1131
+ readonly family: "support";
1132
+ }, {
1133
+ readonly id: "metadata.identity";
1134
+ readonly family: "metadata";
1135
+ }, {
1136
+ readonly id: "metadata.generated";
1137
+ readonly family: "metadata";
1138
+ }, {
1139
+ readonly id: "metadata.routines";
1140
+ readonly family: "metadata";
1141
+ }, {
1142
+ readonly id: "metadata.types";
1143
+ readonly family: "metadata";
1144
+ }];
1145
+ export declare const WELL_KNOWN_CAPABILITIES: readonly WellKnownCapability[];
1146
+ type WellKnownCapabilityId = (typeof definitions)[number]["id"];
1147
+ export declare const WELL_KNOWN_CAPABILITY_IDS: readonly WellKnownCapabilityId[];
1148
+ export declare function isWellKnownCapabilityId(value: string): value is WellKnownCapabilityId;
984
1149
  //#endregion
985
1150
  export type { AuthoringModuleCatalogEntry, CapabilityFamily, StandardSchemaV1, WellKnownCapability, WellKnownCapabilityId };
986
1151
  //# sourceMappingURL=index.d.ts.map