@prisma-next/target-sqlite 0.12.0-dev.17 → 0.12.0-dev.3

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 (70) hide show
  1. package/dist/{codec-ids-yG2RRHnw.d.mts → codec-ids-C4UfWqAE.d.mts} +1 -1
  2. package/dist/{codec-ids-yG2RRHnw.d.mts.map → codec-ids-C4UfWqAE.d.mts.map} +1 -1
  3. package/dist/codec-ids.d.mts +1 -1
  4. package/dist/{codec-types-CM7OkQLM.d.mts → codec-types-B2ci-b_W.d.mts} +2 -2
  5. package/dist/{codec-types-CM7OkQLM.d.mts.map → codec-types-B2ci-b_W.d.mts.map} +1 -1
  6. package/dist/codec-types.d.mts +2 -2
  7. package/dist/{codecs-t6YnHZkK.d.mts → codecs-DqDWNIKq.d.mts} +2 -2
  8. package/dist/{codecs-t6YnHZkK.d.mts.map → codecs-DqDWNIKq.d.mts.map} +1 -1
  9. package/dist/codecs.d.mts +1 -1
  10. package/dist/control.d.mts +1 -1
  11. package/dist/control.d.mts.map +1 -1
  12. package/dist/control.mjs +89 -37
  13. package/dist/control.mjs.map +1 -1
  14. package/dist/{descriptor-meta-rKforwQA.mjs → descriptor-meta-DIbCXU65.mjs} +1 -3
  15. package/dist/descriptor-meta-DIbCXU65.mjs.map +1 -0
  16. package/dist/migration.d.mts +2 -2
  17. package/dist/op-factory-call.d.mts +2 -2
  18. package/dist/pack.d.mts +1 -2
  19. package/dist/pack.d.mts.map +1 -1
  20. package/dist/pack.mjs +1 -1
  21. package/dist/{planner-Cygvz9Wp.mjs → planner-BBvwGy0f.mjs} +3 -3
  22. package/dist/{planner-Cygvz9Wp.mjs.map → planner-BBvwGy0f.mjs.map} +1 -1
  23. package/dist/{planner-produced-sqlite-migration-BwFkd0br.d.mts → planner-produced-sqlite-migration-D4FSvPE4.d.mts} +3 -3
  24. package/dist/{planner-produced-sqlite-migration-BwFkd0br.d.mts.map → planner-produced-sqlite-migration-D4FSvPE4.d.mts.map} +1 -1
  25. package/dist/planner-produced-sqlite-migration.d.mts +1 -1
  26. package/dist/{planner-target-details-RVPqF2ug.d.mts → planner-target-details-B-VJkUsu.d.mts} +1 -1
  27. package/dist/{planner-target-details-RVPqF2ug.d.mts.map → planner-target-details-B-VJkUsu.d.mts.map} +1 -1
  28. package/dist/planner-target-details.d.mts +1 -1
  29. package/dist/planner.d.mts +2 -2
  30. package/dist/planner.mjs +1 -1
  31. package/dist/render-ops.d.mts +1 -1
  32. package/dist/runtime.d.mts +1 -17
  33. package/dist/runtime.d.mts.map +1 -1
  34. package/dist/runtime.mjs +1 -2
  35. package/dist/runtime.mjs.map +1 -1
  36. package/dist/{shared-Bw5G0I-c.d.mts → shared-DDOJntxk.d.mts} +2 -2
  37. package/dist/{shared-Bw5G0I-c.d.mts.map → shared-DDOJntxk.d.mts.map} +1 -1
  38. package/dist/{sqlite-migration-D-O3Glz1.d.mts → sqlite-migration-Feio34n3.d.mts} +2 -2
  39. package/dist/{sqlite-migration-D-O3Glz1.d.mts.map → sqlite-migration-Feio34n3.d.mts.map} +1 -1
  40. package/dist/{statement-builders-D1Q_i4sb.mjs → statement-builders-BiRmeyJM.mjs} +2 -14
  41. package/dist/statement-builders-BiRmeyJM.mjs.map +1 -0
  42. package/dist/statement-builders.d.mts +0 -3
  43. package/dist/statement-builders.d.mts.map +1 -1
  44. package/dist/statement-builders.mjs +1 -1
  45. package/package.json +18 -20
  46. package/src/core/descriptor-meta.ts +0 -2
  47. package/src/core/migrations/runner.ts +25 -53
  48. package/src/core/migrations/statement-builders.ts +1 -16
  49. package/src/core/sqlite-contract-serializer.ts +9 -38
  50. package/src/core/sqlite-unbound-database.ts +0 -30
  51. package/src/exports/runtime.ts +0 -1
  52. package/dist/contract-free.d.mts +0 -27
  53. package/dist/contract-free.d.mts.map +0 -1
  54. package/dist/contract-free.mjs +0 -80
  55. package/dist/contract-free.mjs.map +0 -1
  56. package/dist/ddl.d.mts +0 -2
  57. package/dist/ddl.mjs +0 -2
  58. package/dist/descriptor-meta-rKforwQA.mjs.map +0 -1
  59. package/dist/nodes-09ul6DNV.mjs +0 -28
  60. package/dist/nodes-09ul6DNV.mjs.map +0 -1
  61. package/dist/nodes-D8LGV4Yk.d.mts +0 -27
  62. package/dist/nodes-D8LGV4Yk.d.mts.map +0 -1
  63. package/dist/sqlite-contract-serializer-Hy7WQPea.mjs +0 -100
  64. package/dist/sqlite-contract-serializer-Hy7WQPea.mjs.map +0 -1
  65. package/dist/statement-builders-D1Q_i4sb.mjs.map +0 -1
  66. package/src/contract-free/control-bootstrap.ts +0 -54
  67. package/src/contract-free/ddl.ts +0 -21
  68. package/src/core/ddl/nodes.ts +0 -41
  69. package/src/exports/contract-free.ts +0 -5
  70. package/src/exports/ddl.ts +0 -6
@@ -1,54 +0,0 @@
1
- import { APP_SPACE_ID } from '@prisma-next/framework-components/control';
2
- import type { DdlNode } from '@prisma-next/sql-relational-core/ast';
3
- import { col, fn, lit } from '@prisma-next/sql-relational-core/contract-free';
4
- import { createTable } from './ddl';
5
-
6
- const markerColumns = [
7
- col('space', 'TEXT', { notNull: true, primaryKey: true, default: lit(APP_SPACE_ID) }),
8
- col('core_hash', 'TEXT', { notNull: true }),
9
- col('profile_hash', 'TEXT', { notNull: true }),
10
- col('contract_json', 'TEXT'),
11
- col('canonical_version', 'INTEGER'),
12
- col('updated_at', 'TEXT', { notNull: true, default: fn("datetime('now')") }),
13
- col('app_tag', 'TEXT'),
14
- col('meta', 'TEXT', { notNull: true, default: lit('{}') }),
15
- col('invariants', 'TEXT', { notNull: true, default: lit('[]') }),
16
- ] as const;
17
-
18
- const ledgerColumns = [
19
- col('id', 'INTEGER PRIMARY KEY AUTOINCREMENT'),
20
- col('created_at', 'TEXT', {
21
- notNull: true,
22
- default: fn("strftime('%Y-%m-%dT%H:%M:%fZ','now')"),
23
- }),
24
- col('space', 'TEXT', { notNull: true }),
25
- col('migration_name', 'TEXT', { notNull: true }),
26
- col('migration_hash', 'TEXT', { notNull: true }),
27
- col('origin_core_hash', 'TEXT'),
28
- col('origin_profile_hash', 'TEXT'),
29
- col('destination_core_hash', 'TEXT', { notNull: true }),
30
- col('destination_profile_hash', 'TEXT'),
31
- col('contract_json_before', 'TEXT'),
32
- col('contract_json_after', 'TEXT'),
33
- col('operations', 'TEXT', { notNull: true }),
34
- ] as const;
35
-
36
- const markerTable = createTable({
37
- table: '_prisma_marker',
38
- ifNotExists: true,
39
- columns: markerColumns,
40
- });
41
-
42
- const ledgerTable = createTable({
43
- table: '_prisma_ledger',
44
- ifNotExists: true,
45
- columns: ledgerColumns,
46
- });
47
-
48
- export function buildSignMarkerBootstrapQueries(): readonly DdlNode[] {
49
- return [markerTable];
50
- }
51
-
52
- export function buildControlTableBootstrapQueries(): readonly DdlNode[] {
53
- return [markerTable, ledgerTable];
54
- }
@@ -1,21 +0,0 @@
1
- import type { DdlColumn } from '@prisma-next/sql-relational-core/ast';
2
- import { SqliteCreateTable } from '../core/ddl/nodes';
3
-
4
- /**
5
- * Build a SQLite `CREATE TABLE` query node.
6
- *
7
- * Precondition: identifiers (`table`, column names/types) are emitted to SQL
8
- * verbatim — they are not quoted or escaped, so callers must pass pre-trusted
9
- * values (e.g. fixed control-plane identifiers). String-literal default values,
10
- * by contrast, are single-quote-escaped (embedded `'` doubled) by the renderer.
11
- * Identifier quoting for untrusted identifiers is added when the migration
12
- * planner adopts this lowering path.
13
- */
14
- export function createTable(options: {
15
- readonly table: string;
16
- readonly schema?: string;
17
- readonly ifNotExists?: boolean;
18
- readonly columns: readonly DdlColumn[];
19
- }): SqliteCreateTable {
20
- return new SqliteCreateTable(options);
21
- }
@@ -1,41 +0,0 @@
1
- import { type DdlColumn, DdlNode } from '@prisma-next/sql-relational-core/ast';
2
-
3
- export interface SqliteDdlVisitor<R> {
4
- createTable(node: SqliteCreateTable): R;
5
- }
6
-
7
- export abstract class SqliteDdlNode extends DdlNode {
8
- abstract accept<R>(visitor: SqliteDdlVisitor<R>): R;
9
- }
10
-
11
- function freezeDdlColumns(columns: readonly DdlColumn[]): ReadonlyArray<DdlColumn> {
12
- return Object.freeze([...columns]);
13
- }
14
-
15
- export class SqliteCreateTable extends SqliteDdlNode {
16
- readonly kind = 'create-table' as const;
17
- readonly table: string;
18
- readonly schema: string | undefined;
19
- readonly ifNotExists: boolean | undefined;
20
- readonly columns: ReadonlyArray<DdlColumn>;
21
-
22
- constructor(options: {
23
- readonly table: string;
24
- readonly schema?: string;
25
- readonly ifNotExists?: boolean;
26
- readonly columns: readonly DdlColumn[];
27
- }) {
28
- super();
29
- this.table = options.table;
30
- this.schema = options.schema;
31
- this.ifNotExists = options.ifNotExists;
32
- this.columns = freezeDdlColumns(options.columns);
33
- this.freeze();
34
- }
35
-
36
- override accept<R>(visitor: SqliteDdlVisitor<R>): R {
37
- return visitor.createTable(this);
38
- }
39
- }
40
-
41
- export type AnySqliteDdlNode = SqliteCreateTable;
@@ -1,5 +0,0 @@
1
- export {
2
- buildControlTableBootstrapQueries,
3
- buildSignMarkerBootstrapQueries,
4
- } from '../contract-free/control-bootstrap';
5
- export { createTable } from '../contract-free/ddl';
@@ -1,6 +0,0 @@
1
- export {
2
- type AnySqliteDdlNode,
3
- SqliteCreateTable,
4
- SqliteDdlNode,
5
- type SqliteDdlVisitor,
6
- } from '../core/ddl/nodes';