@prisma-next/sql-relational-core 0.5.0-dev.9 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/README.md +59 -25
  2. package/dist/codec-types-BUfBna4G.d.mts +107 -0
  3. package/dist/codec-types-BUfBna4G.d.mts.map +1 -0
  4. package/dist/{errors-D3xmG4h-.mjs → errors-BF7W5uUd.mjs} +2 -2
  5. package/dist/{errors-D3xmG4h-.mjs.map → errors-BF7W5uUd.mjs.map} +1 -1
  6. package/dist/{errors-CDvhnH7P.d.mts → errors-BgNpVAT8.d.mts} +2 -2
  7. package/dist/errors-BgNpVAT8.d.mts.map +1 -0
  8. package/dist/exports/ast.d.mts +189 -112
  9. package/dist/exports/ast.d.mts.map +1 -1
  10. package/dist/exports/ast.mjs +207 -1322
  11. package/dist/exports/ast.mjs.map +1 -1
  12. package/dist/exports/codec-descriptor-registry.d.mts +18 -0
  13. package/dist/exports/codec-descriptor-registry.d.mts.map +1 -0
  14. package/dist/exports/codec-descriptor-registry.mjs +40 -0
  15. package/dist/exports/codec-descriptor-registry.mjs.map +1 -0
  16. package/dist/exports/errors.d.mts +1 -4
  17. package/dist/exports/errors.mjs +2 -3
  18. package/dist/exports/expression.d.mts +84 -0
  19. package/dist/exports/expression.d.mts.map +1 -0
  20. package/dist/exports/expression.mjs +62 -0
  21. package/dist/exports/expression.mjs.map +1 -0
  22. package/dist/exports/middleware.d.mts +2 -0
  23. package/dist/exports/middleware.mjs +2 -0
  24. package/dist/exports/plan.d.mts +3 -3
  25. package/dist/exports/plan.mjs +27 -10
  26. package/dist/exports/plan.mjs.map +1 -1
  27. package/dist/exports/query-lane-context.d.mts +2 -3
  28. package/dist/exports/query-lane-context.mjs +1 -1
  29. package/dist/exports/types.d.mts +2 -4
  30. package/dist/exports/types.mjs +1 -1
  31. package/dist/index.d.mts +12 -12
  32. package/dist/index.mjs +8 -5
  33. package/dist/middleware-D2Wv9QIf.mjs +82 -0
  34. package/dist/middleware-D2Wv9QIf.mjs.map +1 -0
  35. package/dist/middleware-USDeR8p1.d.mts +121 -0
  36. package/dist/middleware-USDeR8p1.d.mts.map +1 -0
  37. package/dist/plan-DFpOIsKB.d.mts +44 -0
  38. package/dist/plan-DFpOIsKB.d.mts.map +1 -0
  39. package/dist/query-lane-context-C2tLZGp4.d.mts +72 -0
  40. package/dist/query-lane-context-C2tLZGp4.d.mts.map +1 -0
  41. package/dist/{sql-execution-plan-DY0WvJOW.d.mts → sql-execution-plan-ffz8TSfr.d.mts} +2 -3
  42. package/dist/sql-execution-plan-ffz8TSfr.d.mts.map +1 -0
  43. package/dist/{types-C3Hg-CVz.d.mts → types-BZcKgaYA.d.mts} +61 -24
  44. package/dist/types-BZcKgaYA.d.mts.map +1 -0
  45. package/dist/types-CK9ZJ6OU.mjs +1112 -0
  46. package/dist/types-CK9ZJ6OU.mjs.map +1 -0
  47. package/dist/{types-B5XsBeaT.d.mts → types-CL18G37a.d.mts} +3 -4
  48. package/dist/types-CL18G37a.d.mts.map +1 -0
  49. package/dist/{types-CG3u534i.d.mts → types-D6Pk1DTr.d.mts} +11 -13
  50. package/dist/types-D6Pk1DTr.d.mts.map +1 -0
  51. package/dist/util-DWmhUCEO.mjs +34 -0
  52. package/dist/util-DWmhUCEO.mjs.map +1 -0
  53. package/package.json +16 -13
  54. package/src/ast/adapter-types.ts +13 -16
  55. package/src/ast/codec-types.ts +87 -419
  56. package/src/ast/sql-codec-helpers.ts +79 -0
  57. package/src/ast/sql-codecs.ts +285 -125
  58. package/src/ast/types.ts +222 -173
  59. package/src/ast/util.ts +23 -0
  60. package/src/ast/validate-param-refs.ts +39 -0
  61. package/src/codec-descriptor-registry.ts +52 -0
  62. package/src/exports/ast.ts +2 -0
  63. package/src/exports/codec-descriptor-registry.ts +1 -0
  64. package/src/exports/expression.ts +1 -0
  65. package/src/exports/middleware.ts +8 -0
  66. package/src/expression.ts +134 -0
  67. package/src/index.ts +2 -0
  68. package/src/middleware/param-ref-mutator.ts +230 -0
  69. package/src/plan.ts +32 -16
  70. package/src/query-lane-context.ts +35 -55
  71. package/src/types.ts +1 -3
  72. package/dist/codec-types-B2Xdq0Wr.d.mts +0 -167
  73. package/dist/codec-types-B2Xdq0Wr.d.mts.map +0 -1
  74. package/dist/errors-CDvhnH7P.d.mts.map +0 -1
  75. package/dist/plan-CRPxW2Jj.d.mts +0 -32
  76. package/dist/plan-CRPxW2Jj.d.mts.map +0 -1
  77. package/dist/query-lane-context-DDRW5NBG.d.mts +0 -89
  78. package/dist/query-lane-context-DDRW5NBG.d.mts.map +0 -1
  79. package/dist/sql-execution-plan-DY0WvJOW.d.mts.map +0 -1
  80. package/dist/types-B5XsBeaT.d.mts.map +0 -1
  81. package/dist/types-C3Hg-CVz.d.mts.map +0 -1
  82. package/dist/types-CG3u534i.d.mts.map +0 -1
@@ -1,142 +1,302 @@
1
+ /**
2
+ * The six SQL base codecs (TML-2357).
3
+ *
4
+ * Each codec ships as three artifacts:
5
+ *
6
+ * 1. A `SqlXCodec` class extending {@link CodecImpl} that wraps the module-level encode/decode constants exported from `sql-codec-helpers.ts` (the single source of truth for runtime behaviour). 2. A `SqlXDescriptor` class extending {@link CodecDescriptorImpl} declaring the codec id, traits, target types, params schema, and (where applicable) the emit-path `renderOutputType`. 3. A per-codec column helper (`sqlXColumn`)
7
+ * that calls `descriptor.factory(...)` directly and packages the result into a {@link ColumnSpec} via the framework {@link column} packager. The helper is tied to its descriptor with `satisfies ColumnHelperFor`.
8
+ *
9
+ * After TML-2357 this file is the canonical source of SQL base codec metadata and runtime behaviour — the legacy `mkCodec` / `defineCodec` carriers retired with the deletion sweep.
10
+ */
11
+
12
+ import type { JsonValue } from '@prisma-next/contract/types';
13
+ import {
14
+ type CodecCallContext,
15
+ CodecDescriptorImpl,
16
+ CodecImpl,
17
+ type CodecInstanceContext,
18
+ type ColumnHelperFor,
19
+ type ColumnHelperForStrict,
20
+ column,
21
+ voidParamsSchema,
22
+ } from '@prisma-next/framework-components/codec';
23
+ import type { StandardSchemaV1 } from '@standard-schema/spec';
1
24
  import { type as arktype } from 'arktype';
2
- import { codec, defineCodecs } from './codec-types';
25
+ import {
26
+ SQL_CHAR_CODEC_ID,
27
+ SQL_FLOAT_CODEC_ID,
28
+ SQL_INT_CODEC_ID,
29
+ SQL_TEXT_CODEC_ID,
30
+ SQL_TIMESTAMP_CODEC_ID,
31
+ SQL_VARCHAR_CODEC_ID,
32
+ sqlCharDecode,
33
+ sqlCharEncode,
34
+ sqlCharRenderOutputType,
35
+ sqlFloatDecode,
36
+ sqlFloatEncode,
37
+ sqlIntDecode,
38
+ sqlIntEncode,
39
+ sqlTextDecode,
40
+ sqlTextEncode,
41
+ sqlTimestampDecode,
42
+ sqlTimestampDecodeJson,
43
+ sqlTimestampEncode,
44
+ sqlTimestampEncodeJson,
45
+ sqlTimestampRenderOutputType,
46
+ sqlVarcharDecode,
47
+ sqlVarcharEncode,
48
+ sqlVarcharRenderOutputType,
49
+ } from './sql-codec-helpers';
3
50
 
4
- export const SQL_CHAR_CODEC_ID = 'sql/char@1' as const;
5
- export const SQL_VARCHAR_CODEC_ID = 'sql/varchar@1' as const;
6
- export const SQL_INT_CODEC_ID = 'sql/int@1' as const;
7
- export const SQL_FLOAT_CODEC_ID = 'sql/float@1' as const;
8
- export const SQL_TEXT_CODEC_ID = 'sql/text@1' as const;
9
- export const SQL_TIMESTAMP_CODEC_ID = 'sql/timestamp@1' as const;
51
+ type LengthParams = { readonly length?: number };
52
+ type PrecisionParams = { readonly precision?: number };
10
53
 
11
54
  const lengthParamsSchema = arktype({
12
- length: 'number.integer > 0',
13
- });
55
+ 'length?': 'number.integer > 0',
56
+ }) satisfies StandardSchemaV1<LengthParams>;
14
57
 
15
58
  const precisionParamsSchema = arktype({
16
59
  'precision?': 'number.integer >= 0 & number.integer <= 6',
17
- });
18
-
19
- type LengthTypeHelper = {
20
- readonly kind: 'fixed' | 'variable';
21
- readonly maxLength: number;
22
- };
23
-
24
- function createLengthTypeHelper(
25
- kind: LengthTypeHelper['kind'],
26
- ): (params: Record<string, unknown>) => LengthTypeHelper {
27
- return (params) => ({
28
- kind,
29
- maxLength: params['length'] as number,
30
- });
60
+ }) satisfies StandardSchemaV1<PrecisionParams>;
61
+
62
+ export class SqlTextCodec extends CodecImpl<
63
+ typeof SQL_TEXT_CODEC_ID,
64
+ readonly ['equality', 'order', 'textual'],
65
+ string,
66
+ string
67
+ > {
68
+ async encode(value: string, _ctx: CodecCallContext): Promise<string> {
69
+ return sqlTextEncode(value);
70
+ }
71
+ async decode(wire: string, _ctx: CodecCallContext): Promise<string> {
72
+ return sqlTextDecode(wire);
73
+ }
74
+ encodeJson(value: string): JsonValue {
75
+ return value;
76
+ }
77
+ decodeJson(json: JsonValue): string {
78
+ return json as string;
79
+ }
80
+ }
81
+
82
+ export class SqlTextDescriptor extends CodecDescriptorImpl<void> {
83
+ override readonly codecId = SQL_TEXT_CODEC_ID;
84
+ override readonly traits = ['equality', 'order', 'textual'] as const;
85
+ override readonly targetTypes = ['text'] as const;
86
+ override readonly paramsSchema: StandardSchemaV1<void> = voidParamsSchema;
87
+ override factory(): (ctx: CodecInstanceContext) => SqlTextCodec {
88
+ return () => new SqlTextCodec(this);
89
+ }
90
+ }
91
+
92
+ export const sqlTextDescriptor = new SqlTextDescriptor();
93
+
94
+ export const sqlTextColumn = () =>
95
+ column(sqlTextDescriptor.factory(), sqlTextDescriptor.codecId, undefined, 'text');
96
+
97
+ sqlTextColumn satisfies ColumnHelperFor<SqlTextDescriptor>;
98
+ sqlTextColumn satisfies ColumnHelperForStrict<SqlTextDescriptor>;
99
+
100
+ export class SqlIntCodec extends CodecImpl<
101
+ typeof SQL_INT_CODEC_ID,
102
+ readonly ['equality', 'order', 'numeric'],
103
+ number,
104
+ number
105
+ > {
106
+ async encode(value: number, _ctx: CodecCallContext): Promise<number> {
107
+ return sqlIntEncode(value);
108
+ }
109
+ async decode(wire: number, _ctx: CodecCallContext): Promise<number> {
110
+ return sqlIntDecode(wire);
111
+ }
112
+ encodeJson(value: number): JsonValue {
113
+ return value;
114
+ }
115
+ decodeJson(json: JsonValue): number {
116
+ return json as number;
117
+ }
118
+ }
119
+
120
+ export class SqlIntDescriptor extends CodecDescriptorImpl<void> {
121
+ override readonly codecId = SQL_INT_CODEC_ID;
122
+ override readonly traits = ['equality', 'order', 'numeric'] as const;
123
+ override readonly targetTypes = ['int'] as const;
124
+ override readonly paramsSchema: StandardSchemaV1<void> = voidParamsSchema;
125
+ override factory(): (ctx: CodecInstanceContext) => SqlIntCodec {
126
+ return () => new SqlIntCodec(this);
127
+ }
31
128
  }
32
129
 
33
- const sqlCharCodec = codec<
130
+ export const sqlIntDescriptor = new SqlIntDescriptor();
131
+
132
+ export const sqlIntColumn = () =>
133
+ column(sqlIntDescriptor.factory(), sqlIntDescriptor.codecId, undefined, 'int');
134
+
135
+ sqlIntColumn satisfies ColumnHelperFor<SqlIntDescriptor>;
136
+ sqlIntColumn satisfies ColumnHelperForStrict<SqlIntDescriptor>;
137
+
138
+ export class SqlFloatCodec extends CodecImpl<
139
+ typeof SQL_FLOAT_CODEC_ID,
140
+ readonly ['equality', 'order', 'numeric'],
141
+ number,
142
+ number
143
+ > {
144
+ async encode(value: number, _ctx: CodecCallContext): Promise<number> {
145
+ return sqlFloatEncode(value);
146
+ }
147
+ async decode(wire: number, _ctx: CodecCallContext): Promise<number> {
148
+ return sqlFloatDecode(wire);
149
+ }
150
+ encodeJson(value: number): JsonValue {
151
+ return value;
152
+ }
153
+ decodeJson(json: JsonValue): number {
154
+ return json as number;
155
+ }
156
+ }
157
+
158
+ export class SqlFloatDescriptor extends CodecDescriptorImpl<void> {
159
+ override readonly codecId = SQL_FLOAT_CODEC_ID;
160
+ override readonly traits = ['equality', 'order', 'numeric'] as const;
161
+ override readonly targetTypes = ['float'] as const;
162
+ override readonly paramsSchema: StandardSchemaV1<void> = voidParamsSchema;
163
+ override factory(): (ctx: CodecInstanceContext) => SqlFloatCodec {
164
+ return () => new SqlFloatCodec(this);
165
+ }
166
+ }
167
+
168
+ export const sqlFloatDescriptor = new SqlFloatDescriptor();
169
+
170
+ export const sqlFloatColumn = () =>
171
+ column(sqlFloatDescriptor.factory(), sqlFloatDescriptor.codecId, undefined, 'float');
172
+
173
+ sqlFloatColumn satisfies ColumnHelperFor<SqlFloatDescriptor>;
174
+ sqlFloatColumn satisfies ColumnHelperForStrict<SqlFloatDescriptor>;
175
+
176
+ export class SqlCharCodec extends CodecImpl<
34
177
  typeof SQL_CHAR_CODEC_ID,
35
178
  readonly ['equality', 'order', 'textual'],
36
179
  string,
37
180
  string
38
- >({
39
- typeId: SQL_CHAR_CODEC_ID,
40
- targetTypes: ['char'],
41
- traits: ['equality', 'order', 'textual'],
42
- encode: (value: string): string => value,
43
- decode: (wire: string): string => wire.trimEnd(),
44
- paramsSchema: lengthParamsSchema,
45
- init: createLengthTypeHelper('fixed'),
46
- renderOutputType: (typeParams) => {
47
- const length = typeParams['length'];
48
- if (length === undefined) return undefined;
49
- if (typeof length !== 'number' || !Number.isFinite(length) || !Number.isInteger(length)) {
50
- throw new Error(
51
- `renderOutputType: expected integer "length" in typeParams for Char, got ${String(length)}`,
52
- );
53
- }
54
- return `Char<${length}>`;
55
- },
56
- });
57
-
58
- const sqlVarcharCodec = codec<
181
+ > {
182
+ async encode(value: string, _ctx: CodecCallContext): Promise<string> {
183
+ return sqlCharEncode(value);
184
+ }
185
+ async decode(wire: string, _ctx: CodecCallContext): Promise<string> {
186
+ return sqlCharDecode(wire);
187
+ }
188
+ encodeJson(value: string): JsonValue {
189
+ return value;
190
+ }
191
+ decodeJson(json: JsonValue): string {
192
+ return json as string;
193
+ }
194
+ }
195
+
196
+ export class SqlCharDescriptor extends CodecDescriptorImpl<LengthParams> {
197
+ override readonly codecId = SQL_CHAR_CODEC_ID;
198
+ override readonly traits = ['equality', 'order', 'textual'] as const;
199
+ override readonly targetTypes = ['char'] as const;
200
+ override readonly paramsSchema: StandardSchemaV1<LengthParams> = lengthParamsSchema;
201
+ override renderOutputType(params: LengthParams): string | undefined {
202
+ return sqlCharRenderOutputType(params);
203
+ }
204
+ override factory(_params: LengthParams): (ctx: CodecInstanceContext) => SqlCharCodec {
205
+ return () => new SqlCharCodec(this);
206
+ }
207
+ }
208
+
209
+ export const sqlCharDescriptor = new SqlCharDescriptor();
210
+
211
+ export const sqlCharColumn = (params: LengthParams = {}) =>
212
+ column(sqlCharDescriptor.factory(params), sqlCharDescriptor.codecId, params, 'char');
213
+
214
+ sqlCharColumn satisfies ColumnHelperFor<SqlCharDescriptor>;
215
+ sqlCharColumn satisfies ColumnHelperForStrict<SqlCharDescriptor>;
216
+
217
+ export class SqlVarcharCodec extends CodecImpl<
59
218
  typeof SQL_VARCHAR_CODEC_ID,
60
219
  readonly ['equality', 'order', 'textual'],
61
220
  string,
62
221
  string
63
- >({
64
- typeId: SQL_VARCHAR_CODEC_ID,
65
- targetTypes: ['varchar'],
66
- traits: ['equality', 'order', 'textual'],
67
- encode: (value: string): string => value,
68
- decode: (wire: string): string => wire,
69
- paramsSchema: lengthParamsSchema,
70
- init: createLengthTypeHelper('variable'),
71
- renderOutputType: (typeParams) => {
72
- const length = typeParams['length'];
73
- if (length === undefined) return undefined;
74
- if (typeof length !== 'number' || !Number.isFinite(length) || !Number.isInteger(length)) {
75
- throw new Error(
76
- `renderOutputType: expected integer "length" in typeParams for Varchar, got ${String(length)}`,
77
- );
78
- }
79
- return `Varchar<${length}>`;
80
- },
81
- });
82
-
83
- const sqlIntCodec = codec({
84
- typeId: SQL_INT_CODEC_ID,
85
- targetTypes: ['int'],
86
- traits: ['equality', 'order', 'numeric'],
87
- encode: (value: number): number => value,
88
- decode: (wire: number): number => wire,
89
- });
90
-
91
- const sqlFloatCodec = codec({
92
- typeId: SQL_FLOAT_CODEC_ID,
93
- targetTypes: ['float'],
94
- traits: ['equality', 'order', 'numeric'],
95
- encode: (value: number): number => value,
96
- decode: (wire: number): number => wire,
97
- });
98
-
99
- const sqlTextCodec = codec({
100
- typeId: SQL_TEXT_CODEC_ID,
101
- targetTypes: ['text'],
102
- traits: ['equality', 'order', 'textual'],
103
- encode: (value: string): string => value,
104
- decode: (wire: string): string => wire,
105
- });
106
-
107
- const sqlTimestampCodec = codec({
108
- typeId: SQL_TIMESTAMP_CODEC_ID,
109
- targetTypes: ['timestamp'],
110
- traits: ['equality', 'order'],
111
- encode: (value: string | Date): string => (value instanceof Date ? value.toISOString() : value),
112
- decode: (wire: string | Date): string => (wire instanceof Date ? wire.toISOString() : wire),
113
- paramsSchema: precisionParamsSchema,
114
- renderOutputType: (typeParams) => {
115
- const precision = typeParams['precision'];
116
- if (precision === undefined) {
117
- return 'Timestamp';
118
- }
119
- if (
120
- typeof precision !== 'number' ||
121
- !Number.isFinite(precision) ||
122
- !Number.isInteger(precision)
123
- ) {
124
- throw new Error(
125
- `renderOutputType: expected integer "precision" in typeParams for Timestamp, got ${String(precision)}`,
126
- );
127
- }
128
- return `Timestamp<${precision}>`;
129
- },
130
- });
131
-
132
- const codecs = defineCodecs()
133
- .add('char', sqlCharCodec)
134
- .add('varchar', sqlVarcharCodec)
135
- .add('int', sqlIntCodec)
136
- .add('float', sqlFloatCodec)
137
- .add('text', sqlTextCodec)
138
- .add('timestamp', sqlTimestampCodec);
139
-
140
- export const sqlCodecDefinitions = codecs.codecDefinitions;
141
- export const sqlDataTypes = codecs.dataTypes;
142
- export type SqlCodecTypes = typeof codecs.CodecTypes;
222
+ > {
223
+ async encode(value: string, _ctx: CodecCallContext): Promise<string> {
224
+ return sqlVarcharEncode(value);
225
+ }
226
+ async decode(wire: string, _ctx: CodecCallContext): Promise<string> {
227
+ return sqlVarcharDecode(wire);
228
+ }
229
+ encodeJson(value: string): JsonValue {
230
+ return value;
231
+ }
232
+ decodeJson(json: JsonValue): string {
233
+ return json as string;
234
+ }
235
+ }
236
+
237
+ export class SqlVarcharDescriptor extends CodecDescriptorImpl<LengthParams> {
238
+ override readonly codecId = SQL_VARCHAR_CODEC_ID;
239
+ override readonly traits = ['equality', 'order', 'textual'] as const;
240
+ override readonly targetTypes = ['varchar'] as const;
241
+ override readonly paramsSchema: StandardSchemaV1<LengthParams> = lengthParamsSchema;
242
+ override renderOutputType(params: LengthParams): string | undefined {
243
+ return sqlVarcharRenderOutputType(params);
244
+ }
245
+ override factory(_params: LengthParams): (ctx: CodecInstanceContext) => SqlVarcharCodec {
246
+ return () => new SqlVarcharCodec(this);
247
+ }
248
+ }
249
+
250
+ export const sqlVarcharDescriptor = new SqlVarcharDescriptor();
251
+
252
+ export const sqlVarcharColumn = (params: LengthParams = {}) =>
253
+ column(sqlVarcharDescriptor.factory(params), sqlVarcharDescriptor.codecId, params, 'varchar');
254
+
255
+ sqlVarcharColumn satisfies ColumnHelperFor<SqlVarcharDescriptor>;
256
+ sqlVarcharColumn satisfies ColumnHelperForStrict<SqlVarcharDescriptor>;
257
+
258
+ export class SqlTimestampCodec extends CodecImpl<
259
+ typeof SQL_TIMESTAMP_CODEC_ID,
260
+ readonly ['equality', 'order'],
261
+ Date,
262
+ Date
263
+ > {
264
+ async encode(value: Date, _ctx: CodecCallContext): Promise<Date> {
265
+ return sqlTimestampEncode(value);
266
+ }
267
+ async decode(wire: Date, _ctx: CodecCallContext): Promise<Date> {
268
+ return sqlTimestampDecode(wire);
269
+ }
270
+ encodeJson(value: Date): JsonValue {
271
+ return sqlTimestampEncodeJson(value);
272
+ }
273
+ decodeJson(json: JsonValue): Date {
274
+ return sqlTimestampDecodeJson(json);
275
+ }
276
+ }
277
+
278
+ export class SqlTimestampDescriptor extends CodecDescriptorImpl<PrecisionParams> {
279
+ override readonly codecId = SQL_TIMESTAMP_CODEC_ID;
280
+ override readonly traits = ['equality', 'order'] as const;
281
+ override readonly targetTypes = ['timestamp'] as const;
282
+ override readonly paramsSchema: StandardSchemaV1<PrecisionParams> = precisionParamsSchema;
283
+ override renderOutputType(params: PrecisionParams): string | undefined {
284
+ return sqlTimestampRenderOutputType(params);
285
+ }
286
+ override factory(_params: PrecisionParams): (ctx: CodecInstanceContext) => SqlTimestampCodec {
287
+ return () => new SqlTimestampCodec(this);
288
+ }
289
+ }
290
+
291
+ export const sqlTimestampDescriptor = new SqlTimestampDescriptor();
292
+
293
+ export const sqlTimestampColumn = (params: PrecisionParams = {}) =>
294
+ column(
295
+ sqlTimestampDescriptor.factory(params),
296
+ sqlTimestampDescriptor.codecId,
297
+ params,
298
+ 'timestamp',
299
+ );
300
+
301
+ sqlTimestampColumn satisfies ColumnHelperFor<SqlTimestampDescriptor>;
302
+ sqlTimestampColumn satisfies ColumnHelperForStrict<SqlTimestampDescriptor>;