prisma-effect-kysely 5.6.0 → 5.8.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,94 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - ac42853: fix: DateTime maps back to `Schema.DateFromSelf` (Date ↔ Date) — Prisma+Kysely canonical
8
+
9
+ Reverts the 5.6.0 change that mapped `DateTime` to `DateFromInput` (a
10
+ `Schema.Union(DateFromSelf, Date)` with `Encoded = Date | string`).
11
+
12
+ **Why revert**: the dual-input Union pushed the boundary problem onto
13
+ DA-layer consumers. Kysely's pg driver returns native `Date` instances,
14
+ but `Selectable<X>.created_at` typed as `Date | string` forced every DA
15
+ mapper that copies `result.created_at` into a contract type to either
16
+ narrow manually (no cast-free path) or wrap the read in
17
+ `Schema.decode(Selectable(X))` (heavy refactor across hundreds of sites).
18
+
19
+ **Why DateFromSelf is correct**:
20
+ - **Prisma docs**: _"Prisma Client returns all DateTime values as native
21
+ JavaScript Date objects. ... DateTime values must be passed as Date
22
+ objects, not strings, to avoid runtime errors."_
23
+ - **Kysely docs**: idiomatic DateTime column is
24
+ `created_at: ColumnType<Date, string | undefined, never>` — SELECT
25
+ yields `Date`. _"TypeScript is a compile-time concept and cannot
26
+ alter runtime JavaScript types. If your TypeScript definition for a
27
+ column differs from the database's actual return type, the runtime
28
+ type will not change automatically."_
29
+ - **Effect Schema docs (Doc 10944)**: _"schemas should be defined such
30
+ that encode + decode return the original value"_ — one Type, one
31
+ Encoded per schema. The dual-boundary problem (DA Date ↔ Date vs
32
+ RPC string ↔ Date) is solved by **two schemas** (one per boundary),
33
+ not one Union. Doc 4312 (`@effect/sql/Model.Class`) shows this
34
+ canonical variant pattern (`select`/`insert`/`update` vs
35
+ `json`/`jsonCreate`/`jsonUpdate`).
36
+
37
+ **For RPC/HTTP wire boundaries**: define a contract-layer schema that
38
+ overrides date columns with `Schema.Date` (Encoded = string) before the
39
+ RPC framework calls `Schema.decode`. This is the same pattern as
40
+ `@effect/sql`'s `json` variants — one schema per boundary.
41
+
42
+ **`DateFromInput` is still exported** from the package for consumers that
43
+ specifically want the dual-input behavior at a single call site. The
44
+ codegen just no longer auto-emits it for every DateTime column.
45
+
46
+ **The Schema.Schema.Encoded fix in 5.7.0 stays** — that's still correct
47
+ for join-table column exposure (`_product_tags.A`/`B`).
48
+
49
+ **Migration**: most consumers benefit immediately (DA mappers stop
50
+ seeing `Date | string`). For RPC contracts that previously didn't have
51
+ a Date override (because they relied on `DateFromInput`), re-add a
52
+ `Schema.extend` with `Schema.Date` overrides for date columns to keep
53
+ wire decode working.
54
+
55
+ ## 5.7.0
56
+
57
+ ### Minor Changes
58
+
59
+ - d272b99: fix: DB interface uses `Schema.Schema.Encoded` so Kysely sees real DB columns
60
+
61
+ The generated `interface DB` previously emitted
62
+ `<table>: Schema.Schema.Type<typeof X>`. For tables using `Schema.fromKey`
63
+ (Prisma implicit M:N join tables, where TS field `product_id` maps to DB
64
+ column `A`), the Type side has the **decoded** names. Kysely uses the TS
65
+ interface as the SQL contract — it does not run the Effect schema decoder.
66
+ So queries like `db.selectFrom('_product_tags').where('product_id', ...)`
67
+ generated `WHERE product_id = ...` and Postgres rejected with
68
+ `column _product_tags.product_id does not exist`.
69
+
70
+ Fix: emit `Schema.Schema.Encoded<typeof X>` for every DB interface entry.
71
+ Encoded is the on-the-wire / on-disk shape that matches Postgres. For
72
+ regular tables `Type === Encoded`, no behavior change. For join tables,
73
+ Kysely now sees `A`/`B` and emits valid SQL. Application code that wants
74
+ the semantic field names runs the row through `Schema.decode(X)`.
75
+
76
+ `ColumnType<S, I, U>` brand preserves `__select__`/`__insert__`/`__update__`
77
+ phantoms on both sides, so `Insertable<X>`/`Updateable<X>` inference is
78
+ unchanged.
79
+
80
+ Adds `db-interface-sql-contract.test.ts` with three regression checks:
81
+ 1. String-grep — every DB entry uses Encoded, none use Type.
82
+ 2. Encoded-side preserves real Postgres column names for implicit M:N.
83
+ 3. Kysely SQL compile — emitted SQL references the real `"A"` column,
84
+ not the `product_id` decoded name. This catches the original bug
85
+ structurally without needing a live database.
86
+
87
+ **Migration**: most consumers need no changes. If a consumer overrode
88
+ the generated DB interface entry to expose `A`/`B` directly (workaround
89
+ for this bug), the override can now be removed and the generator will
90
+ do the right thing.
91
+
3
92
  ## 5.6.0
4
93
 
5
94
  ### Minor Changes
@@ -1 +1 @@
1
- {"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/effect/generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAQ/E;;GAEG;AACH,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,IAAI,CAAC,QAAQ;IAEhD;;OAEG;IACH,aAAa,CAAC,KAAK,EAAE,SAAS,IAAI,CAAC,aAAa,EAAE;IAIlD;;;OAGG;IACH,uBAAuB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,IAAI,CAAC,KAAK,EAAE;IAcxE;;;OAGG;IACH,OAAO,CAAC,aAAa;IAOrB;;;;OAIG;IACH,mBAAmB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,IAAI,CAAC,KAAK,EAAE;IAqBpE;;OAEG;IACH,mBAAmB,CAAC,QAAQ,EAAE,OAAO;IAqBrC;;OAEG;IACH,wBAAwB,CAAC,UAAU,EAAE,aAAa,EAAE;CAGrD"}
1
+ {"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/effect/generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAQ/E;;GAEG;AACH,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,IAAI,CAAC,QAAQ;IAEhD;;OAEG;IACH,aAAa,CAAC,KAAK,EAAE,SAAS,IAAI,CAAC,aAAa,EAAE;IAIlD;;;OAGG;IACH,uBAAuB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,IAAI,CAAC,KAAK,EAAE;IAcxE;;;OAGG;IACH,OAAO,CAAC,aAAa;IAOrB;;;;OAIG;IACH,mBAAmB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,IAAI,CAAC,KAAK,EAAE;IAqBpE;;OAEG;IACH,mBAAmB,CAAC,QAAQ,EAAE,OAAO;IAsBrC;;OAEG;IACH,wBAAwB,CAAC,UAAU,EAAE,aAAa,EAAE;CAGrD"}
@@ -76,12 +76,13 @@ export type ${name} = typeof ${name};`;
76
76
  */
77
77
  generateTypesHeader(hasEnums) {
78
78
  const header = generateFileHeader();
79
- // Import runtime helpers from prisma-effect-kysely
80
- // columnType and generated are used for field type annotations
81
- // DateFromInput is the dual-boundary Date schema (Date | string ↔ Date)
79
+ // Import runtime helpers from prisma-effect-kysely.
80
+ // DateTime fields use Schema.DateFromSelf (Date Date), matching
81
+ // Prisma's contract that DateTime values are native Date instances.
82
+ // Decode through a Schema.Date contract schema at JSON wire boundaries.
82
83
  const imports = [
83
84
  `import { Schema } from "effect";`,
84
- `import { columnType, generated, JsonValue, DateFromInput } from "prisma-effect-kysely";`,
85
+ `import { columnType, generated, JsonValue } from "prisma-effect-kysely";`,
85
86
  ];
86
87
  if (hasEnums) {
87
88
  // Import PascalCase enum schemas
@@ -1 +1 @@
1
- {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../src/effect/generator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC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ACD,IAAI,CAAC,KAAK,CAAC,CAAC;QAEf,OAAO,gBAAgB,IAAI;EAC7B,gBAAgB;;cAEJ,IAAI,aAAa,IAAI,GAAG,CAAC;IACrC,CAAC;IAED;;OAEG;IACH,mBAAmB,CAAC,QAAiB;QACnC,MAAM,MAAM,GAAG,kBAAkB,EAAE,CAAC;QAEpC,oDAAoD;QACpD,kEAAkE;QAClE,oEAAoE;QACpE,wEAAwE;QACxE,MAAM,OAAO,GAAG;YACd,kCAAkC;YAClC,0EAA0E;SAC3E,CAAC;QAEF,IAAI,QAAQ,EAAE,CAAC;YACb,iCAAiC;YACjC,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAE1F,OAAO,CAAC,IAAI,CAAC,YAAY,WAAW,oBAAoB,CAAC,CAAC;QAC5D,CAAC;QAED,OAAO,GAAG,MAAM,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;IAC9C,CAAC;IAED;;OAEG;IACH,wBAAwB,CAAC,UAA2B;QAClD,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,uBAAuB,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACrF,CAAC;CACF"}
@@ -31,16 +31,32 @@ export declare function applyMapDirective(fieldType: string, field: DMMF.Field):
31
31
  export declare function buildKyselyFieldType(baseFieldType: string, field: DMMF.Field, modelName?: string): string;
32
32
  /**
33
33
  * Generate DB interface entry for a model
34
- * Uses Schema.Schema.Type<Model> to preserve phantom properties (__select__, __insert__, __update__)
35
- * that Kysely needs for correct INSERT/UPDATE type inference.
36
34
  *
37
- * Previously used Selectable<Model> but this stripped the phantom properties,
38
- * causing Kysely to require all fields on INSERT (including generated/read-only fields).
35
+ * Uses Schema.Schema.Encoded<Model> because the DB interface IS the SQL
36
+ * contract column names and types must match what Postgres actually
37
+ * sees. Encoded is the on-the-wire / on-disk shape; Type is the decoded
38
+ * runtime shape after `Schema.decode` (which Kysely never runs).
39
+ *
40
+ * For regular tables: Type === Encoded, behavior unchanged.
41
+ *
42
+ * For tables using Schema.fromKey/propertySignature (e.g. Prisma implicit
43
+ * M:N join tables where TS field `product_id` maps to DB column `A`),
44
+ * Encoded preserves the real DB column names so Kysely emits valid SQL.
45
+ *
46
+ * ColumnType<S, I, U> brand preserves the __select__/__insert__/__update__
47
+ * phantom properties on both sides (Type and Encoded), so INSERT/UPDATE
48
+ * type inference still works correctly.
39
49
  */
40
50
  export declare function generateDBInterfaceEntry(model: DMMF.Model): string;
41
51
  /**
42
52
  * Generate DB interface entry for a join table
43
- * Uses Schema.Schema.Type to preserve phantom properties for Kysely compatibility
53
+ *
54
+ * Critical: must use Schema.Schema.Encoded so the Kysely DB interface
55
+ * exposes Prisma's real `A`/`B` column names. Schema.fromKey mapping
56
+ * (`product_id` -> `A`) only applies during Effect Schema decode/encode;
57
+ * Kysely passes column names directly to Postgres, so the TS interface
58
+ * has to match the DB exactly. Decode through the Effect schema in
59
+ * application code if you want the semantic field names.
44
60
  */
45
61
  export declare function generateJoinTableDBInterfaceEntry(joinTable: JoinTableInfo): string;
46
62
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../src/kysely/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAI3D;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,WAEhD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,WA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GAMG;AACH,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,MAAM,UAQhG;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,UAIzD;AAED;;;;;;;;;GASG;AACH,wBAAgB,iCAAiC,CAAC,SAAS,EAAE,aAAa,UAIzE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,SAAS,IAAI,CAAC,KAAK,EAAE,EAC7B,UAAU,GAAE,aAAa,EAAO,UAajC"}
@@ -62,25 +62,41 @@ export function buildKyselyFieldType(baseFieldType, field, modelName) {
62
62
  }
63
63
  /**
64
64
  * Generate DB interface entry for a model
65
- * Uses Schema.Schema.Type<Model> to preserve phantom properties (__select__, __insert__, __update__)
66
- * that Kysely needs for correct INSERT/UPDATE type inference.
67
65
  *
68
- * Previously used Selectable<Model> but this stripped the phantom properties,
69
- * causing Kysely to require all fields on INSERT (including generated/read-only fields).
66
+ * Uses Schema.Schema.Encoded<Model> because the DB interface IS the SQL
67
+ * contract column names and types must match what Postgres actually
68
+ * sees. Encoded is the on-the-wire / on-disk shape; Type is the decoded
69
+ * runtime shape after `Schema.decode` (which Kysely never runs).
70
+ *
71
+ * For regular tables: Type === Encoded, behavior unchanged.
72
+ *
73
+ * For tables using Schema.fromKey/propertySignature (e.g. Prisma implicit
74
+ * M:N join tables where TS field `product_id` maps to DB column `A`),
75
+ * Encoded preserves the real DB column names so Kysely emits valid SQL.
76
+ *
77
+ * ColumnType<S, I, U> brand preserves the __select__/__insert__/__update__
78
+ * phantom properties on both sides (Type and Encoded), so INSERT/UPDATE
79
+ * type inference still works correctly.
70
80
  */
71
81
  export function generateDBInterfaceEntry(model) {
72
82
  const tableName = model.dbName || model.name;
73
83
  const modelName = toPascalCase(model.name);
74
- return ` ${tableName}: Schema.Schema.Type<typeof ${modelName}>;`;
84
+ return ` ${tableName}: Schema.Schema.Encoded<typeof ${modelName}>;`;
75
85
  }
76
86
  /**
77
87
  * Generate DB interface entry for a join table
78
- * Uses Schema.Schema.Type to preserve phantom properties for Kysely compatibility
88
+ *
89
+ * Critical: must use Schema.Schema.Encoded so the Kysely DB interface
90
+ * exposes Prisma's real `A`/`B` column names. Schema.fromKey mapping
91
+ * (`product_id` -> `A`) only applies during Effect Schema decode/encode;
92
+ * Kysely passes column names directly to Postgres, so the TS interface
93
+ * has to match the DB exactly. Decode through the Effect schema in
94
+ * application code if you want the semantic field names.
79
95
  */
80
96
  export function generateJoinTableDBInterfaceEntry(joinTable) {
81
97
  const { tableName, relationName } = joinTable;
82
98
  const schemaName = toPascalCase(relationName);
83
- return ` ${tableName}: Schema.Schema.Type<typeof ${schemaName}>;`;
99
+ return ` ${tableName}: Schema.Schema.Encoded<typeof ${schemaName}>;`;
84
100
  }
85
101
  /**
86
102
  * Generate complete DB interface including join tables
@@ -1 +1 @@
1
- {"version":3,"file":"type.js","sourceRoot":"","sources":["../../src/kysely/type.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,KAAiB;IAC/C,OAAO,eAAe,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC,KAAK,CAAC,CAAC;AACpD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,KAAiB;IAC9C,OAAO,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AACrD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,SAAiB,EAAE,KAAiB,EAAE,SAAkB;IACzF,IAAI,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3B,yEAAyE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iBG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAiB;IACxD,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC;IAC7C,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3C,OAAO,KAAK,SAAS,kCAAkC,SAAS,IAAI,CAAC;AACvE,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,iCAAiC,CAAC,SAAwB;IACxE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,SAAS,CAAC;IAC9C,MAAM,UAAU,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;IAC9C,OAAO,KAAK,SAAS,kCAAkC,UAAU,IAAI,CAAC;AACxE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CACjC,MAA6B,EAC7B,aAA8B,EAAE;IAEhC,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEjF,MAAM,gBAAgB,GACpB,UAAU,CAAC,MAAM,GAAG,CAAC;QACnB,CAAC,CAAC,KAAK,UAAU,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QACrE,CAAC,CAAC,EAAE,CAAC;IAET,OAAO;;EAEP,YAAY,GAAG,gBAAgB;EAC/B,CAAC;AACH,CAAC"}
@@ -11,14 +11,17 @@
11
11
  * Prisma scalar type mapping to Effect Schema types
12
12
  * Uses const assertion for type safety
13
13
  *
14
- * DateTime uses `DateFromInput` (this package's dual-input Date schema):
15
- * - Type = Date (runtime)
16
- * - Encoded = Date | string (accepts native Date from Kysely AND ISO
17
- * string from JSON wire transport)
14
+ * DateTime uses `Schema.DateFromSelf` (Type === Encoded === Date) — matches
15
+ * Prisma's contract that Client returns DateTime as native `Date` instances
16
+ * (https://www.prisma.io/docs "Prisma Client returns all DateTime values
17
+ * as native JavaScript Date objects"). Also matches Kysely's idiomatic
18
+ * `ColumnType<Date, ...>` pattern: SELECT yields Date.
18
19
  *
19
- * Single primitive serves both consumer boundaries DA layer and RPC
20
- * wire so consumers don't need parallel schemas or boundary-specific
21
- * helpers. Mirrors the JsonValue dual-boundary pattern.
20
+ * For RPC/JSON wire boundaries (where dates serialize to ISO strings),
21
+ * decode through a `Schema.Date`-typed contract schema at the boundary.
22
+ * Effect's Schema is single-pair (Type, Encoded) by design — see Doc 10944
23
+ * "The Rule of Schemas" — and the dual-boundary problem is solved by
24
+ * having two schemas (DA-side vs wire-side), not one Union.
22
25
  */
23
26
  export declare const PRISMA_TO_EFFECT_SCHEMA: {
24
27
  readonly String: "Schema.String";
@@ -27,7 +30,7 @@ export declare const PRISMA_TO_EFFECT_SCHEMA: {
27
30
  readonly BigInt: "Schema.BigInt";
28
31
  readonly Decimal: "Schema.String";
29
32
  readonly Boolean: "Schema.Boolean";
30
- readonly DateTime: "DateFromInput";
33
+ readonly DateTime: "Schema.DateFromSelf";
31
34
  readonly Json: "JsonValue";
32
35
  readonly Bytes: "Schema.Uint8Array";
33
36
  };
@@ -57,7 +60,7 @@ export declare function isPrismaScalarType(type: string): type is PrismaScalarTy
57
60
  * Get Effect Schema type for a Prisma scalar type
58
61
  * Returns undefined for non-scalar types (enums, relations)
59
62
  */
60
- export declare function getEffectSchemaType(type: string): "Schema.String" | "Schema.Number" | "Schema.BigInt" | "Schema.Boolean" | "DateFromInput" | "JsonValue" | "Schema.Uint8Array" | undefined;
63
+ export declare function getEffectSchemaType(type: string): "Schema.String" | "Schema.Number" | "Schema.BigInt" | "Schema.Boolean" | "Schema.DateFromSelf" | "JsonValue" | "Schema.Uint8Array" | undefined;
61
64
  /**
62
65
  * Get TypeScript type for a Prisma scalar type
63
66
  * Returns the input type unchanged for non-scalar types (enums, models)
@@ -1 +1 @@
1
- {"version":3,"file":"type-mappings.d.ts","sourceRoot":"","sources":["../../src/utils/type-mappings.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;CAU1B,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;CAUvB,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,OAAO,uBAAuB,CAAC;AAEpE;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,gBAAgB,CAEzE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,4IAK/C;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,UAK7C"}
1
+ {"version":3,"file":"type-mappings.d.ts","sourceRoot":"","sources":["../../src/utils/type-mappings.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;CAU1B,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;CAUvB,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,OAAO,uBAAuB,CAAC;AAEpE;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,gBAAgB,CAEzE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,kJAK/C;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,UAK7C"}
@@ -11,14 +11,17 @@
11
11
  * Prisma scalar type mapping to Effect Schema types
12
12
  * Uses const assertion for type safety
13
13
  *
14
- * DateTime uses `DateFromInput` (this package's dual-input Date schema):
15
- * - Type = Date (runtime)
16
- * - Encoded = Date | string (accepts native Date from Kysely AND ISO
17
- * string from JSON wire transport)
14
+ * DateTime uses `Schema.DateFromSelf` (Type === Encoded === Date) — matches
15
+ * Prisma's contract that Client returns DateTime as native `Date` instances
16
+ * (https://www.prisma.io/docs "Prisma Client returns all DateTime values
17
+ * as native JavaScript Date objects"). Also matches Kysely's idiomatic
18
+ * `ColumnType<Date, ...>` pattern: SELECT yields Date.
18
19
  *
19
- * Single primitive serves both consumer boundaries DA layer and RPC
20
- * wire so consumers don't need parallel schemas or boundary-specific
21
- * helpers. Mirrors the JsonValue dual-boundary pattern.
20
+ * For RPC/JSON wire boundaries (where dates serialize to ISO strings),
21
+ * decode through a `Schema.Date`-typed contract schema at the boundary.
22
+ * Effect's Schema is single-pair (Type, Encoded) by design — see Doc 10944
23
+ * "The Rule of Schemas" — and the dual-boundary problem is solved by
24
+ * having two schemas (DA-side vs wire-side), not one Union.
22
25
  */
23
26
  export const PRISMA_TO_EFFECT_SCHEMA = {
24
27
  String: 'Schema.String',
@@ -27,7 +30,7 @@ export const PRISMA_TO_EFFECT_SCHEMA = {
27
30
  BigInt: 'Schema.BigInt',
28
31
  Decimal: 'Schema.String', // For precision
29
32
  Boolean: 'Schema.Boolean',
30
- DateTime: 'DateFromInput', // Date | string ↔ Date — dual-boundary safe
33
+ DateTime: 'Schema.DateFromSelf', // Date ↔ Date — Prisma+Kysely canonical
31
34
  Json: 'JsonValue', // Recursive JSON type — prevents null absorption in NullOr
32
35
  Bytes: 'Schema.Uint8Array',
33
36
  };
@@ -1 +1 @@
1
- {"version":3,"file":"type-mappings.js","sourceRoot":"","sources":["../../src/utils/type-mappings.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,MAAM,EAAE,eAAe;IACvB,GAAG,EAAE,eAAe;IACpB,KAAK,EAAE,eAAe;IACtB,MAAM,EAAE,eAAe;IACvB,OAAO,EAAE,eAAe,EAAE,gBAAgB;IAC1C,OAAO,EAAE,gBAAgB;IACzB,QAAQ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AAQ,EAAE,qBAAqB,EAAE,wCAAwC;IACzE,IAAI,EAAE,WAAW,EAAE,2DAA2D;IAC9E,KAAK,EAAE,mBAAmB;CAClB,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,QAAQ;IACb,KAAK,EAAE,QAAQ;IACf,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,MAAM;IAChB,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,QAAQ;IACf,OAAO,EAAE,QAAQ;IACjB,MAAM,EAAE,QAAQ,EAAE,oBAAoB;CAC9B,CAAC;AAOX;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,OAAO,IAAI,IAAI,uBAAuB,CAAC;AACzC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,IAAI,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7B,OAAO,uBAAuB,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,IAAI,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7B,OAAO,oBAAoB,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prisma-effect-kysely",
3
- "version": "5.6.0",
3
+ "version": "5.8.0",
4
4
  "description": "Prisma generator that creates Effect Schema types from Prisma schema compatible with Kysely",
5
5
  "license": "MIT",
6
6
  "author": "Samuel Ho",