@prisma-next/target-sqlite 0.12.0-dev.9 → 0.13.0-dev.1

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 (122) hide show
  1. package/dist/{codec-ids-C4UfWqAE.d.mts → codec-ids-BfPkjMmk.d.mts} +1 -1
  2. package/dist/{codec-ids-C4UfWqAE.d.mts.map → codec-ids-BfPkjMmk.d.mts.map} +1 -1
  3. package/dist/{codec-ids-CuUxYcd0.mjs → codec-ids-DSU7S2Li.mjs} +1 -1
  4. package/dist/{codec-ids-CuUxYcd0.mjs.map → codec-ids-DSU7S2Li.mjs.map} +1 -1
  5. package/dist/codec-ids.d.mts +1 -1
  6. package/dist/codec-ids.mjs +1 -1
  7. package/dist/{codec-types-B2ci-b_W.d.mts → codec-types-izdPhp_9.d.mts} +6 -7
  8. package/dist/codec-types-izdPhp_9.d.mts.map +1 -0
  9. package/dist/codec-types.d.mts +3 -3
  10. package/dist/{codecs-DqDWNIKq.d.mts → codecs-BGeJavlQ.d.mts} +16 -18
  11. package/dist/codecs-BGeJavlQ.d.mts.map +1 -0
  12. package/dist/{codecs-DVnHtVWW.mjs → codecs-DsC4OGmU.mjs} +2 -2
  13. package/dist/{codecs-DVnHtVWW.mjs.map → codecs-DsC4OGmU.mjs.map} +1 -1
  14. package/dist/codecs.d.mts +2 -2
  15. package/dist/codecs.mjs +1 -1
  16. package/dist/contract-free.d.mts +55 -0
  17. package/dist/contract-free.d.mts.map +1 -0
  18. package/dist/contract-free.mjs +111 -0
  19. package/dist/contract-free.mjs.map +1 -0
  20. package/dist/control-tables-7KwMyJ6i.mjs +12 -0
  21. package/dist/control-tables-7KwMyJ6i.mjs.map +1 -0
  22. package/dist/control-tables.d.mts +11 -0
  23. package/dist/control-tables.d.mts.map +1 -0
  24. package/dist/control-tables.mjs +2 -0
  25. package/dist/control.d.mts +31 -15
  26. package/dist/control.d.mts.map +1 -1
  27. package/dist/control.mjs +66 -124
  28. package/dist/control.mjs.map +1 -1
  29. package/dist/ddl.d.mts +2 -0
  30. package/dist/ddl.mjs +2 -0
  31. package/dist/{default-normalizer-CWKVYSxS.mjs → default-normalizer-DuoHj9-O.mjs} +1 -1
  32. package/dist/{default-normalizer-CWKVYSxS.mjs.map → default-normalizer-DuoHj9-O.mjs.map} +1 -1
  33. package/dist/default-normalizer.mjs +1 -1
  34. package/dist/{descriptor-meta-DIbCXU65.mjs → descriptor-meta-Dxx2A6PT.mjs} +4 -2
  35. package/dist/descriptor-meta-Dxx2A6PT.mjs.map +1 -0
  36. package/dist/{descriptor-meta-runtime-DOcnLfOX.mjs → descriptor-meta-runtime-BkXK3OjD.mjs} +1 -1
  37. package/dist/{descriptor-meta-runtime-DOcnLfOX.mjs.map → descriptor-meta-runtime-BkXK3OjD.mjs.map} +1 -1
  38. package/dist/migration.d.mts +2 -2
  39. package/dist/migration.mjs +3 -3
  40. package/dist/{native-type-normalizer-HvkimyB8.mjs → native-type-normalizer-CiSyVmMP.mjs} +1 -1
  41. package/dist/{native-type-normalizer-HvkimyB8.mjs.map → native-type-normalizer-CiSyVmMP.mjs.map} +1 -1
  42. package/dist/native-type-normalizer.mjs +1 -1
  43. package/dist/nodes-D0k4z7NL.mjs +33 -0
  44. package/dist/nodes-D0k4z7NL.mjs.map +1 -0
  45. package/dist/nodes-VzaaeUTb.d.mts +29 -0
  46. package/dist/nodes-VzaaeUTb.d.mts.map +1 -0
  47. package/dist/{op-factory-call-VBm-wu5R.mjs → op-factory-call-DymqdXQW.mjs} +2 -2
  48. package/dist/{op-factory-call-VBm-wu5R.mjs.map → op-factory-call-DymqdXQW.mjs.map} +1 -1
  49. package/dist/op-factory-call.d.mts +2 -2
  50. package/dist/op-factory-call.d.mts.map +1 -1
  51. package/dist/op-factory-call.mjs +1 -1
  52. package/dist/pack.d.mts +2 -1
  53. package/dist/pack.d.mts.map +1 -1
  54. package/dist/pack.mjs +1 -1
  55. package/dist/{planner-BBvwGy0f.mjs → planner-DSNDwQy9.mjs} +9 -9
  56. package/dist/planner-DSNDwQy9.mjs.map +1 -0
  57. package/dist/{planner-produced-sqlite-migration-D4FSvPE4.d.mts → planner-produced-sqlite-migration-C1yqJAiM.d.mts} +3 -3
  58. package/dist/{planner-produced-sqlite-migration-D4FSvPE4.d.mts.map → planner-produced-sqlite-migration-C1yqJAiM.d.mts.map} +1 -1
  59. package/dist/{planner-produced-sqlite-migration-DF8pnKfG.mjs → planner-produced-sqlite-migration-DowV_vHw.mjs} +3 -3
  60. package/dist/{planner-produced-sqlite-migration-DF8pnKfG.mjs.map → planner-produced-sqlite-migration-DowV_vHw.mjs.map} +1 -1
  61. package/dist/planner-produced-sqlite-migration.d.mts +1 -1
  62. package/dist/planner-produced-sqlite-migration.mjs +1 -1
  63. package/dist/{planner-target-details-BRS591Zt.mjs → planner-target-details-H8z9TFDg.mjs} +1 -1
  64. package/dist/{planner-target-details-BRS591Zt.mjs.map → planner-target-details-H8z9TFDg.mjs.map} +1 -1
  65. package/dist/{planner-target-details-B-VJkUsu.d.mts → planner-target-details-xR6UfIcz.d.mts} +1 -1
  66. package/dist/{planner-target-details-B-VJkUsu.d.mts.map → planner-target-details-xR6UfIcz.d.mts.map} +1 -1
  67. package/dist/planner-target-details.d.mts +1 -1
  68. package/dist/planner-target-details.mjs +1 -1
  69. package/dist/planner.d.mts +2 -2
  70. package/dist/planner.d.mts.map +1 -1
  71. package/dist/planner.mjs +1 -1
  72. package/dist/{render-ops-ByOBLKVj.mjs → render-ops-CFRbJ3Yb.mjs} +1 -1
  73. package/dist/{render-ops-ByOBLKVj.mjs.map → render-ops-CFRbJ3Yb.mjs.map} +1 -1
  74. package/dist/render-ops.d.mts +1 -1
  75. package/dist/render-ops.mjs +1 -1
  76. package/dist/runtime.d.mts +17 -1
  77. package/dist/runtime.d.mts.map +1 -1
  78. package/dist/runtime.mjs +3 -2
  79. package/dist/runtime.mjs.map +1 -1
  80. package/dist/{shared-DDOJntxk.d.mts → shared-Dhc8mLK1.d.mts} +2 -2
  81. package/dist/{shared-DDOJntxk.d.mts.map → shared-Dhc8mLK1.d.mts.map} +1 -1
  82. package/dist/{sql-utils-D0gQAMLB.mjs → sql-utils-CV8Bdgtc.mjs} +1 -1
  83. package/dist/{sql-utils-D0gQAMLB.mjs.map → sql-utils-CV8Bdgtc.mjs.map} +1 -1
  84. package/dist/sql-utils.mjs +1 -1
  85. package/dist/sqlite-contract-serializer-jcRu8aHh.mjs +101 -0
  86. package/dist/sqlite-contract-serializer-jcRu8aHh.mjs.map +1 -0
  87. package/dist/{sqlite-migration-Lvmtu9IE.mjs → sqlite-migration-CUqgmzQH.mjs} +1 -1
  88. package/dist/{sqlite-migration-Lvmtu9IE.mjs.map → sqlite-migration-CUqgmzQH.mjs.map} +1 -1
  89. package/dist/{sqlite-migration-Feio34n3.d.mts → sqlite-migration-D4XGYzgQ.d.mts} +2 -2
  90. package/dist/{sqlite-migration-Feio34n3.d.mts.map → sqlite-migration-D4XGYzgQ.d.mts.map} +1 -1
  91. package/dist/{tables-gB0XiFu8.mjs → tables-CjB7vXCr.mjs} +5 -11
  92. package/dist/tables-CjB7vXCr.mjs.map +1 -0
  93. package/package.json +23 -21
  94. package/src/contract-free/columns.ts +44 -0
  95. package/src/contract-free/control-bootstrap.ts +54 -0
  96. package/src/contract-free/ddl.ts +26 -0
  97. package/src/core/control-tables.ts +11 -0
  98. package/src/core/control-target.ts +4 -6
  99. package/src/core/ddl/nodes.ts +54 -0
  100. package/src/core/descriptor-meta.ts +2 -0
  101. package/src/core/migrations/issue-planner.ts +1 -1
  102. package/src/core/migrations/operations/shared.ts +1 -8
  103. package/src/core/migrations/planner-strategies.ts +1 -1
  104. package/src/core/migrations/runner.ts +78 -83
  105. package/src/core/sqlite-contract-serializer.ts +21 -9
  106. package/src/core/sqlite-unbound-database.ts +113 -26
  107. package/src/exports/contract-free.ts +6 -0
  108. package/src/exports/control-tables.ts +5 -0
  109. package/src/exports/ddl.ts +6 -0
  110. package/src/exports/runtime.ts +1 -0
  111. package/dist/codec-types-B2ci-b_W.d.mts.map +0 -1
  112. package/dist/codecs-DqDWNIKq.d.mts.map +0 -1
  113. package/dist/descriptor-meta-DIbCXU65.mjs.map +0 -1
  114. package/dist/planner-BBvwGy0f.mjs.map +0 -1
  115. package/dist/statement-builders-BiRmeyJM.mjs +0 -158
  116. package/dist/statement-builders-BiRmeyJM.mjs.map +0 -1
  117. package/dist/statement-builders.d.mts +0 -68
  118. package/dist/statement-builders.d.mts.map +0 -1
  119. package/dist/statement-builders.mjs +0 -2
  120. package/dist/tables-gB0XiFu8.mjs.map +0 -1
  121. package/src/core/migrations/statement-builders.ts +0 -212
  122. package/src/exports/statement-builders.ts +0 -12
@@ -10,4 +10,4 @@ declare const SQLITE_JSON_CODEC_ID: "sqlite/json@1";
10
10
  declare const SQLITE_BIGINT_CODEC_ID: "sqlite/bigint@1";
11
11
  //#endregion
12
12
  export { SQLITE_JSON_CODEC_ID as a, SQL_CHAR_CODEC_ID as c, SQL_VARCHAR_CODEC_ID as d, SQLITE_INTEGER_CODEC_ID as i, SQL_FLOAT_CODEC_ID as l, SQLITE_BLOB_CODEC_ID as n, SQLITE_REAL_CODEC_ID as o, SQLITE_DATETIME_CODEC_ID as r, SQLITE_TEXT_CODEC_ID as s, SQLITE_BIGINT_CODEC_ID as t, SQL_INT_CODEC_ID as u };
13
- //# sourceMappingURL=codec-ids-C4UfWqAE.d.mts.map
13
+ //# sourceMappingURL=codec-ids-BfPkjMmk.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codec-ids-C4UfWqAE.d.mts","names":[],"sources":["../src/core/codec-ids.ts"],"mappings":";;;cAMa,oBAAA;AAAA,cACA,uBAAA;AAAA,cACA,oBAAA;AAAA,cACA,oBAAA;AAAA,cACA,wBAAA;AAAA,cACA,oBAAA;AAAA,cACA,sBAAA"}
1
+ {"version":3,"file":"codec-ids-BfPkjMmk.d.mts","names":[],"sources":["../src/core/codec-ids.ts"],"mappings":";;;cAMa,oBAAA;AAAA,cACA,uBAAA;AAAA,cACA,oBAAA;AAAA,cACA,oBAAA;AAAA,cACA,wBAAA;AAAA,cACA,oBAAA;AAAA,cACA,sBAAA"}
@@ -10,4 +10,4 @@ const SQLITE_BIGINT_CODEC_ID = "sqlite/bigint@1";
10
10
  //#endregion
11
11
  export { SQLITE_JSON_CODEC_ID as a, SQL_CHAR_CODEC_ID as c, SQL_VARCHAR_CODEC_ID as d, SQLITE_INTEGER_CODEC_ID as i, SQL_FLOAT_CODEC_ID as l, SQLITE_BLOB_CODEC_ID as n, SQLITE_REAL_CODEC_ID as o, SQLITE_DATETIME_CODEC_ID as r, SQLITE_TEXT_CODEC_ID as s, SQLITE_BIGINT_CODEC_ID as t, SQL_INT_CODEC_ID as u };
12
12
 
13
- //# sourceMappingURL=codec-ids-CuUxYcd0.mjs.map
13
+ //# sourceMappingURL=codec-ids-DSU7S2Li.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"codec-ids-CuUxYcd0.mjs","names":[],"sources":["../src/core/codec-ids.ts"],"sourcesContent":["export {\n SQL_CHAR_CODEC_ID,\n SQL_FLOAT_CODEC_ID,\n SQL_INT_CODEC_ID,\n SQL_VARCHAR_CODEC_ID,\n} from '@prisma-next/sql-relational-core/ast';\nexport const SQLITE_TEXT_CODEC_ID = 'sqlite/text@1' as const;\nexport const SQLITE_INTEGER_CODEC_ID = 'sqlite/integer@1' as const;\nexport const SQLITE_REAL_CODEC_ID = 'sqlite/real@1' as const;\nexport const SQLITE_BLOB_CODEC_ID = 'sqlite/blob@1' as const;\nexport const SQLITE_DATETIME_CODEC_ID = 'sqlite/datetime@1' as const;\nexport const SQLITE_JSON_CODEC_ID = 'sqlite/json@1' as const;\nexport const SQLITE_BIGINT_CODEC_ID = 'sqlite/bigint@1' as const;\n"],"mappings":";;AAMA,MAAa,uBAAuB;AACpC,MAAa,0BAA0B;AACvC,MAAa,uBAAuB;AACpC,MAAa,uBAAuB;AACpC,MAAa,2BAA2B;AACxC,MAAa,uBAAuB;AACpC,MAAa,yBAAyB"}
1
+ {"version":3,"file":"codec-ids-DSU7S2Li.mjs","names":[],"sources":["../src/core/codec-ids.ts"],"sourcesContent":["export {\n SQL_CHAR_CODEC_ID,\n SQL_FLOAT_CODEC_ID,\n SQL_INT_CODEC_ID,\n SQL_VARCHAR_CODEC_ID,\n} from '@prisma-next/sql-relational-core/ast';\nexport const SQLITE_TEXT_CODEC_ID = 'sqlite/text@1' as const;\nexport const SQLITE_INTEGER_CODEC_ID = 'sqlite/integer@1' as const;\nexport const SQLITE_REAL_CODEC_ID = 'sqlite/real@1' as const;\nexport const SQLITE_BLOB_CODEC_ID = 'sqlite/blob@1' as const;\nexport const SQLITE_DATETIME_CODEC_ID = 'sqlite/datetime@1' as const;\nexport const SQLITE_JSON_CODEC_ID = 'sqlite/json@1' as const;\nexport const SQLITE_BIGINT_CODEC_ID = 'sqlite/bigint@1' as const;\n"],"mappings":";;AAMA,MAAa,uBAAuB;AACpC,MAAa,0BAA0B;AACvC,MAAa,uBAAuB;AACpC,MAAa,uBAAuB;AACpC,MAAa,2BAA2B;AACxC,MAAa,uBAAuB;AACpC,MAAa,yBAAyB"}
@@ -1,2 +1,2 @@
1
- import { a as SQLITE_JSON_CODEC_ID, c as SQL_CHAR_CODEC_ID, d as SQL_VARCHAR_CODEC_ID, i as SQLITE_INTEGER_CODEC_ID, l as SQL_FLOAT_CODEC_ID, n as SQLITE_BLOB_CODEC_ID, o as SQLITE_REAL_CODEC_ID, r as SQLITE_DATETIME_CODEC_ID, s as SQLITE_TEXT_CODEC_ID, t as SQLITE_BIGINT_CODEC_ID, u as SQL_INT_CODEC_ID } from "./codec-ids-C4UfWqAE.mjs";
1
+ import { a as SQLITE_JSON_CODEC_ID, c as SQL_CHAR_CODEC_ID, d as SQL_VARCHAR_CODEC_ID, i as SQLITE_INTEGER_CODEC_ID, l as SQL_FLOAT_CODEC_ID, n as SQLITE_BLOB_CODEC_ID, o as SQLITE_REAL_CODEC_ID, r as SQLITE_DATETIME_CODEC_ID, s as SQLITE_TEXT_CODEC_ID, t as SQLITE_BIGINT_CODEC_ID, u as SQL_INT_CODEC_ID } from "./codec-ids-BfPkjMmk.mjs";
2
2
  export { SQLITE_BIGINT_CODEC_ID, SQLITE_BLOB_CODEC_ID, SQLITE_DATETIME_CODEC_ID, SQLITE_INTEGER_CODEC_ID, SQLITE_JSON_CODEC_ID, SQLITE_REAL_CODEC_ID, SQLITE_TEXT_CODEC_ID, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_VARCHAR_CODEC_ID };
@@ -1,2 +1,2 @@
1
- import { a as SQLITE_JSON_CODEC_ID, c as SQL_CHAR_CODEC_ID, d as SQL_VARCHAR_CODEC_ID, i as SQLITE_INTEGER_CODEC_ID, l as SQL_FLOAT_CODEC_ID, n as SQLITE_BLOB_CODEC_ID, o as SQLITE_REAL_CODEC_ID, r as SQLITE_DATETIME_CODEC_ID, s as SQLITE_TEXT_CODEC_ID, t as SQLITE_BIGINT_CODEC_ID, u as SQL_INT_CODEC_ID } from "./codec-ids-CuUxYcd0.mjs";
1
+ import { a as SQLITE_JSON_CODEC_ID, c as SQL_CHAR_CODEC_ID, d as SQL_VARCHAR_CODEC_ID, i as SQLITE_INTEGER_CODEC_ID, l as SQL_FLOAT_CODEC_ID, n as SQLITE_BLOB_CODEC_ID, o as SQLITE_REAL_CODEC_ID, r as SQLITE_DATETIME_CODEC_ID, s as SQLITE_TEXT_CODEC_ID, t as SQLITE_BIGINT_CODEC_ID, u as SQL_INT_CODEC_ID } from "./codec-ids-DSU7S2Li.mjs";
2
2
  export { SQLITE_BIGINT_CODEC_ID, SQLITE_BLOB_CODEC_ID, SQLITE_DATETIME_CODEC_ID, SQLITE_INTEGER_CODEC_ID, SQLITE_JSON_CODEC_ID, SQLITE_REAL_CODEC_ID, SQLITE_TEXT_CODEC_ID, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_VARCHAR_CODEC_ID };
@@ -1,13 +1,12 @@
1
- import { a as SqliteIntegerDescriptor, c as SqliteTextDescriptor, i as SqliteDatetimeDescriptor, n as SqliteBigintDescriptor, o as SqliteJsonDescriptor, r as SqliteBlobDescriptor, s as SqliteRealDescriptor } from "./codecs-DqDWNIKq.mjs";
2
- import * as _$_prisma_next_sql_relational_core_ast0 from "@prisma-next/sql-relational-core/ast";
1
+ import { a as SqliteIntegerDescriptor, c as SqliteTextDescriptor, i as SqliteDatetimeDescriptor, n as SqliteBigintDescriptor, o as SqliteJsonDescriptor, r as SqliteBlobDescriptor, s as SqliteRealDescriptor } from "./codecs-BGeJavlQ.mjs";
3
2
  import { ExtractCodecTypes } from "@prisma-next/sql-relational-core/ast";
4
3
 
5
4
  //#region src/exports/codec-types.d.ts
6
5
  declare const codecDescriptorMap: {
7
- readonly char: _$_prisma_next_sql_relational_core_ast0.SqlCharDescriptor;
8
- readonly varchar: _$_prisma_next_sql_relational_core_ast0.SqlVarcharDescriptor;
9
- readonly int: _$_prisma_next_sql_relational_core_ast0.SqlIntDescriptor;
10
- readonly float: _$_prisma_next_sql_relational_core_ast0.SqlFloatDescriptor;
6
+ readonly char: import("@prisma-next/sql-relational-core/ast").SqlCharDescriptor;
7
+ readonly varchar: import("@prisma-next/sql-relational-core/ast").SqlVarcharDescriptor;
8
+ readonly int: import("@prisma-next/sql-relational-core/ast").SqlIntDescriptor;
9
+ readonly float: import("@prisma-next/sql-relational-core/ast").SqlFloatDescriptor;
11
10
  readonly text: SqliteTextDescriptor;
12
11
  readonly integer: SqliteIntegerDescriptor;
13
12
  readonly real: SqliteRealDescriptor;
@@ -20,4 +19,4 @@ type Resolve<T> = { readonly [K in keyof T]: { readonly [P in keyof T[K]]: T[K][
20
19
  type CodecTypes = Resolve<ExtractCodecTypes<typeof codecDescriptorMap>>;
21
20
  //#endregion
22
21
  export { CodecTypes as t };
23
- //# sourceMappingURL=codec-types-B2ci-b_W.d.mts.map
22
+ //# sourceMappingURL=codec-types-izdPhp_9.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec-types-izdPhp_9.d.mts","names":[],"sources":["../src/exports/codec-types.ts"],"mappings":";;;;cAwBM,kBAAA;EAAA;;;;iBAYI,oBAAA;EAAA;;;;;;;KAEL,OAAA,6BAAoC,CAAA,0BAA2B,CAAA,CAAE,CAAA,IAAK,CAAA,CAAE,CAAA,EAAG,CAAA;AAAA,KAEpE,UAAA,GAAa,OAAA,CAAQ,iBAAA,QAAyB,kBAAA"}
@@ -1,3 +1,3 @@
1
- import { g as JsonValue } from "./codecs-DqDWNIKq.mjs";
2
- import { t as CodecTypes } from "./codec-types-B2ci-b_W.mjs";
3
- export { CodecTypes, JsonValue };
1
+ import { g as JsonValue } from "./codecs-BGeJavlQ.mjs";
2
+ import { t as CodecTypes } from "./codec-types-izdPhp_9.mjs";
3
+ export { CodecTypes, type JsonValue };
@@ -1,7 +1,5 @@
1
- import { a as SQLITE_JSON_CODEC_ID, i as SQLITE_INTEGER_CODEC_ID, n as SQLITE_BLOB_CODEC_ID, o as SQLITE_REAL_CODEC_ID, r as SQLITE_DATETIME_CODEC_ID, s as SQLITE_TEXT_CODEC_ID, t as SQLITE_BIGINT_CODEC_ID } from "./codec-ids-C4UfWqAE.mjs";
2
- import * as _$_prisma_next_framework_components_codec0 from "@prisma-next/framework-components/codec";
1
+ import { a as SQLITE_JSON_CODEC_ID, i as SQLITE_INTEGER_CODEC_ID, n as SQLITE_BLOB_CODEC_ID, o as SQLITE_REAL_CODEC_ID, r as SQLITE_DATETIME_CODEC_ID, s as SQLITE_TEXT_CODEC_ID, t as SQLITE_BIGINT_CODEC_ID } from "./codec-ids-BfPkjMmk.mjs";
3
2
  import { CodecCallContext, CodecDescriptorImpl, CodecImpl, CodecInstanceContext } from "@prisma-next/framework-components/codec";
4
- import * as _$_standard_schema_spec0 from "@standard-schema/spec";
5
3
  import { JsonValue } from "@prisma-next/contract/types";
6
4
  import { CodecDescriptorRegistry } from "@prisma-next/sql-relational-core/query-lane-context";
7
5
 
@@ -24,10 +22,10 @@ declare class SqliteTextDescriptor extends CodecDescriptorImpl<void> {
24
22
  readonly codecId: "sqlite/text@1";
25
23
  readonly traits: readonly ["equality", "order", "textual"];
26
24
  readonly targetTypes: readonly ["text"];
27
- readonly paramsSchema: _$_standard_schema_spec0.StandardSchemaV1<void, void>;
25
+ readonly paramsSchema: import("@standard-schema/spec").StandardSchemaV1<void, void>;
28
26
  factory(): (ctx: CodecInstanceContext) => SqliteTextCodec;
29
27
  }
30
- declare const sqliteTextColumn: () => _$_prisma_next_framework_components_codec0.ColumnSpec<SqliteTextCodec, undefined>;
28
+ declare const sqliteTextColumn: () => import("@prisma-next/framework-components/codec").ColumnSpec<SqliteTextCodec, undefined>;
31
29
  declare class SqliteIntegerCodec extends CodecImpl<typeof SQLITE_INTEGER_CODEC_ID, readonly ['equality', 'order', 'numeric'], number, number> {
32
30
  encode(value: number, _ctx: CodecCallContext): Promise<number>;
33
31
  decode(wire: number, _ctx: CodecCallContext): Promise<number>;
@@ -38,10 +36,10 @@ declare class SqliteIntegerDescriptor extends CodecDescriptorImpl<void> {
38
36
  readonly codecId: "sqlite/integer@1";
39
37
  readonly traits: readonly ["equality", "order", "numeric"];
40
38
  readonly targetTypes: readonly ["integer"];
41
- readonly paramsSchema: _$_standard_schema_spec0.StandardSchemaV1<void, void>;
39
+ readonly paramsSchema: import("@standard-schema/spec").StandardSchemaV1<void, void>;
42
40
  factory(): (ctx: CodecInstanceContext) => SqliteIntegerCodec;
43
41
  }
44
- declare const sqliteIntegerColumn: () => _$_prisma_next_framework_components_codec0.ColumnSpec<SqliteIntegerCodec, undefined>;
42
+ declare const sqliteIntegerColumn: () => import("@prisma-next/framework-components/codec").ColumnSpec<SqliteIntegerCodec, undefined>;
45
43
  declare class SqliteRealCodec extends CodecImpl<typeof SQLITE_REAL_CODEC_ID, readonly ['equality', 'order', 'numeric'], number, number> {
46
44
  encode(value: number, _ctx: CodecCallContext): Promise<number>;
47
45
  decode(wire: number, _ctx: CodecCallContext): Promise<number>;
@@ -52,10 +50,10 @@ declare class SqliteRealDescriptor extends CodecDescriptorImpl<void> {
52
50
  readonly codecId: "sqlite/real@1";
53
51
  readonly traits: readonly ["equality", "order", "numeric"];
54
52
  readonly targetTypes: readonly ["real"];
55
- readonly paramsSchema: _$_standard_schema_spec0.StandardSchemaV1<void, void>;
53
+ readonly paramsSchema: import("@standard-schema/spec").StandardSchemaV1<void, void>;
56
54
  factory(): (ctx: CodecInstanceContext) => SqliteRealCodec;
57
55
  }
58
- declare const sqliteRealColumn: () => _$_prisma_next_framework_components_codec0.ColumnSpec<SqliteRealCodec, undefined>;
56
+ declare const sqliteRealColumn: () => import("@prisma-next/framework-components/codec").ColumnSpec<SqliteRealCodec, undefined>;
59
57
  declare class SqliteBlobCodec extends CodecImpl<typeof SQLITE_BLOB_CODEC_ID, readonly ['equality'], Uint8Array, Uint8Array> {
60
58
  encode(value: Uint8Array, _ctx: CodecCallContext): Promise<Uint8Array>;
61
59
  decode(wire: Uint8Array, _ctx: CodecCallContext): Promise<Uint8Array>;
@@ -66,10 +64,10 @@ declare class SqliteBlobDescriptor extends CodecDescriptorImpl<void> {
66
64
  readonly codecId: "sqlite/blob@1";
67
65
  readonly traits: readonly ["equality"];
68
66
  readonly targetTypes: readonly ["blob"];
69
- readonly paramsSchema: _$_standard_schema_spec0.StandardSchemaV1<void, void>;
67
+ readonly paramsSchema: import("@standard-schema/spec").StandardSchemaV1<void, void>;
70
68
  factory(): (ctx: CodecInstanceContext) => SqliteBlobCodec;
71
69
  }
72
- declare const sqliteBlobColumn: () => _$_prisma_next_framework_components_codec0.ColumnSpec<SqliteBlobCodec, undefined>;
70
+ declare const sqliteBlobColumn: () => import("@prisma-next/framework-components/codec").ColumnSpec<SqliteBlobCodec, undefined>;
73
71
  declare class SqliteDatetimeCodec extends CodecImpl<typeof SQLITE_DATETIME_CODEC_ID, readonly ['equality', 'order'], string, Date> {
74
72
  private parseDate;
75
73
  encode(value: Date, _ctx: CodecCallContext): Promise<string>;
@@ -81,10 +79,10 @@ declare class SqliteDatetimeDescriptor extends CodecDescriptorImpl<void> {
81
79
  readonly codecId: "sqlite/datetime@1";
82
80
  readonly traits: readonly ["equality", "order"];
83
81
  readonly targetTypes: readonly ["text"];
84
- readonly paramsSchema: _$_standard_schema_spec0.StandardSchemaV1<void, void>;
82
+ readonly paramsSchema: import("@standard-schema/spec").StandardSchemaV1<void, void>;
85
83
  factory(): (ctx: CodecInstanceContext) => SqliteDatetimeCodec;
86
84
  }
87
- declare const sqliteDatetimeColumn: () => _$_prisma_next_framework_components_codec0.ColumnSpec<SqliteDatetimeCodec, undefined>;
85
+ declare const sqliteDatetimeColumn: () => import("@prisma-next/framework-components/codec").ColumnSpec<SqliteDatetimeCodec, undefined>;
88
86
  declare class SqliteJsonCodec extends CodecImpl<typeof SQLITE_JSON_CODEC_ID, readonly ['equality'], string | JsonValue, JsonValue> {
89
87
  encode(value: JsonValue, _ctx: CodecCallContext): Promise<string>;
90
88
  decode(wire: string | JsonValue, _ctx: CodecCallContext): Promise<JsonValue>;
@@ -95,10 +93,10 @@ declare class SqliteJsonDescriptor extends CodecDescriptorImpl<void> {
95
93
  readonly codecId: "sqlite/json@1";
96
94
  readonly traits: readonly ["equality"];
97
95
  readonly targetTypes: readonly ["text"];
98
- readonly paramsSchema: _$_standard_schema_spec0.StandardSchemaV1<void, void>;
96
+ readonly paramsSchema: import("@standard-schema/spec").StandardSchemaV1<void, void>;
99
97
  factory(): (ctx: CodecInstanceContext) => SqliteJsonCodec;
100
98
  }
101
- declare const sqliteJsonColumn: () => _$_prisma_next_framework_components_codec0.ColumnSpec<SqliteJsonCodec, undefined>;
99
+ declare const sqliteJsonColumn: () => import("@prisma-next/framework-components/codec").ColumnSpec<SqliteJsonCodec, undefined>;
102
100
  declare class SqliteBigintCodec extends CodecImpl<typeof SQLITE_BIGINT_CODEC_ID, readonly ['equality', 'order', 'numeric'], number | bigint, bigint> {
103
101
  encode(value: bigint, _ctx: CodecCallContext): Promise<number | bigint>;
104
102
  decode(wire: number | bigint, _ctx: CodecCallContext): Promise<bigint>;
@@ -109,10 +107,10 @@ declare class SqliteBigintDescriptor extends CodecDescriptorImpl<void> {
109
107
  readonly codecId: "sqlite/bigint@1";
110
108
  readonly traits: readonly ["equality", "order", "numeric"];
111
109
  readonly targetTypes: readonly ["integer"];
112
- readonly paramsSchema: _$_standard_schema_spec0.StandardSchemaV1<void, void>;
110
+ readonly paramsSchema: import("@standard-schema/spec").StandardSchemaV1<void, void>;
113
111
  factory(): (ctx: CodecInstanceContext) => SqliteBigintCodec;
114
112
  }
115
- declare const sqliteBigintColumn: () => _$_prisma_next_framework_components_codec0.ColumnSpec<SqliteBigintCodec, undefined>;
113
+ declare const sqliteBigintColumn: () => import("@prisma-next/framework-components/codec").ColumnSpec<SqliteBigintCodec, undefined>;
116
114
  //#endregion
117
115
  //#region src/core/registry.d.ts
118
116
  /**
@@ -123,4 +121,4 @@ declare const sqliteBigintColumn: () => _$_prisma_next_framework_components_code
123
121
  declare const sqliteCodecRegistry: CodecDescriptorRegistry;
124
122
  //#endregion
125
123
  export { SqliteIntegerDescriptor as a, SqliteTextDescriptor as c, sqliteDatetimeColumn as d, sqliteIntegerColumn as f, JsonValue$1 as g, sqliteTextColumn as h, SqliteDatetimeDescriptor as i, sqliteBigintColumn as l, sqliteRealColumn as m, SqliteBigintDescriptor as n, SqliteJsonDescriptor as o, sqliteJsonColumn as p, SqliteBlobDescriptor as r, SqliteRealDescriptor as s, sqliteCodecRegistry as t, sqliteBlobColumn as u };
126
- //# sourceMappingURL=codecs-DqDWNIKq.d.mts.map
124
+ //# sourceMappingURL=codecs-BGeJavlQ.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codecs-BGeJavlQ.d.mts","names":[],"sources":["../src/core/codec-helpers.ts","../src/core/codecs.ts","../src/core/registry.ts"],"mappings":";;;;;;;;;KAIY,WAAA;EAAA,UAKI,GAAA,WAAc,WAAA;AAA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CODEC_ID, i as SQLITE_INTEGER_CODEC_ID, n as SQLITE_BLOB_CODEC_ID, o as SQLITE_REAL_CODEC_ID, r as SQLITE_DATETIME_CODEC_ID, s as SQLITE_TEXT_CODEC_ID, t as SQLITE_BIGINT_CODEC_ID } from "./codec-ids-CuUxYcd0.mjs";
1
+ import { a as SQLITE_JSON_CODEC_ID, i as SQLITE_INTEGER_CODEC_ID, n as SQLITE_BLOB_CODEC_ID, o as SQLITE_REAL_CODEC_ID, r as SQLITE_DATETIME_CODEC_ID, s as SQLITE_TEXT_CODEC_ID, t as SQLITE_BIGINT_CODEC_ID } from "./codec-ids-DSU7S2Li.mjs";
2
2
  import { sqlCharDescriptor, sqlFloatDescriptor, sqlIntDescriptor, sqlVarcharDescriptor } from "@prisma-next/sql-relational-core/ast";
3
3
  import { CodecDescriptorImpl, CodecImpl, column, voidParamsSchema } from "@prisma-next/framework-components/codec";
4
4
  //#region src/core/codecs.ts
@@ -217,4 +217,4 @@ const codecDescriptors = [
217
217
  //#endregion
218
218
  export { sqliteIntegerColumn as a, sqliteTextColumn as c, sqliteDatetimeColumn as i, sqliteBigintColumn as n, sqliteJsonColumn as o, sqliteBlobColumn as r, sqliteRealColumn as s, codecDescriptors as t };
219
219
 
220
- //# sourceMappingURL=codecs-DVnHtVWW.mjs.map
220
+ //# sourceMappingURL=codecs-DsC4OGmU.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"codecs-DVnHtVWW.mjs","names":[],"sources":["../src/core/codecs.ts"],"sourcesContent":["/**\n * Native SQLite target codecs (TML-2357). Mirrors the Postgres codec class form in `packages/3-targets/3-targets/postgres/src/core/codecs.ts`.\n *\n * Each codec ships as three artifacts:\n *\n * 1. A `SqliteXCodec` class extending {@link CodecImpl} that wraps the encode/decode/encodeJson/decodeJson conversions inline. SQLite's runtime conversions are simple enough that there is no shared helper module; the class bodies are the single source of truth. 2. A `SqliteXDescriptor` class extending {@link CodecDescriptorImpl} declaring the codec id, traits, target types, and params schema. SQLite codecs do not carry\n * `meta` (no per-target native-type meta today) and are all non-parameterized. 3. A per-codec column helper (`sqliteXColumn`) 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` + `ColumnHelperForStrict` (every SQLite codec's resolved type is well-defined).\n *\n * After TML-2357 this is the canonical source of SQLite codec metadata and runtime behaviour — the legacy `mkCodec` / `defineCodec` carriers (and the parallel `byScalar` / `codecDescriptorDefinitions` collection exports) retired with the deletion sweep.\n *\n * Audit: every SQLite codec is non-parameterized and parameter-stateless; `factory()` takes no params (`P = void`) and returns a fresh codec constructed solely from `this`.\n */\n\nimport type { JsonValue } from '@prisma-next/contract/types';\nimport {\n type AnyCodecDescriptor,\n type CodecCallContext,\n CodecDescriptorImpl,\n CodecImpl,\n type CodecInstanceContext,\n type ColumnHelperFor,\n type ColumnHelperForStrict,\n column,\n voidParamsSchema,\n} from '@prisma-next/framework-components/codec';\nimport {\n sqlCharDescriptor,\n sqlFloatDescriptor,\n sqlIntDescriptor,\n sqlVarcharDescriptor,\n} from '@prisma-next/sql-relational-core/ast';\nimport {\n SQLITE_BIGINT_CODEC_ID,\n SQLITE_BLOB_CODEC_ID,\n SQLITE_DATETIME_CODEC_ID,\n SQLITE_INTEGER_CODEC_ID,\n SQLITE_JSON_CODEC_ID,\n SQLITE_REAL_CODEC_ID,\n SQLITE_TEXT_CODEC_ID,\n} from './codec-ids';\n\nexport class SqliteTextCodec extends CodecImpl<\n typeof SQLITE_TEXT_CODEC_ID,\n readonly ['equality', 'order', 'textual'],\n string,\n string\n> {\n async encode(value: string, _ctx: CodecCallContext): Promise<string> {\n return value;\n }\n async decode(wire: string, _ctx: CodecCallContext): Promise<string> {\n return wire;\n }\n encodeJson(value: string): JsonValue {\n return value;\n }\n decodeJson(json: JsonValue): string {\n return json as string;\n }\n}\n\nexport class SqliteTextDescriptor extends CodecDescriptorImpl<void> {\n override readonly codecId = SQLITE_TEXT_CODEC_ID;\n override readonly traits = ['equality', 'order', 'textual'] as const;\n override readonly targetTypes = ['text'] as const;\n override readonly paramsSchema = voidParamsSchema;\n override factory(): (ctx: CodecInstanceContext) => SqliteTextCodec {\n return () => new SqliteTextCodec(this);\n }\n}\n\nexport const sqliteTextDescriptor = new SqliteTextDescriptor();\n\nexport const sqliteTextColumn = () =>\n column(sqliteTextDescriptor.factory(), sqliteTextDescriptor.codecId, undefined, 'text');\n\nsqliteTextColumn satisfies ColumnHelperFor<SqliteTextDescriptor>;\nsqliteTextColumn satisfies ColumnHelperForStrict<SqliteTextDescriptor>;\n\nexport class SqliteIntegerCodec extends CodecImpl<\n typeof SQLITE_INTEGER_CODEC_ID,\n readonly ['equality', 'order', 'numeric'],\n number,\n number\n> {\n async encode(value: number, _ctx: CodecCallContext): Promise<number> {\n return value;\n }\n async decode(wire: number, _ctx: CodecCallContext): Promise<number> {\n return wire;\n }\n encodeJson(value: number): JsonValue {\n return value;\n }\n decodeJson(json: JsonValue): number {\n return json as number;\n }\n}\n\nexport class SqliteIntegerDescriptor extends CodecDescriptorImpl<void> {\n override readonly codecId = SQLITE_INTEGER_CODEC_ID;\n override readonly traits = ['equality', 'order', 'numeric'] as const;\n override readonly targetTypes = ['integer'] as const;\n override readonly paramsSchema = voidParamsSchema;\n override factory(): (ctx: CodecInstanceContext) => SqliteIntegerCodec {\n return () => new SqliteIntegerCodec(this);\n }\n}\n\nexport const sqliteIntegerDescriptor = new SqliteIntegerDescriptor();\n\nexport const sqliteIntegerColumn = () =>\n column(sqliteIntegerDescriptor.factory(), sqliteIntegerDescriptor.codecId, undefined, 'integer');\n\nsqliteIntegerColumn satisfies ColumnHelperFor<SqliteIntegerDescriptor>;\nsqliteIntegerColumn satisfies ColumnHelperForStrict<SqliteIntegerDescriptor>;\n\nexport class SqliteRealCodec extends CodecImpl<\n typeof SQLITE_REAL_CODEC_ID,\n readonly ['equality', 'order', 'numeric'],\n number,\n number\n> {\n async encode(value: number, _ctx: CodecCallContext): Promise<number> {\n return value;\n }\n async decode(wire: number, _ctx: CodecCallContext): Promise<number> {\n return wire;\n }\n encodeJson(value: number): JsonValue {\n return value;\n }\n decodeJson(json: JsonValue): number {\n return json as number;\n }\n}\n\nexport class SqliteRealDescriptor extends CodecDescriptorImpl<void> {\n override readonly codecId = SQLITE_REAL_CODEC_ID;\n override readonly traits = ['equality', 'order', 'numeric'] as const;\n override readonly targetTypes = ['real'] as const;\n override readonly paramsSchema = voidParamsSchema;\n override factory(): (ctx: CodecInstanceContext) => SqliteRealCodec {\n return () => new SqliteRealCodec(this);\n }\n}\n\nexport const sqliteRealDescriptor = new SqliteRealDescriptor();\n\nexport const sqliteRealColumn = () =>\n column(sqliteRealDescriptor.factory(), sqliteRealDescriptor.codecId, undefined, 'real');\n\nsqliteRealColumn satisfies ColumnHelperFor<SqliteRealDescriptor>;\nsqliteRealColumn satisfies ColumnHelperForStrict<SqliteRealDescriptor>;\n\nexport class SqliteBlobCodec extends CodecImpl<\n typeof SQLITE_BLOB_CODEC_ID,\n readonly ['equality'],\n Uint8Array,\n Uint8Array\n> {\n async encode(value: Uint8Array, _ctx: CodecCallContext): Promise<Uint8Array> {\n return value;\n }\n async decode(wire: Uint8Array, _ctx: CodecCallContext): Promise<Uint8Array> {\n return wire;\n }\n encodeJson(value: Uint8Array): JsonValue {\n return Buffer.from(value).toString('base64');\n }\n decodeJson(json: JsonValue): Uint8Array {\n if (typeof json !== 'string') {\n throw new TypeError('sqlite/blob@1 contract value must be a base64 string');\n }\n return new Uint8Array(Buffer.from(json, 'base64'));\n }\n}\n\nexport class SqliteBlobDescriptor extends CodecDescriptorImpl<void> {\n override readonly codecId = SQLITE_BLOB_CODEC_ID;\n override readonly traits = ['equality'] as const;\n override readonly targetTypes = ['blob'] as const;\n override readonly paramsSchema = voidParamsSchema;\n override factory(): (ctx: CodecInstanceContext) => SqliteBlobCodec {\n return () => new SqliteBlobCodec(this);\n }\n}\n\nexport const sqliteBlobDescriptor = new SqliteBlobDescriptor();\n\nexport const sqliteBlobColumn = () =>\n column(sqliteBlobDescriptor.factory(), sqliteBlobDescriptor.codecId, undefined, 'blob');\n\nsqliteBlobColumn satisfies ColumnHelperFor<SqliteBlobDescriptor>;\nsqliteBlobColumn satisfies ColumnHelperForStrict<SqliteBlobDescriptor>;\n\nexport class SqliteDatetimeCodec extends CodecImpl<\n typeof SQLITE_DATETIME_CODEC_ID,\n readonly ['equality', 'order'],\n string,\n Date\n> {\n // Reject `Invalid Date` (NaN-time) at every decode ingress so consumers never receive a Date object whose downstream operations silently produce NaN. Mirrors the stricter ISO-8601 validation on the postgres timestamp helpers.\n private parseDate(value: string): Date {\n const date = new Date(value);\n if (Number.isNaN(date.getTime())) {\n throw new TypeError(`sqlite/datetime@1 value must be a valid ISO-8601 string: ${value}`);\n }\n return date;\n }\n async encode(value: Date, _ctx: CodecCallContext): Promise<string> {\n return value.toISOString();\n }\n async decode(wire: string, _ctx: CodecCallContext): Promise<Date> {\n return this.parseDate(wire);\n }\n encodeJson(value: Date): JsonValue {\n return value.toISOString();\n }\n decodeJson(json: JsonValue): Date {\n if (typeof json !== 'string') {\n throw new TypeError('sqlite/datetime@1 contract value must be an ISO-8601 string');\n }\n return this.parseDate(json);\n }\n}\n\nexport class SqliteDatetimeDescriptor extends CodecDescriptorImpl<void> {\n override readonly codecId = SQLITE_DATETIME_CODEC_ID;\n override readonly traits = ['equality', 'order'] as const;\n override readonly targetTypes = ['text'] as const;\n override readonly paramsSchema = voidParamsSchema;\n override factory(): (ctx: CodecInstanceContext) => SqliteDatetimeCodec {\n return () => new SqliteDatetimeCodec(this);\n }\n}\n\nexport const sqliteDatetimeDescriptor = new SqliteDatetimeDescriptor();\n\nexport const sqliteDatetimeColumn = () =>\n column(sqliteDatetimeDescriptor.factory(), sqliteDatetimeDescriptor.codecId, undefined, 'text');\n\nsqliteDatetimeColumn satisfies ColumnHelperFor<SqliteDatetimeDescriptor>;\nsqliteDatetimeColumn satisfies ColumnHelperForStrict<SqliteDatetimeDescriptor>;\n\nexport class SqliteJsonCodec extends CodecImpl<\n typeof SQLITE_JSON_CODEC_ID,\n readonly ['equality'],\n string | JsonValue,\n JsonValue\n> {\n async encode(value: JsonValue, _ctx: CodecCallContext): Promise<string> {\n return JSON.stringify(value);\n }\n async decode(wire: string | JsonValue, _ctx: CodecCallContext): Promise<JsonValue> {\n return typeof wire === 'string' ? (JSON.parse(wire) as JsonValue) : wire;\n }\n encodeJson(value: JsonValue): JsonValue {\n return value;\n }\n decodeJson(json: JsonValue): JsonValue {\n return json;\n }\n}\n\nexport class SqliteJsonDescriptor extends CodecDescriptorImpl<void> {\n override readonly codecId = SQLITE_JSON_CODEC_ID;\n override readonly traits = ['equality'] as const;\n override readonly targetTypes = ['text'] as const;\n override readonly paramsSchema = voidParamsSchema;\n override factory(): (ctx: CodecInstanceContext) => SqliteJsonCodec {\n return () => new SqliteJsonCodec(this);\n }\n}\n\nexport const sqliteJsonDescriptor = new SqliteJsonDescriptor();\n\nexport const sqliteJsonColumn = () =>\n column(sqliteJsonDescriptor.factory(), sqliteJsonDescriptor.codecId, undefined, 'text');\n\nsqliteJsonColumn satisfies ColumnHelperFor<SqliteJsonDescriptor>;\nsqliteJsonColumn satisfies ColumnHelperForStrict<SqliteJsonDescriptor>;\n\nexport class SqliteBigintCodec extends CodecImpl<\n typeof SQLITE_BIGINT_CODEC_ID,\n readonly ['equality', 'order', 'numeric'],\n number | bigint,\n bigint\n> {\n async encode(value: bigint, _ctx: CodecCallContext): Promise<number | bigint> {\n return value;\n }\n async decode(wire: number | bigint, _ctx: CodecCallContext): Promise<bigint> {\n return BigInt(wire);\n }\n encodeJson(value: bigint): JsonValue {\n return value.toString();\n }\n decodeJson(json: JsonValue): bigint {\n if (typeof json !== 'string' && typeof json !== 'number') {\n throw new TypeError('sqlite/bigint@1 contract value must be a string or number');\n }\n return BigInt(json);\n }\n}\n\nexport class SqliteBigintDescriptor extends CodecDescriptorImpl<void> {\n override readonly codecId = SQLITE_BIGINT_CODEC_ID;\n override readonly traits = ['equality', 'order', 'numeric'] as const;\n override readonly targetTypes = ['integer'] as const;\n override readonly paramsSchema = voidParamsSchema;\n override factory(): (ctx: CodecInstanceContext) => SqliteBigintCodec {\n return () => new SqliteBigintCodec(this);\n }\n}\n\nexport const sqliteBigintDescriptor = new SqliteBigintDescriptor();\n\nexport const sqliteBigintColumn = () =>\n column(sqliteBigintDescriptor.factory(), sqliteBigintDescriptor.codecId, undefined, 'integer');\n\nsqliteBigintColumn satisfies ColumnHelperFor<SqliteBigintDescriptor>;\nsqliteBigintColumn satisfies ColumnHelperForStrict<SqliteBigintDescriptor>;\n\nexport const codecDescriptors: readonly AnyCodecDescriptor[] = [\n sqlCharDescriptor,\n sqlVarcharDescriptor,\n sqlIntDescriptor,\n sqlFloatDescriptor,\n sqliteTextDescriptor,\n sqliteIntegerDescriptor,\n sqliteRealDescriptor,\n sqliteBlobDescriptor,\n sqliteDatetimeDescriptor,\n sqliteJsonDescriptor,\n sqliteBigintDescriptor,\n];\n"],"mappings":";;;;AAyCA,IAAa,kBAAb,cAAqC,UAKnC;CACA,MAAM,OAAO,OAAe,MAAyC;EACnE,OAAO;CACT;CACA,MAAM,OAAO,MAAc,MAAyC;EAClE,OAAO;CACT;CACA,WAAW,OAA0B;EACnC,OAAO;CACT;CACA,WAAW,MAAyB;EAClC,OAAO;CACT;AACF;AAEA,IAAa,uBAAb,cAA0C,oBAA0B;CAClE,UAA4B;CAC5B,SAA2B;EAAC;EAAY;EAAS;CAAS;CAC1D,cAAgC,CAAC,MAAM;CACvC,eAAiC;CACjC,UAAmE;EACjE,aAAa,IAAI,gBAAgB,IAAI;CACvC;AACF;AAEA,MAAa,uBAAuB,IAAI,qBAAqB;AAE7D,MAAa,yBACX,OAAO,qBAAqB,QAAQ,GAAG,qBAAqB,SAAS,KAAA,GAAW,MAAM;AAKxF,IAAa,qBAAb,cAAwC,UAKtC;CACA,MAAM,OAAO,OAAe,MAAyC;EACnE,OAAO;CACT;CACA,MAAM,OAAO,MAAc,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O,SAAS,WAAY,KAAK,MAAM,IAAI,IAAkB;CACtE;CACA,WAAW,OAA6B;EACtC,OAAO;CACT;CACA,WAAW,MAA4B;EACrC,OAAO;CACT;AACF;AAEA,IAAa,uBAAb,cAA0C,oBAA0B;CAClE,UAA4B;CAC5B,SAA2B,CAAC,UAAU;CACtC,cAAgC,CAAC,MAAM;CACvC,eAAiC;CACjC,UAAmE;EACjE,aAAa,IAAI,gBAAgB,IAAI;CACvC;AACF;AAEA,MAAa,uBAAuB,IAAI,qBAAqB;AAE7D,MAAa,yBACX,OAAO,qBAAqB,QAAQ,GAAG,qBAAqB,SAAS,KAAA,GAAW,MAAM;AAKxF,IAAa,oBAAb,cAAuC,UAKrC;CACA,MAAM,OAAO,OAAe,MAAkD;EAC5E,OAAO;CACT;CACA,MAAM,OAAO,MAAuB,MAAyC;EAC3E,OAAO,OAAO,IAAI;CACpB;CACA,WAAW,OAA0B;EACnC,OAAO,MAAM,SAAS;CACxB;CACA,WAAW,MAAyB;EAClC,IAAI,OAAO,SAAS,YAAY,OAAO,SAAS,UAC9C,MAAM,IAAI,UAAU,2DAA2D;EAEjF,OAAO,OAAO,IAAI;CACpB;AACF;AAEA,IAAa,yBAAb,cAA4C,oBAA0B;CACpE,UAA4B;CAC5B,SAA2B;EAAC;EAAY;EAAS;CAAS;CAC1D,cAAgC,CAAC,SAAS;CAC1C,eAAiC;CACjC,UAAqE;EACnE,aAAa,IAAI,kBAAkB,IAAI;CACzC;AACF;AAEA,MAAa,yBAAyB,IAAI,uBAAuB;AAEjE,MAAa,2BACX,OAAO,uBAAuB,QAAQ,GAAG,uBAAuB,SAAS,KAAA,GAAW,SAAS;AAK/F,MAAa,mBAAkD;CAC7D;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
1
+ {"version":3,"file":"codecs-DsC4OGmU.mjs","names":[],"sources":["../src/core/codecs.ts"],"sourcesContent":["/**\n * Native SQLite target codecs (TML-2357). Mirrors the Postgres codec class form in `packages/3-targets/3-targets/postgres/src/core/codecs.ts`.\n *\n * Each codec ships as three artifacts:\n *\n * 1. A `SqliteXCodec` class extending {@link CodecImpl} that wraps the encode/decode/encodeJson/decodeJson conversions inline. SQLite's runtime conversions are simple enough that there is no shared helper module; the class bodies are the single source of truth. 2. A `SqliteXDescriptor` class extending {@link CodecDescriptorImpl} declaring the codec id, traits, target types, and params schema. SQLite codecs do not carry\n * `meta` (no per-target native-type meta today) and are all non-parameterized. 3. A per-codec column helper (`sqliteXColumn`) 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` + `ColumnHelperForStrict` (every SQLite codec's resolved type is well-defined).\n *\n * After TML-2357 this is the canonical source of SQLite codec metadata and runtime behaviour — the legacy `mkCodec` / `defineCodec` carriers (and the parallel `byScalar` / `codecDescriptorDefinitions` collection exports) retired with the deletion sweep.\n *\n * Audit: every SQLite codec is non-parameterized and parameter-stateless; `factory()` takes no params (`P = void`) and returns a fresh codec constructed solely from `this`.\n */\n\nimport type { JsonValue } from '@prisma-next/contract/types';\nimport {\n type AnyCodecDescriptor,\n type CodecCallContext,\n CodecDescriptorImpl,\n CodecImpl,\n type CodecInstanceContext,\n type ColumnHelperFor,\n type ColumnHelperForStrict,\n column,\n voidParamsSchema,\n} from '@prisma-next/framework-components/codec';\nimport {\n sqlCharDescriptor,\n sqlFloatDescriptor,\n sqlIntDescriptor,\n sqlVarcharDescriptor,\n} from '@prisma-next/sql-relational-core/ast';\nimport {\n SQLITE_BIGINT_CODEC_ID,\n SQLITE_BLOB_CODEC_ID,\n SQLITE_DATETIME_CODEC_ID,\n SQLITE_INTEGER_CODEC_ID,\n SQLITE_JSON_CODEC_ID,\n SQLITE_REAL_CODEC_ID,\n SQLITE_TEXT_CODEC_ID,\n} from './codec-ids';\n\nexport class SqliteTextCodec extends CodecImpl<\n typeof SQLITE_TEXT_CODEC_ID,\n readonly ['equality', 'order', 'textual'],\n string,\n string\n> {\n async encode(value: string, _ctx: CodecCallContext): Promise<string> {\n return value;\n }\n async decode(wire: string, _ctx: CodecCallContext): Promise<string> {\n return wire;\n }\n encodeJson(value: string): JsonValue {\n return value;\n }\n decodeJson(json: JsonValue): string {\n return json as string;\n }\n}\n\nexport class SqliteTextDescriptor extends CodecDescriptorImpl<void> {\n override readonly codecId = SQLITE_TEXT_CODEC_ID;\n override readonly traits = ['equality', 'order', 'textual'] as const;\n override readonly targetTypes = ['text'] as const;\n override readonly paramsSchema = voidParamsSchema;\n override factory(): (ctx: CodecInstanceContext) => SqliteTextCodec {\n return () => new SqliteTextCodec(this);\n }\n}\n\nexport const sqliteTextDescriptor = new SqliteTextDescriptor();\n\nexport const sqliteTextColumn = () =>\n column(sqliteTextDescriptor.factory(), sqliteTextDescriptor.codecId, undefined, 'text');\n\nsqliteTextColumn satisfies ColumnHelperFor<SqliteTextDescriptor>;\nsqliteTextColumn satisfies ColumnHelperForStrict<SqliteTextDescriptor>;\n\nexport class SqliteIntegerCodec extends CodecImpl<\n typeof SQLITE_INTEGER_CODEC_ID,\n readonly ['equality', 'order', 'numeric'],\n number,\n number\n> {\n async encode(value: number, _ctx: CodecCallContext): Promise<number> {\n return value;\n }\n async decode(wire: number, _ctx: CodecCallContext): Promise<number> {\n return wire;\n }\n encodeJson(value: number): JsonValue {\n return value;\n }\n decodeJson(json: JsonValue): number {\n return json as number;\n }\n}\n\nexport class SqliteIntegerDescriptor extends CodecDescriptorImpl<void> {\n override readonly codecId = SQLITE_INTEGER_CODEC_ID;\n override readonly traits = ['equality', 'order', 'numeric'] as const;\n override readonly targetTypes = ['integer'] as const;\n override readonly paramsSchema = voidParamsSchema;\n override factory(): (ctx: CodecInstanceContext) => SqliteIntegerCodec {\n return () => new SqliteIntegerCodec(this);\n }\n}\n\nexport const sqliteIntegerDescriptor = new SqliteIntegerDescriptor();\n\nexport const sqliteIntegerColumn = () =>\n column(sqliteIntegerDescriptor.factory(), sqliteIntegerDescriptor.codecId, undefined, 'integer');\n\nsqliteIntegerColumn satisfies ColumnHelperFor<SqliteIntegerDescriptor>;\nsqliteIntegerColumn satisfies ColumnHelperForStrict<SqliteIntegerDescriptor>;\n\nexport class SqliteRealCodec extends CodecImpl<\n typeof SQLITE_REAL_CODEC_ID,\n readonly ['equality', 'order', 'numeric'],\n number,\n number\n> {\n async encode(value: number, _ctx: CodecCallContext): Promise<number> {\n return value;\n }\n async decode(wire: number, _ctx: CodecCallContext): Promise<number> {\n return wire;\n }\n encodeJson(value: number): JsonValue {\n return value;\n }\n decodeJson(json: JsonValue): number {\n return json as number;\n }\n}\n\nexport class SqliteRealDescriptor extends CodecDescriptorImpl<void> {\n override readonly codecId = SQLITE_REAL_CODEC_ID;\n override readonly traits = ['equality', 'order', 'numeric'] as const;\n override readonly targetTypes = ['real'] as const;\n override readonly paramsSchema = voidParamsSchema;\n override factory(): (ctx: CodecInstanceContext) => SqliteRealCodec {\n return () => new SqliteRealCodec(this);\n }\n}\n\nexport const sqliteRealDescriptor = new SqliteRealDescriptor();\n\nexport const sqliteRealColumn = () =>\n column(sqliteRealDescriptor.factory(), sqliteRealDescriptor.codecId, undefined, 'real');\n\nsqliteRealColumn satisfies ColumnHelperFor<SqliteRealDescriptor>;\nsqliteRealColumn satisfies ColumnHelperForStrict<SqliteRealDescriptor>;\n\nexport class SqliteBlobCodec extends CodecImpl<\n typeof SQLITE_BLOB_CODEC_ID,\n readonly ['equality'],\n Uint8Array,\n Uint8Array\n> {\n async encode(value: Uint8Array, _ctx: CodecCallContext): Promise<Uint8Array> {\n return value;\n }\n async decode(wire: Uint8Array, _ctx: CodecCallContext): Promise<Uint8Array> {\n return wire;\n }\n encodeJson(value: Uint8Array): JsonValue {\n return Buffer.from(value).toString('base64');\n }\n decodeJson(json: JsonValue): Uint8Array {\n if (typeof json !== 'string') {\n throw new TypeError('sqlite/blob@1 contract value must be a base64 string');\n }\n return new Uint8Array(Buffer.from(json, 'base64'));\n }\n}\n\nexport class SqliteBlobDescriptor extends CodecDescriptorImpl<void> {\n override readonly codecId = SQLITE_BLOB_CODEC_ID;\n override readonly traits = ['equality'] as const;\n override readonly targetTypes = ['blob'] as const;\n override readonly paramsSchema = voidParamsSchema;\n override factory(): (ctx: CodecInstanceContext) => SqliteBlobCodec {\n return () => new SqliteBlobCodec(this);\n }\n}\n\nexport const sqliteBlobDescriptor = new SqliteBlobDescriptor();\n\nexport const sqliteBlobColumn = () =>\n column(sqliteBlobDescriptor.factory(), sqliteBlobDescriptor.codecId, undefined, 'blob');\n\nsqliteBlobColumn satisfies ColumnHelperFor<SqliteBlobDescriptor>;\nsqliteBlobColumn satisfies ColumnHelperForStrict<SqliteBlobDescriptor>;\n\nexport class SqliteDatetimeCodec extends CodecImpl<\n typeof SQLITE_DATETIME_CODEC_ID,\n readonly ['equality', 'order'],\n string,\n Date\n> {\n // Reject `Invalid Date` (NaN-time) at every decode ingress so consumers never receive a Date object whose downstream operations silently produce NaN. Mirrors the stricter ISO-8601 validation on the postgres timestamp helpers.\n private parseDate(value: string): Date {\n const date = new Date(value);\n if (Number.isNaN(date.getTime())) {\n throw new TypeError(`sqlite/datetime@1 value must be a valid ISO-8601 string: ${value}`);\n }\n return date;\n }\n async encode(value: Date, _ctx: CodecCallContext): Promise<string> {\n return value.toISOString();\n }\n async decode(wire: string, _ctx: CodecCallContext): Promise<Date> {\n return this.parseDate(wire);\n }\n encodeJson(value: Date): JsonValue {\n return value.toISOString();\n }\n decodeJson(json: JsonValue): Date {\n if (typeof json !== 'string') {\n throw new TypeError('sqlite/datetime@1 contract value must be an ISO-8601 string');\n }\n return this.parseDate(json);\n }\n}\n\nexport class SqliteDatetimeDescriptor extends CodecDescriptorImpl<void> {\n override readonly codecId = SQLITE_DATETIME_CODEC_ID;\n override readonly traits = ['equality', 'order'] as const;\n override readonly targetTypes = ['text'] as const;\n override readonly paramsSchema = voidParamsSchema;\n override factory(): (ctx: CodecInstanceContext) => SqliteDatetimeCodec {\n return () => new SqliteDatetimeCodec(this);\n }\n}\n\nexport const sqliteDatetimeDescriptor = new SqliteDatetimeDescriptor();\n\nexport const sqliteDatetimeColumn = () =>\n column(sqliteDatetimeDescriptor.factory(), sqliteDatetimeDescriptor.codecId, undefined, 'text');\n\nsqliteDatetimeColumn satisfies ColumnHelperFor<SqliteDatetimeDescriptor>;\nsqliteDatetimeColumn satisfies ColumnHelperForStrict<SqliteDatetimeDescriptor>;\n\nexport class SqliteJsonCodec extends CodecImpl<\n typeof SQLITE_JSON_CODEC_ID,\n readonly ['equality'],\n string | JsonValue,\n JsonValue\n> {\n async encode(value: JsonValue, _ctx: CodecCallContext): Promise<string> {\n return JSON.stringify(value);\n }\n async decode(wire: string | JsonValue, _ctx: CodecCallContext): Promise<JsonValue> {\n return typeof wire === 'string' ? (JSON.parse(wire) as JsonValue) : wire;\n }\n encodeJson(value: JsonValue): JsonValue {\n return value;\n }\n decodeJson(json: JsonValue): JsonValue {\n return json;\n }\n}\n\nexport class SqliteJsonDescriptor extends CodecDescriptorImpl<void> {\n override readonly codecId = SQLITE_JSON_CODEC_ID;\n override readonly traits = ['equality'] as const;\n override readonly targetTypes = ['text'] as const;\n override readonly paramsSchema = voidParamsSchema;\n override factory(): (ctx: CodecInstanceContext) => SqliteJsonCodec {\n return () => new SqliteJsonCodec(this);\n }\n}\n\nexport const sqliteJsonDescriptor = new SqliteJsonDescriptor();\n\nexport const sqliteJsonColumn = () =>\n column(sqliteJsonDescriptor.factory(), sqliteJsonDescriptor.codecId, undefined, 'text');\n\nsqliteJsonColumn satisfies ColumnHelperFor<SqliteJsonDescriptor>;\nsqliteJsonColumn satisfies ColumnHelperForStrict<SqliteJsonDescriptor>;\n\nexport class SqliteBigintCodec extends CodecImpl<\n typeof SQLITE_BIGINT_CODEC_ID,\n readonly ['equality', 'order', 'numeric'],\n number | bigint,\n bigint\n> {\n async encode(value: bigint, _ctx: CodecCallContext): Promise<number | bigint> {\n return value;\n }\n async decode(wire: number | bigint, _ctx: CodecCallContext): Promise<bigint> {\n return BigInt(wire);\n }\n encodeJson(value: bigint): JsonValue {\n return value.toString();\n }\n decodeJson(json: JsonValue): bigint {\n if (typeof json !== 'string' && typeof json !== 'number') {\n throw new TypeError('sqlite/bigint@1 contract value must be a string or number');\n }\n return BigInt(json);\n }\n}\n\nexport class SqliteBigintDescriptor extends CodecDescriptorImpl<void> {\n override readonly codecId = SQLITE_BIGINT_CODEC_ID;\n override readonly traits = ['equality', 'order', 'numeric'] as const;\n override readonly targetTypes = ['integer'] as const;\n override readonly paramsSchema = voidParamsSchema;\n override factory(): (ctx: CodecInstanceContext) => SqliteBigintCodec {\n return () => new SqliteBigintCodec(this);\n }\n}\n\nexport const sqliteBigintDescriptor = new SqliteBigintDescriptor();\n\nexport const sqliteBigintColumn = () =>\n column(sqliteBigintDescriptor.factory(), sqliteBigintDescriptor.codecId, undefined, 'integer');\n\nsqliteBigintColumn satisfies ColumnHelperFor<SqliteBigintDescriptor>;\nsqliteBigintColumn satisfies ColumnHelperForStrict<SqliteBigintDescriptor>;\n\nexport const codecDescriptors: readonly AnyCodecDescriptor[] = [\n sqlCharDescriptor,\n sqlVarcharDescriptor,\n sqlIntDescriptor,\n sqlFloatDescriptor,\n sqliteTextDescriptor,\n sqliteIntegerDescriptor,\n sqliteRealDescriptor,\n sqliteBlobDescriptor,\n sqliteDatetimeDescriptor,\n sqliteJsonDescriptor,\n sqliteBigintDescriptor,\n];\n"],"mappings":";;;;AAyCA,IAAa,kBAAb,cAAqC,UAKnC;CACA,MAAM,OAAO,OAAe,MAAyC;EACnE,OAAO;CACT;CACA,MAAM,OAAO,MAAc,MAAyC;EAClE,OAAO;CACT;CACA,WAAW,OAA0B;EACnC,OAAO;CACT;CACA,WAAW,MAAyB;EAClC,OAAO;CACT;AACF;AAEA,IAAa,uBAAb,cAA0C,oBAA0B;CAClE,UAA4B;CAC5B,SAA2B;EAAC;EAAY;EAAS;CAAS;CAC1D,cAAgC,CAAC,MAAM;CACvC,eAAiC;CACjC,UAAmE;EACjE,aAAa,IA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B,QAAQ,GAAG,uBAAuB,SAAS,KAAA,GAAW,SAAS;AAK/F,MAAa,mBAAkD;CAC7D;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
package/dist/codecs.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as SqliteIntegerDescriptor, c as SqliteTextDescriptor, d as sqliteDatetimeColumn, f as sqliteIntegerColumn, g as JsonValue, h as sqliteTextColumn, i as SqliteDatetimeDescriptor, l as sqliteBigintColumn, m as sqliteRealColumn, n as SqliteBigintDescriptor, o as SqliteJsonDescriptor, p as sqliteJsonColumn, r as SqliteBlobDescriptor, s as SqliteRealDescriptor, t as sqliteCodecRegistry, u as sqliteBlobColumn } from "./codecs-DqDWNIKq.mjs";
2
- export { JsonValue, SqliteBigintDescriptor, SqliteBlobDescriptor, SqliteDatetimeDescriptor, SqliteIntegerDescriptor, SqliteJsonDescriptor, SqliteRealDescriptor, SqliteTextDescriptor, sqliteBigintColumn, sqliteBlobColumn, sqliteCodecRegistry, sqliteDatetimeColumn, sqliteIntegerColumn, sqliteJsonColumn, sqliteRealColumn, sqliteTextColumn };
1
+ import { a as SqliteIntegerDescriptor, c as SqliteTextDescriptor, d as sqliteDatetimeColumn, f as sqliteIntegerColumn, g as JsonValue, h as sqliteTextColumn, i as SqliteDatetimeDescriptor, l as sqliteBigintColumn, m as sqliteRealColumn, n as SqliteBigintDescriptor, o as SqliteJsonDescriptor, p as sqliteJsonColumn, r as SqliteBlobDescriptor, s as SqliteRealDescriptor, t as sqliteCodecRegistry, u as sqliteBlobColumn } from "./codecs-BGeJavlQ.mjs";
2
+ export { type JsonValue, type SqliteBigintDescriptor, type SqliteBlobDescriptor, type SqliteDatetimeDescriptor, type SqliteIntegerDescriptor, type SqliteJsonDescriptor, type SqliteRealDescriptor, type SqliteTextDescriptor, sqliteBigintColumn, sqliteBlobColumn, sqliteCodecRegistry, sqliteDatetimeColumn, sqliteIntegerColumn, sqliteJsonColumn, sqliteRealColumn, sqliteTextColumn };
package/dist/codecs.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as sqliteIntegerColumn, c as sqliteTextColumn, i as sqliteDatetimeColumn, n as sqliteBigintColumn, o as sqliteJsonColumn, r as sqliteBlobColumn, s as sqliteRealColumn, t as codecDescriptors } from "./codecs-DVnHtVWW.mjs";
1
+ import { a as sqliteIntegerColumn, c as sqliteTextColumn, i as sqliteDatetimeColumn, n as sqliteBigintColumn, o as sqliteJsonColumn, r as sqliteBlobColumn, s as sqliteRealColumn, t as codecDescriptors } from "./codecs-DsC4OGmU.mjs";
2
2
  import { buildCodecDescriptorRegistry } from "@prisma-next/sql-relational-core/codec-descriptor-registry";
3
3
  //#region src/core/registry.ts
4
4
  /**
@@ -0,0 +1,55 @@
1
+ import { n as SqliteCreateTable } from "./nodes-VzaaeUTb.mjs";
2
+ import { DdlColumn, DdlNode, DdlTableConstraint } from "@prisma-next/sql-relational-core/ast";
3
+ import { ColumnDescriptor, ColumnSchema, TableHandle } from "@prisma-next/sql-relational-core/contract-free";
4
+
5
+ //#region src/contract-free/columns.d.ts
6
+ type ColOpts = {
7
+ readonly nullable?: boolean;
8
+ };
9
+ declare const text: (opts?: ColOpts) => ColumnDescriptor;
10
+ declare const integer: (opts?: ColOpts) => ColumnDescriptor;
11
+ declare const jsonText: (opts?: ColOpts) => ColumnDescriptor;
12
+ declare const datetime: (opts?: ColOpts) => ColumnDescriptor;
13
+ /**
14
+ * Declare a SQLite control-plane table with a typed column schema. SQLite tables
15
+ * are addressed by a flat name (no schema prefix).
16
+ *
17
+ * ```ts
18
+ * const marker = sqliteTable('_prisma_marker', {
19
+ * space: text(),
20
+ * core_hash: text(),
21
+ * updated_at: datetime(),
22
+ * });
23
+ * ```
24
+ */
25
+ declare function sqliteTable<Schema extends ColumnSchema>(name: string, columns: Schema): TableHandle<Schema>;
26
+ //#endregion
27
+ //#region src/contract-free/control-bootstrap.d.ts
28
+ declare function buildSignMarkerBootstrapQueries(): readonly DdlNode[];
29
+ declare function buildControlTableBootstrapQueries(): readonly DdlNode[];
30
+ //#endregion
31
+ //#region src/contract-free/ddl.d.ts
32
+ /**
33
+ * Build a SQLite `CREATE TABLE` query node.
34
+ *
35
+ * Pass `constraints` for table-level composite primary keys, foreign keys, and
36
+ * unique constraints — use the {@link PrimaryKeyConstraint}, {@link ForeignKeyConstraint},
37
+ * and {@link UniqueConstraint} classes from `@prisma-next/sql-relational-core/ast`.
38
+ *
39
+ * Precondition: identifiers (`table`, column names/types) are emitted to SQL
40
+ * verbatim — they are not quoted or escaped, so callers must pass pre-trusted
41
+ * values (e.g. fixed control-plane identifiers). String-literal default values,
42
+ * by contrast, are single-quote-escaped (embedded `'` doubled) by the renderer.
43
+ * Identifier quoting for untrusted identifiers is added when the migration
44
+ * planner adopts this lowering path.
45
+ */
46
+ declare function createTable(options: {
47
+ readonly table: string;
48
+ readonly schema?: string;
49
+ readonly ifNotExists?: boolean;
50
+ readonly columns: readonly DdlColumn[];
51
+ readonly constraints?: readonly DdlTableConstraint[];
52
+ }): SqliteCreateTable;
53
+ //#endregion
54
+ export { buildControlTableBootstrapQueries, buildSignMarkerBootstrapQueries, createTable, datetime, integer, jsonText, sqliteTable, text };
55
+ //# sourceMappingURL=contract-free.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract-free.d.mts","names":[],"sources":["../src/contract-free/columns.ts","../src/contract-free/control-bootstrap.ts","../src/contract-free/ddl.ts"],"mappings":";;;;;KAcK,OAAA;EAAA,SAAqB,QAAQ;AAAA;AAAA,cAOrB,IAAA,GAAQ,IAAA,GAAO,OAAA,KAAU,gBAAoD;AAAA,cAC7E,OAAA,GAAW,IAAA,GAAO,OAAA,KAAU,gBAAuD;AAAA,cACnF,QAAA,GAAY,IAAA,GAAO,OAAA,KAAU,gBAAoD;AAAA,cACjF,QAAA,GAAY,IAAA,GAAO,OAAA,KAAU,gBAAwD;;AAVhE;AAOlC;;;;;;;;AAA0F;AAC1F;iBAgBgB,WAAA,gBAA2B,YAAA,EACzC,IAAA,UACA,OAAA,EAAS,MAAA,GACR,WAAA,CAAY,MAAA;;;iBCMC,+BAAA,aAA4C,OAAO;AAAA,iBAInD,iCAAA,aAA8C,OAAO;;;;;;AD7Cb;;;;AAQtB;AAOlC;;;;;;iBEJgB,WAAA,CAAY,OAAA;EAAA,SACjB,KAAA;EAAA,SACA,MAAA;EAAA,SACA,WAAA;EAAA,SACA,OAAA,WAAkB,SAAA;EAAA,SAClB,WAAA,YAAuB,kBAAA;AAAA,IAC9B,iBAAA"}
@@ -0,0 +1,111 @@
1
+ import { a as SQLITE_JSON_CODEC_ID, i as SQLITE_INTEGER_CODEC_ID, r as SQLITE_DATETIME_CODEC_ID, s as SQLITE_TEXT_CODEC_ID } from "./codec-ids-DSU7S2Li.mjs";
2
+ import { t as SqliteCreateTable } from "./nodes-D0k4z7NL.mjs";
3
+ import { TableSource } from "@prisma-next/sql-relational-core/ast";
4
+ import { APP_SPACE_ID } from "@prisma-next/framework-components/control";
5
+ import { col, fn, lit, table } from "@prisma-next/sql-relational-core/contract-free";
6
+ //#region src/contract-free/columns.ts
7
+ const desc = (codecId, opts) => ({
8
+ codecId,
9
+ nullable: opts?.nullable ?? false
10
+ });
11
+ const text = (opts) => desc(SQLITE_TEXT_CODEC_ID, opts);
12
+ const integer = (opts) => desc(SQLITE_INTEGER_CODEC_ID, opts);
13
+ const jsonText = (opts) => desc(SQLITE_JSON_CODEC_ID, opts);
14
+ const datetime = (opts) => desc(SQLITE_DATETIME_CODEC_ID, opts);
15
+ /**
16
+ * Declare a SQLite control-plane table with a typed column schema. SQLite tables
17
+ * are addressed by a flat name (no schema prefix).
18
+ *
19
+ * ```ts
20
+ * const marker = sqliteTable('_prisma_marker', {
21
+ * space: text(),
22
+ * core_hash: text(),
23
+ * updated_at: datetime(),
24
+ * });
25
+ * ```
26
+ */
27
+ function sqliteTable(name, columns) {
28
+ return table(TableSource.named(name), columns);
29
+ }
30
+ //#endregion
31
+ //#region src/contract-free/ddl.ts
32
+ /**
33
+ * Build a SQLite `CREATE TABLE` query node.
34
+ *
35
+ * Pass `constraints` for table-level composite primary keys, foreign keys, and
36
+ * unique constraints — use the {@link PrimaryKeyConstraint}, {@link ForeignKeyConstraint},
37
+ * and {@link UniqueConstraint} classes from `@prisma-next/sql-relational-core/ast`.
38
+ *
39
+ * Precondition: identifiers (`table`, column names/types) are emitted to SQL
40
+ * verbatim — they are not quoted or escaped, so callers must pass pre-trusted
41
+ * values (e.g. fixed control-plane identifiers). String-literal default values,
42
+ * by contrast, are single-quote-escaped (embedded `'` doubled) by the renderer.
43
+ * Identifier quoting for untrusted identifiers is added when the migration
44
+ * planner adopts this lowering path.
45
+ */
46
+ function createTable(options) {
47
+ return new SqliteCreateTable(options);
48
+ }
49
+ //#endregion
50
+ //#region src/contract-free/control-bootstrap.ts
51
+ const markerColumns = [
52
+ col("space", "TEXT", {
53
+ notNull: true,
54
+ primaryKey: true,
55
+ default: lit(APP_SPACE_ID)
56
+ }),
57
+ col("core_hash", "TEXT", { notNull: true }),
58
+ col("profile_hash", "TEXT", { notNull: true }),
59
+ col("contract_json", "TEXT"),
60
+ col("canonical_version", "INTEGER"),
61
+ col("updated_at", "TEXT", {
62
+ notNull: true,
63
+ default: fn("datetime('now')")
64
+ }),
65
+ col("app_tag", "TEXT"),
66
+ col("meta", "TEXT", {
67
+ notNull: true,
68
+ default: lit("{}")
69
+ }),
70
+ col("invariants", "TEXT", {
71
+ notNull: true,
72
+ default: lit("[]")
73
+ })
74
+ ];
75
+ const ledgerColumns = [
76
+ col("id", "INTEGER PRIMARY KEY AUTOINCREMENT"),
77
+ col("created_at", "TEXT", {
78
+ notNull: true,
79
+ default: fn("strftime('%Y-%m-%dT%H:%M:%fZ','now')")
80
+ }),
81
+ col("space", "TEXT", { notNull: true }),
82
+ col("migration_name", "TEXT", { notNull: true }),
83
+ col("migration_hash", "TEXT", { notNull: true }),
84
+ col("origin_core_hash", "TEXT"),
85
+ col("origin_profile_hash", "TEXT"),
86
+ col("destination_core_hash", "TEXT", { notNull: true }),
87
+ col("destination_profile_hash", "TEXT"),
88
+ col("contract_json_before", "TEXT"),
89
+ col("contract_json_after", "TEXT"),
90
+ col("operations", "TEXT", { notNull: true })
91
+ ];
92
+ const markerTable = createTable({
93
+ table: "_prisma_marker",
94
+ ifNotExists: true,
95
+ columns: markerColumns
96
+ });
97
+ const ledgerTable = createTable({
98
+ table: "_prisma_ledger",
99
+ ifNotExists: true,
100
+ columns: ledgerColumns
101
+ });
102
+ function buildSignMarkerBootstrapQueries() {
103
+ return [markerTable];
104
+ }
105
+ function buildControlTableBootstrapQueries() {
106
+ return [markerTable, ledgerTable];
107
+ }
108
+ //#endregion
109
+ export { buildControlTableBootstrapQueries, buildSignMarkerBootstrapQueries, createTable, datetime, integer, jsonText, sqliteTable, text };
110
+
111
+ //# sourceMappingURL=contract-free.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract-free.mjs","names":[],"sources":["../src/contract-free/columns.ts","../src/contract-free/ddl.ts","../src/contract-free/control-bootstrap.ts"],"sourcesContent":["import { TableSource } from '@prisma-next/sql-relational-core/ast';\nimport {\n type ColumnDescriptor,\n type ColumnSchema,\n type TableHandle,\n table,\n} from '@prisma-next/sql-relational-core/contract-free';\nimport {\n SQLITE_DATETIME_CODEC_ID,\n SQLITE_INTEGER_CODEC_ID,\n SQLITE_JSON_CODEC_ID,\n SQLITE_TEXT_CODEC_ID,\n} from '../core/codec-ids';\n\ntype ColOpts = { readonly nullable?: boolean };\n\nconst desc = (codecId: string, opts?: ColOpts): ColumnDescriptor => ({\n codecId,\n nullable: opts?.nullable ?? false,\n});\n\nexport const text = (opts?: ColOpts): ColumnDescriptor => desc(SQLITE_TEXT_CODEC_ID, opts);\nexport const integer = (opts?: ColOpts): ColumnDescriptor => desc(SQLITE_INTEGER_CODEC_ID, opts);\nexport const jsonText = (opts?: ColOpts): ColumnDescriptor => desc(SQLITE_JSON_CODEC_ID, opts);\nexport const datetime = (opts?: ColOpts): ColumnDescriptor => desc(SQLITE_DATETIME_CODEC_ID, opts);\n\n/**\n * Declare a SQLite control-plane table with a typed column schema. SQLite tables\n * are addressed by a flat name (no schema prefix).\n *\n * ```ts\n * const marker = sqliteTable('_prisma_marker', {\n * space: text(),\n * core_hash: text(),\n * updated_at: datetime(),\n * });\n * ```\n */\nexport function sqliteTable<Schema extends ColumnSchema>(\n name: string,\n columns: Schema,\n): TableHandle<Schema> {\n return table(TableSource.named(name), columns);\n}\n","import type { DdlColumn, DdlTableConstraint } from '@prisma-next/sql-relational-core/ast';\nimport { SqliteCreateTable } from '../core/ddl/nodes';\n\n/**\n * Build a SQLite `CREATE TABLE` query node.\n *\n * Pass `constraints` for table-level composite primary keys, foreign keys, and\n * unique constraints — use the {@link PrimaryKeyConstraint}, {@link ForeignKeyConstraint},\n * and {@link UniqueConstraint} classes from `@prisma-next/sql-relational-core/ast`.\n *\n * Precondition: identifiers (`table`, column names/types) are emitted to SQL\n * verbatim — they are not quoted or escaped, so callers must pass pre-trusted\n * values (e.g. fixed control-plane identifiers). String-literal default values,\n * by contrast, are single-quote-escaped (embedded `'` doubled) by the renderer.\n * Identifier quoting for untrusted identifiers is added when the migration\n * planner adopts this lowering path.\n */\nexport function createTable(options: {\n readonly table: string;\n readonly schema?: string;\n readonly ifNotExists?: boolean;\n readonly columns: readonly DdlColumn[];\n readonly constraints?: readonly DdlTableConstraint[];\n}): SqliteCreateTable {\n return new SqliteCreateTable(options);\n}\n","import { APP_SPACE_ID } from '@prisma-next/framework-components/control';\nimport type { DdlNode } from '@prisma-next/sql-relational-core/ast';\nimport { col, fn, lit } from '@prisma-next/sql-relational-core/contract-free';\nimport { createTable } from './ddl';\n\nconst markerColumns = [\n col('space', 'TEXT', { notNull: true, primaryKey: true, default: lit(APP_SPACE_ID) }),\n col('core_hash', 'TEXT', { notNull: true }),\n col('profile_hash', 'TEXT', { notNull: true }),\n col('contract_json', 'TEXT'),\n col('canonical_version', 'INTEGER'),\n col('updated_at', 'TEXT', { notNull: true, default: fn(\"datetime('now')\") }),\n col('app_tag', 'TEXT'),\n col('meta', 'TEXT', { notNull: true, default: lit('{}') }),\n col('invariants', 'TEXT', { notNull: true, default: lit('[]') }),\n] as const;\n\nconst ledgerColumns = [\n col('id', 'INTEGER PRIMARY KEY AUTOINCREMENT'),\n col('created_at', 'TEXT', {\n notNull: true,\n default: fn(\"strftime('%Y-%m-%dT%H:%M:%fZ','now')\"),\n }),\n col('space', 'TEXT', { notNull: true }),\n col('migration_name', 'TEXT', { notNull: true }),\n col('migration_hash', 'TEXT', { notNull: true }),\n col('origin_core_hash', 'TEXT'),\n col('origin_profile_hash', 'TEXT'),\n col('destination_core_hash', 'TEXT', { notNull: true }),\n col('destination_profile_hash', 'TEXT'),\n col('contract_json_before', 'TEXT'),\n col('contract_json_after', 'TEXT'),\n col('operations', 'TEXT', { notNull: true }),\n] as const;\n\nconst markerTable = createTable({\n table: '_prisma_marker',\n ifNotExists: true,\n columns: markerColumns,\n});\n\nconst ledgerTable = createTable({\n table: '_prisma_ledger',\n ifNotExists: true,\n columns: ledgerColumns,\n});\n\nexport function buildSignMarkerBootstrapQueries(): readonly DdlNode[] {\n return [markerTable];\n}\n\nexport function buildControlTableBootstrapQueries(): readonly DdlNode[] {\n return [markerTable, ledgerTable];\n}\n"],"mappings":";;;;;;AAgBA,MAAM,QAAQ,SAAiB,UAAsC;CACnE;CACA,UAAU,MAAM,YAAY;AAC9B;AAEA,MAAa,QAAQ,SAAqC,KAAK,sBAAsB,IAAI;AACzF,MAAa,WAAW,SAAqC,KAAK,yBAAyB,IAAI;AAC/F,MAAa,YAAY,SAAqC,KAAK,sBAAsB,IAAI;AAC7F,MAAa,YAAY,SAAqC,KAAK,0BAA0B,IAAI;;;;;;;;;;;;;AAcjG,SAAgB,YACd,MACA,SACqB;CACrB,OAAO,MAAM,YAAY,MAAM,IAAI,GAAG,OAAO;AAC/C;;;;;;;;;;;;;;;;;AC1BA,SAAgB,YAAY,SAMN;CACpB,OA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pE,OAAO,CAAC,WAAW;AACrB;AAEA,SAAgB,oCAAwD;CACtE,OAAO,CAAC,aAAa,WAAW;AAClC"}
@@ -0,0 +1,12 @@
1
+ //#region src/core/control-tables.ts
2
+ const MARKER_TABLE_NAME = "_prisma_marker";
3
+ const LEDGER_TABLE_NAME = "_prisma_ledger";
4
+ /**
5
+ * Control tables the runner creates/manages. The planner must not drop these
6
+ * when reconciling "extra" tables against the contract.
7
+ */
8
+ const CONTROL_TABLE_NAMES = new Set([MARKER_TABLE_NAME, LEDGER_TABLE_NAME]);
9
+ //#endregion
10
+ export { LEDGER_TABLE_NAME as n, MARKER_TABLE_NAME as r, CONTROL_TABLE_NAMES as t };
11
+
12
+ //# sourceMappingURL=control-tables-7KwMyJ6i.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control-tables-7KwMyJ6i.mjs","names":[],"sources":["../src/core/control-tables.ts"],"sourcesContent":["export const MARKER_TABLE_NAME = '_prisma_marker';\nexport const LEDGER_TABLE_NAME = '_prisma_ledger';\n\n/**\n * Control tables the runner creates/manages. The planner must not drop these\n * when reconciling \"extra\" tables against the contract.\n */\nexport const CONTROL_TABLE_NAMES: ReadonlySet<string> = new Set([\n MARKER_TABLE_NAME,\n LEDGER_TABLE_NAME,\n]);\n"],"mappings":";AAAA,MAAa,oBAAoB;AACjC,MAAa,oBAAoB;;;;;AAMjC,MAAa,sBAA2C,IAAI,IAAI,CAC9D,mBACA,iBACF,CAAC"}
@@ -0,0 +1,11 @@
1
+ //#region src/core/control-tables.d.ts
2
+ declare const MARKER_TABLE_NAME = "_prisma_marker";
3
+ declare const LEDGER_TABLE_NAME = "_prisma_ledger";
4
+ /**
5
+ * Control tables the runner creates/manages. The planner must not drop these
6
+ * when reconciling "extra" tables against the contract.
7
+ */
8
+ declare const CONTROL_TABLE_NAMES: ReadonlySet<string>;
9
+ //#endregion
10
+ export { CONTROL_TABLE_NAMES, LEDGER_TABLE_NAME, MARKER_TABLE_NAME };
11
+ //# sourceMappingURL=control-tables.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control-tables.d.mts","names":[],"sources":["../src/core/control-tables.ts"],"mappings":";cAAa,iBAAA;AAAA,cACA,iBAAA;;;;AADiB;cAOjB,mBAAA,EAAqB,WAAW"}
@@ -0,0 +1,2 @@
1
+ import { n as LEDGER_TABLE_NAME, r as MARKER_TABLE_NAME, t as CONTROL_TABLE_NAMES } from "./control-tables-7KwMyJ6i.mjs";
2
+ export { CONTROL_TABLE_NAMES, LEDGER_TABLE_NAME, MARKER_TABLE_NAME };
@@ -1,12 +1,33 @@
1
- import { t as SqlitePlanTargetDetails } from "./planner-target-details-B-VJkUsu.mjs";
1
+ import { t as SqlitePlanTargetDetails } from "./planner-target-details-xR6UfIcz.mjs";
2
2
  import { SqlControlTargetDescriptor } from "@prisma-next/family-sql/control";
3
- import { StorageTable } from "@prisma-next/sql-contract/types";
4
- import { NamespaceBase } from "@prisma-next/framework-components/ir";
3
+ import { SqlNamespaceTablesInput, StorageTable, StorageTableInput } from "@prisma-next/sql-contract/types";
4
+ import { Namespace, NamespaceBase } from "@prisma-next/framework-components/ir";
5
5
 
6
6
  //#region src/core/control-target.d.ts
7
7
  declare const sqliteControlTargetDescriptor: SqlControlTargetDescriptor<'sqlite', SqlitePlanTargetDetails>;
8
8
  //#endregion
9
9
  //#region src/core/sqlite-unbound-database.d.ts
10
+ type SqliteDatabaseInput = {
11
+ readonly id: string;
12
+ readonly entries: {
13
+ readonly table: Readonly<Record<string, StorageTable | StorageTableInput>>;
14
+ };
15
+ };
16
+ /**
17
+ * SQLite namespace concretion carrying table metadata under
18
+ * `entries.table` and unqualified `qualifyTable()` emission for runtime
19
+ * SQL rendering.
20
+ */
21
+ declare class SqliteDatabase extends NamespaceBase {
22
+ readonly kind: string;
23
+ readonly id: string;
24
+ readonly entries: Readonly<{
25
+ readonly table: Readonly<Record<string, StorageTable>>;
26
+ }>;
27
+ constructor(input: SqliteDatabaseInput);
28
+ qualifier(): string;
29
+ qualifyTable(tableName: string): string;
30
+ }
10
31
  /**
11
32
  * SQLite target `Namespace` concretion. SQLite has no schema or
12
33
  * database-namespacing concept at the SQL level — there is exactly one
@@ -24,26 +45,21 @@ declare const sqliteControlTargetDescriptor: SqlControlTargetDescriptor<'sqlite'
24
45
  * `__unspecified__` AST bucket reaches the SQLite interpreter, which
25
46
  * lowers it to this singleton.
26
47
  */
27
- declare class SqliteUnboundDatabase extends NamespaceBase {
48
+ declare class SqliteUnboundDatabase extends SqliteDatabase {
28
49
  static readonly instance: SqliteUnboundDatabase;
29
- readonly kind: "database";
30
- readonly id: "__unbound__";
31
- readonly tables: Readonly<Record<string, StorageTable>>;
32
50
  private constructor();
33
- qualifier(): string;
34
- qualifyTable(tableName: string): string;
35
51
  }
36
52
  /**
37
53
  * Target-supplied `Namespace` factory the SQLite target plumbs through
38
54
  * `defineContract({ createNamespace })`. SQLite has only one
39
55
  * effective namespace slot — the framework `UNBOUND_NAMESPACE_ID`
40
- * sentinel — so the factory always returns the singleton and rejects
41
- * any other coordinate. The SQL family's defensive validation in
42
- * `defineContract` already rejects user-declared SQLite namespaces, so
43
- * this throw is a structural safety net rather than a user-facing
44
- * surface.
56
+ * sentinel — so the factory always returns the singleton or a fresh
57
+ * `SqliteDatabase` for the unbound slot with tables. The SQL family's
58
+ * defensive validation in `defineContract` already rejects
59
+ * user-declared SQLite namespaces, so this throw is a structural
60
+ * safety net rather than a user-facing surface.
45
61
  */
46
- declare function sqliteCreateNamespace(id: string): SqliteUnboundDatabase;
62
+ declare function sqliteCreateNamespace(input: SqlNamespaceTablesInput): SqliteDatabase | SqliteUnboundDatabase;
47
63
  //#endregion
48
64
  export { type SqlitePlanTargetDetails, SqliteUnboundDatabase, sqliteControlTargetDescriptor as default, sqliteCreateNamespace };
49
65
  //# sourceMappingURL=control.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"control.d.mts","names":[],"sources":["../src/core/control-target.ts","../src/core/sqlite-unbound-database.ts"],"mappings":";;;;;;cAkCM,6BAAA,EAA+B,0BAA0B,WAAW,uBAAA;;;;;;;AAnBS;;;;AAmBc;;;;ACVjG;;;;;cAAa,qBAAA,SAA8B,aAAA;EAAA,gBACzB,QAAA,EAAU,qBAAA;EAAA,SAEjB,IAAA;EAAA,SACA,EAAA;EAAA,SACA,MAAA,EAAQ,QAAA,CAAS,MAAA,SAAe,YAAA;EAAA,QAElC,WAAA,CAAA;EAMP,SAAA,CAAA;EAIA,YAAA,CAAa,SAAA;AAAA;;;;;;;;;;;iBAeC,qBAAA,CAAsB,EAAA,WAAa,qBAAqB"}
1
+ {"version":3,"file":"control.d.mts","names":[],"sources":["../src/core/control-target.ts","../src/core/sqlite-unbound-database.ts"],"mappings":";;;;;;cAgCM,6BAAA,EAA+B,0BAA0B,WAAW,uBAAA;;;KCnB9D,mBAAA;EAAA,SACD,EAAA;EAAA,SACA,OAAA;IAAA,SACE,KAAA,EAAO,QAAA,CAAS,MAAA,SAAe,YAAA,GAAe,iBAAA;EAAA;AAAA;;;ADgBsC;;;cCQpF,cAAA,SAAuB,aAAA;EAAA,SACjB,IAAA;EAAA,SAER,EAAA;EAAA,SACA,OAAA,EAAS,QAAA;IAAA,SACP,KAAA,EAAO,QAAA,CAAS,MAAA,SAAe,YAAA;EAAA;cAG9B,KAAA,EAAO,mBAAA;EAsBnB,SAAA;EAIA,YAAA,CAAa,SAAA;AAAA;;;;;;;;;AA1D6D;AAwB5E;;;;;;;;cAwDa,qBAAA,SAA8B,cAAc;EAAA,gBACvC,QAAA,EAAU,qBAAA;EAAA,QAEnB,WAAA;AAAA;;;;;;;;;;;iBA+CO,qBAAA,CACd,KAAA,EAAO,uBAAA,GACN,cAAA,GAAiB,qBAAA"}