prisma-effect-kysely 1.8.1 → 1.8.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.
- package/CHANGELOG.md +39 -24
- package/dist/effect/generator.js +5 -5
- package/dist/effect/generator.js.map +1 -1
- package/dist/effect/join-table.d.ts +6 -1
- package/dist/effect/join-table.d.ts.map +1 -1
- package/dist/effect/join-table.js +16 -4
- package/dist/effect/join-table.js.map +1 -1
- package/dist/kysely/type.d.ts +4 -2
- package/dist/kysely/type.d.ts.map +1 -1
- package/dist/kysely/type.js +9 -8
- package/dist/kysely/type.js.map +1 -1
- package/dist/utils/naming.d.ts +12 -0
- package/dist/utils/naming.d.ts.map +1 -1
- package/dist/utils/naming.js +23 -0
- package/dist/utils/naming.js.map +1 -1
- package/dist/utils/unsupported-config.d.ts +26 -0
- package/dist/utils/unsupported-config.d.ts.map +1 -0
- package/dist/utils/unsupported-config.js +36 -0
- package/dist/utils/unsupported-config.js.map +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,37 +5,52 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
-
## [1.8.
|
|
8
|
+
## [1.8.3] - 2025-10-13
|
|
9
9
|
|
|
10
|
-
###
|
|
10
|
+
### Added
|
|
11
11
|
|
|
12
|
-
####
|
|
13
|
-
- **
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
|
|
12
|
+
#### Semantic Join Table Column Names
|
|
13
|
+
- **Generated join tables now use semantic snake_case field names** instead of Prisma's generic A/B columns
|
|
14
|
+
- **Problem**: Prisma's implicit M2M join tables use non-semantic `A` and `B` column names, causing poor developer experience and forcing developers to remember alphabetical model ordering
|
|
15
|
+
- **Solution**: Map semantic names like `product_id`, `product_tag_id` to actual database columns using Effect Schema's `propertySignature` with `fromKey`
|
|
16
|
+
- **Benefits**:
|
|
17
|
+
- Developer-friendly semantic names in TypeScript code
|
|
18
|
+
- Maintains Prisma A/B database compatibility (no migration required)
|
|
19
|
+
- Type-safe bidirectional transformation (encode/decode)
|
|
20
|
+
- Follows snake_case convention for database identifiers (Prisma best practice)
|
|
21
|
+
- **Example**:
|
|
22
|
+
```typescript
|
|
23
|
+
// Before (v1.8.2):
|
|
24
|
+
export const _ProductToProductTag = Schema.Struct({
|
|
25
|
+
A: columnType(Schema.UUID, Schema.Never, Schema.Never),
|
|
26
|
+
B: columnType(Schema.UUID, Schema.Never, Schema.Never),
|
|
27
|
+
});
|
|
18
28
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
29
|
+
// After (v1.8.3):
|
|
30
|
+
export const _ProductToProductTag = Schema.Struct({
|
|
31
|
+
product_id: Schema.propertySignature(columnType(Schema.UUID, Schema.Never, Schema.Never)).pipe(Schema.fromKey("A")),
|
|
32
|
+
product_tag_id: Schema.propertySignature(columnType(Schema.UUID, Schema.Never, Schema.Never)).pipe(Schema.fromKey("B")),
|
|
33
|
+
});
|
|
34
|
+
```
|
|
35
|
+
- Location: `src/effect/join-table.ts:37-69`
|
|
36
|
+
- New utility: `toSnakeCase()` in `src/utils/naming.ts:61-73`
|
|
25
37
|
|
|
26
|
-
###
|
|
38
|
+
### Fixed
|
|
27
39
|
|
|
28
|
-
####
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
40
|
+
#### Unused Enum Type Imports
|
|
41
|
+
- **types.ts now imports only Schema wrappers**: Eliminated TypeScript "declared but never read" warnings
|
|
42
|
+
- **Problem**: Generated `types.ts` imported both plain enum types (e.g., `BudgetStatus`) and schema wrappers (e.g., `BudgetStatusSchema`), but only schema wrappers were used
|
|
43
|
+
- **Solution**: Import generation now only includes `*Schema` wrappers
|
|
44
|
+
- **Impact**: Cleaner generated code, no TypeScript warnings
|
|
45
|
+
- Location: `src/effect/generator.ts:95-107`
|
|
33
46
|
|
|
34
47
|
### Technical Details
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
48
|
+
- **Quality Assurance**: All 165 tests passing (15 naming tests + 10 join table tests + 140 existing), zero TypeScript errors
|
|
49
|
+
- **Test Coverage**: New comprehensive tests for `toSnakeCase` utility and semantic join table column generation
|
|
50
|
+
- **Documentation**: Updated CLAUDE.md with join table naming behavior explanation
|
|
51
|
+
- **Research**: Verified snake_case follows Prisma generator best practices (community standard for database identifiers)
|
|
52
|
+
- **Backwards Compatible**: No breaking changes - existing queries continue to work
|
|
53
|
+
- **Effect Schema Integration**: Uses native `propertySignature` + `fromKey` pattern (official Effect Schema column mapping approach)
|
|
39
54
|
|
|
40
55
|
## [1.8.0] - 2025-10-12
|
|
41
56
|
|
package/dist/effect/generator.js
CHANGED
|
@@ -80,13 +80,13 @@ export type ${name}UpdateEncoded = Schema.Schema.Encoded<typeof ${name}.Updateab
|
|
|
80
80
|
`import { columnType, generated, getSchemas } from "prisma-effect-kysely";`,
|
|
81
81
|
];
|
|
82
82
|
if (hasEnums) {
|
|
83
|
-
//
|
|
84
|
-
//
|
|
85
|
-
//
|
|
83
|
+
// Only import Schema wrappers (not plain enum types)
|
|
84
|
+
// Use PascalCase naming with Schema suffix
|
|
85
|
+
// No SCREAMING_SNAKE_CASE
|
|
86
86
|
const enumImports = this.dmmf.datamodel.enums
|
|
87
|
-
.
|
|
87
|
+
.map((e) => {
|
|
88
88
|
const baseName = (0, naming_1.toPascalCase)(e.name);
|
|
89
|
-
return
|
|
89
|
+
return `${baseName}Schema`;
|
|
90
90
|
})
|
|
91
91
|
.join(', ');
|
|
92
92
|
imports.push(`import { ${enumImports} } from "./enums";`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../src/effect/gener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GAAG,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;QAEpD,OAAO,GAAG,UAAU,OAAO,iBAAiB,OAAO,WAAW,EAAE,CAAC;IACnE,CAAC;IAED;;;;OAIG;IACH,mBAAmB,CAAC,QAAiB;QACnC,MAAM,MAAM,GAAG,IAAA,4BAAkB,GAAE,CAAC;QAEpC,MAAM,OAAO,GAAG;YACd,kCAAkC;YAClC,2EAA2E;SAC5E,CAAC;QAEF,IAAI,QAAQ,EAAE,CAAC;YACb,qDAAqD;YACrD,2CAA2C;YAC3C,0BAA0B;YAC1B,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK;iBAC1C,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;gBACT,MAAM,QAAQ,GAAG,IAAA,qBAAY,EAAC,CAAC,CAAC,IAAI,CAAC,CAAC;gBACtC,OAAO,GAAG,QAAQ,QAAQ,CAAC;YAC7B,CAAC,CAAC;iBACD,IAAI,CAAC,IAAI,CAAC,CAAC;YAEd,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,IAAA,oCAAuB,EAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACrF,CAAC;CACF;AA1GD,0CA0GC"}
|
|
@@ -4,10 +4,15 @@ import type { JoinTableInfo } from '../prisma/relation';
|
|
|
4
4
|
* Generate Effect Schema for an implicit many-to-many join table
|
|
5
5
|
*
|
|
6
6
|
* Structure:
|
|
7
|
-
* - Base schema with
|
|
7
|
+
* - Base schema with semantic snake_case field names mapped to A/B via fromKey
|
|
8
8
|
* - Operational schemas via getSchemas()
|
|
9
9
|
* - Type exports (Select, Insert, Update)
|
|
10
10
|
* - Encoded type exports
|
|
11
|
+
*
|
|
12
|
+
* Example:
|
|
13
|
+
* - Database columns: A, B (Prisma requirement)
|
|
14
|
+
* - TypeScript fields: product_id, product_tag_id (semantic snake_case)
|
|
15
|
+
* - Mapping: product_id → A, product_tag_id → B (via Schema.fromKey)
|
|
11
16
|
*/
|
|
12
17
|
export declare function generateJoinTableSchema(joinTable: JoinTableInfo, _dmmf: DMMF.Document): string;
|
|
13
18
|
//# sourceMappingURL=join-table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"join-table.d.ts","sourceRoot":"","sources":["../../src/effect/join-table.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"join-table.d.ts","sourceRoot":"","sources":["../../src/effect/join-table.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAqBxD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE,IAAI,CAAC,QAAQ,GAAG,MAAM,CAgD9F"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateJoinTableSchema = generateJoinTableSchema;
|
|
4
|
+
const naming_1 = require("../utils/naming");
|
|
4
5
|
/**
|
|
5
6
|
* Map join table column type to Effect Schema type
|
|
6
7
|
* Uses same mapping as regular fields
|
|
@@ -20,21 +21,32 @@ function mapColumnType(columnType, isUuid) {
|
|
|
20
21
|
* Generate Effect Schema for an implicit many-to-many join table
|
|
21
22
|
*
|
|
22
23
|
* Structure:
|
|
23
|
-
* - Base schema with
|
|
24
|
+
* - Base schema with semantic snake_case field names mapped to A/B via fromKey
|
|
24
25
|
* - Operational schemas via getSchemas()
|
|
25
26
|
* - Type exports (Select, Insert, Update)
|
|
26
27
|
* - Encoded type exports
|
|
28
|
+
*
|
|
29
|
+
* Example:
|
|
30
|
+
* - Database columns: A, B (Prisma requirement)
|
|
31
|
+
* - TypeScript fields: product_id, product_tag_id (semantic snake_case)
|
|
32
|
+
* - Mapping: product_id → A, product_tag_id → B (via Schema.fromKey)
|
|
27
33
|
*/
|
|
28
34
|
function generateJoinTableSchema(joinTable, _dmmf) {
|
|
29
|
-
const { tableName, relationName, columnAType, columnBType, columnAIsUuid, columnBIsUuid } = joinTable;
|
|
35
|
+
const { tableName, relationName, modelA, modelB, columnAType, columnBType, columnAIsUuid, columnBIsUuid, } = joinTable;
|
|
30
36
|
// Map column types to Effect Schema types
|
|
31
37
|
const columnASchema = mapColumnType(columnAType, columnAIsUuid);
|
|
32
38
|
const columnBSchema = mapColumnType(columnBType, columnBIsUuid);
|
|
39
|
+
// Generate semantic snake_case field names from model names
|
|
40
|
+
const columnAName = `${(0, naming_1.toSnakeCase)(modelA)}_id`;
|
|
41
|
+
const columnBName = `${(0, naming_1.toSnakeCase)(modelB)}_id`;
|
|
33
42
|
// Both columns are foreign keys, so use columnType for read-only behavior
|
|
34
|
-
|
|
35
|
-
const
|
|
43
|
+
// Use propertySignature with fromKey to map semantic names to actual A/B database columns
|
|
44
|
+
const columnAField = ` ${columnAName}: Schema.propertySignature(columnType(${columnASchema}, Schema.Never, Schema.Never)).pipe(Schema.fromKey("A"))`;
|
|
45
|
+
const columnBField = ` ${columnBName}: Schema.propertySignature(columnType(${columnBSchema}, Schema.Never, Schema.Never)).pipe(Schema.fromKey("B"))`;
|
|
36
46
|
// Generate base schema
|
|
37
47
|
const baseSchema = `// ${tableName} Join Table Schema
|
|
48
|
+
// Database columns: A (${modelA}), B (${modelB})
|
|
49
|
+
// TypeScript fields: ${columnAName}, ${columnBName}
|
|
38
50
|
export const _${relationName} = Schema.Struct({
|
|
39
51
|
${columnAField},
|
|
40
52
|
${columnBField},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"join-table.js","sourceRoot":"","sources":["../../src/effect/join-table.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"join-table.js","sourceRoot":"","sources":["../../src/effect/join-table.ts"],"names":[],"mappings":";;AAoCA,0DAgDC;AAlFD,4CAA8C;AAE9C;;;GAGG;AACH,SAAS,aAAa,CAAC,UAAkB,EAAE,MAAe;IACxD,IAAI,UAAU,KAAK,QAAQ,IAAI,MAAM,EAAE,CAAC;QACtC,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,MAAM,SAAS,GAA2B;QACxC,MAAM,EAAE,eAAe;QACvB,GAAG,EAAE,eAAe;QACpB,MAAM,EAAE,eAAe;KACxB,CAAC;IAEF,OAAO,SAAS,CAAC,UAAU,CAAC,IAAI,gBAAgB,CAAC;AACnD,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,SAAgB,uBAAuB,CAAC,SAAwB,EAAE,KAAoB;IACpF,MAAM,EACJ,SAAS,EACT,YAAY,EACZ,MAAM,EACN,MAAM,EACN,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,GACd,GAAG,SAAS,CAAC;IAEd,0CAA0C;IAC1C,MAAM,aAAa,GAAG,aAAa,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IAChE,MAAM,aAAa,GAAG,aAAa,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IAEhE,4DAA4D;IAC5D,MAAM,WAAW,GAAG,GAAG,IAAA,oBAAW,EAAC,MAAM,CAAC,KAAK,CAAC;IAChD,MAAM,WAAW,GAAG,GAAG,IAAA,oBAAW,EAAC,MAAM,CAAC,KAAK,CAAC;IAEhD,0EAA0E;IAC1E,0FAA0F;IAC1F,MAAM,YAAY,GAAG,KAAK,WAAW,yCAAyC,aAAa,0DAA0D,CAAC;IACtJ,MAAM,YAAY,GAAG,KAAK,WAAW,yCAAyC,aAAa,0DAA0D,CAAC;IAEtJ,uBAAuB;IACvB,MAAM,UAAU,GAAG,MAAM,SAAS;0BACV,MAAM,SAAS,MAAM;wBACvB,WAAW,KAAK,WAAW;gBACnC,YAAY;EAC1B,YAAY;EACZ,YAAY;IACV,CAAC;IAEH,+BAA+B;IAC/B,MAAM,iBAAiB,GAAG,gBAAgB,YAAY,kBAAkB,YAAY,IAAI,CAAC;IAEzF,wBAAwB;IACxB,MAAM,WAAW,GAAG,eAAe,YAAY,sCAAsC,YAAY;cACrF,YAAY,sCAAsC,YAAY;cAC9D,YAAY,sCAAsC,YAAY,eAAe,CAAC;IAE1F,gCAAgC;IAChC,MAAM,cAAc,GAAG,eAAe,YAAY,gDAAgD,YAAY;cAClG,YAAY,gDAAgD,YAAY;cACxE,YAAY,gDAAgD,YAAY,eAAe,CAAC;IAEpG,OAAO,GAAG,UAAU,OAAO,iBAAiB,OAAO,WAAW,KAAK,cAAc,EAAE,CAAC;AACtF,CAAC"}
|
package/dist/kysely/type.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { DMMF } from
|
|
2
|
-
import type { JoinTableInfo } from
|
|
1
|
+
import type { DMMF } from '@prisma/generator-helper';
|
|
2
|
+
import type { JoinTableInfo } from '../prisma/relation';
|
|
3
3
|
/**
|
|
4
4
|
* Determine if field needs Kysely columnType wrapper
|
|
5
5
|
* ID fields with @default are read-only (can't insert/update)
|
|
@@ -25,10 +25,12 @@ export declare function applyMapDirective(fieldType: string, field: DMMF.Field):
|
|
|
25
25
|
export declare function buildKyselyFieldType(baseFieldType: string, field: DMMF.Field): string;
|
|
26
26
|
/**
|
|
27
27
|
* Generate DB interface entry for a model
|
|
28
|
+
* Uses pre-resolved *SelectEncoded type for Kysely compatibility
|
|
28
29
|
*/
|
|
29
30
|
export declare function generateDBInterfaceEntry(model: DMMF.Model): string;
|
|
30
31
|
/**
|
|
31
32
|
* Generate DB interface entry for a join table
|
|
33
|
+
* Uses pre-resolved *SelectEncoded type for Kysely compatibility
|
|
32
34
|
*/
|
|
33
35
|
export declare function generateJoinTableDBInterfaceEntry(joinTable: JoinTableInfo): string;
|
|
34
36
|
/**
|
|
@@ -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;AAErD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../src/kysely/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,WAEhD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,WAE/C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,UAOtE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,UAMrE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,UAQ5E;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,UAIzD;AAED;;;GAGG;AACH,wBAAgB,iCAAiC,CAAC,SAAS,EAAE,aAAa,UAGzE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,SAAS,IAAI,CAAC,KAAK,EAAE,EAC7B,UAAU,GAAE,aAAa,EAAO,UAajC"}
|
package/dist/kysely/type.js
CHANGED
|
@@ -9,6 +9,7 @@ exports.generateDBInterfaceEntry = generateDBInterfaceEntry;
|
|
|
9
9
|
exports.generateJoinTableDBInterfaceEntry = generateJoinTableDBInterfaceEntry;
|
|
10
10
|
exports.generateDBInterface = generateDBInterface;
|
|
11
11
|
const type_1 = require("../prisma/type");
|
|
12
|
+
const naming_1 = require("../utils/naming");
|
|
12
13
|
/**
|
|
13
14
|
* Determine if field needs Kysely columnType wrapper
|
|
14
15
|
* ID fields with @default are read-only (can't insert/update)
|
|
@@ -58,29 +59,29 @@ function buildKyselyFieldType(baseFieldType, field) {
|
|
|
58
59
|
}
|
|
59
60
|
/**
|
|
60
61
|
* Generate DB interface entry for a model
|
|
62
|
+
* Uses pre-resolved *SelectEncoded type for Kysely compatibility
|
|
61
63
|
*/
|
|
62
64
|
function generateDBInterfaceEntry(model) {
|
|
63
65
|
const tableName = model.dbName || model.name;
|
|
64
|
-
const
|
|
65
|
-
return ` ${tableName}:
|
|
66
|
+
const pascalName = (0, naming_1.toPascalCase)(model.name);
|
|
67
|
+
return ` ${tableName}: ${pascalName}SelectEncoded;`;
|
|
66
68
|
}
|
|
67
69
|
/**
|
|
68
70
|
* Generate DB interface entry for a join table
|
|
71
|
+
* Uses pre-resolved *SelectEncoded type for Kysely compatibility
|
|
69
72
|
*/
|
|
70
73
|
function generateJoinTableDBInterfaceEntry(joinTable) {
|
|
71
74
|
const { tableName, relationName } = joinTable;
|
|
72
|
-
return ` ${tableName}:
|
|
75
|
+
return ` ${tableName}: ${relationName}SelectEncoded;`;
|
|
73
76
|
}
|
|
74
77
|
/**
|
|
75
78
|
* Generate complete DB interface including join tables
|
|
76
79
|
*/
|
|
77
80
|
function generateDBInterface(models, joinTables = []) {
|
|
78
|
-
const modelEntries = Array.from(models)
|
|
79
|
-
.map(generateDBInterfaceEntry)
|
|
80
|
-
.join("\n");
|
|
81
|
+
const modelEntries = Array.from(models).map(generateDBInterfaceEntry).join('\n');
|
|
81
82
|
const joinTableEntries = joinTables.length > 0
|
|
82
|
-
?
|
|
83
|
-
:
|
|
83
|
+
? '\n' + joinTables.map(generateJoinTableDBInterfaceEntry).join('\n')
|
|
84
|
+
: '';
|
|
84
85
|
return `// Kysely Database Interface
|
|
85
86
|
export interface DB {
|
|
86
87
|
${modelEntries}${joinTableEntries}
|
package/dist/kysely/type.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../src/kysely/type.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../src/kysely/type.ts"],"names":[],"mappings":";;AASA,0CAEC;AAMD,wCAEC;AAKD,gDAOC;AAKD,8CAMC;AAMD,oDAQC;AAMD,4DAIC;AAMD,8EAGC;AAKD,kDAeC;AA9FD,yCAA4E;AAE5E,4CAA+C;AAE/C;;;GAGG;AACH,SAAgB,eAAe,CAAC,KAAiB;IAC/C,OAAO,IAAA,sBAAe,EAAC,KAAK,CAAC,IAAI,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC;AACpD,CAAC;AAED;;;GAGG;AACH,SAAgB,cAAc,CAAC,KAAiB;IAC9C,OAAO,IAAA,sBAAe,EAAC,KAAK,CAAC,IAAI,CAAC,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC;AACrD,CAAC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CAAC,SAAiB,EAAE,KAAiB;IACrE,IAAI,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO,cAAc,SAAS,+BAA+B,CAAC;IAChE,CAAC;SAAM,IAAI,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;QACjC,OAAO,aAAa,SAAS,GAAG,CAAC;IACnC,CAAC;IACD,OAAO,SAAS,C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,GACpB,UAAU,CAAC,MAAM,GAAG,CAAC;QACnB,CAAC,CAAC,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QACrE,CAAC,CAAC,EAAE,CAAC;IAET,OAAO;;EAEP,YAAY,GAAG,gBAAgB;EAC/B,CAAC;AACH,CAAC"}
|
package/dist/utils/naming.d.ts
CHANGED
|
@@ -15,4 +15,16 @@
|
|
|
15
15
|
* toPascalCase('USER_ROLE', 'Type') // 'UserRoleType'
|
|
16
16
|
*/
|
|
17
17
|
export declare function toPascalCase(str: string, suffix?: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Convert PascalCase or camelCase string to snake_case
|
|
20
|
+
* Used for generating database column names from model names
|
|
21
|
+
*
|
|
22
|
+
* @param str - The string to convert
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* toSnakeCase('User') // 'user'
|
|
26
|
+
* toSnakeCase('ProductTag') // 'product_tag'
|
|
27
|
+
* toSnakeCase('ProductStatus') // 'product_status'
|
|
28
|
+
*/
|
|
29
|
+
export declare function toSnakeCase(str: string): string;
|
|
18
30
|
//# sourceMappingURL=naming.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"naming.d.ts","sourceRoot":"","sources":["../../src/utils/naming.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CA8BjE"}
|
|
1
|
+
{"version":3,"file":"naming.d.ts","sourceRoot":"","sources":["../../src/utils/naming.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CA8BjE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAY/C"}
|
package/dist/utils/naming.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.toPascalCase = toPascalCase;
|
|
7
|
+
exports.toSnakeCase = toSnakeCase;
|
|
7
8
|
/**
|
|
8
9
|
* Convert any string to PascalCase with optional suffix
|
|
9
10
|
* Handles: snake_case, camelCase, kebab-case, or mixed formats
|
|
@@ -47,4 +48,26 @@ function toPascalCase(str, suffix) {
|
|
|
47
48
|
}
|
|
48
49
|
return suffix ? `${pascalCase}${suffix}` : pascalCase;
|
|
49
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Convert PascalCase or camelCase string to snake_case
|
|
53
|
+
* Used for generating database column names from model names
|
|
54
|
+
*
|
|
55
|
+
* @param str - The string to convert
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* toSnakeCase('User') // 'user'
|
|
59
|
+
* toSnakeCase('ProductTag') // 'product_tag'
|
|
60
|
+
* toSnakeCase('ProductStatus') // 'product_status'
|
|
61
|
+
*/
|
|
62
|
+
function toSnakeCase(str) {
|
|
63
|
+
if (!str)
|
|
64
|
+
return str;
|
|
65
|
+
return (str
|
|
66
|
+
// Insert underscore before uppercase letters (except at start)
|
|
67
|
+
.replace(/([A-Z])/g, '_$1')
|
|
68
|
+
// Remove leading underscore if present
|
|
69
|
+
.replace(/^_/, '')
|
|
70
|
+
// Convert to lowercase
|
|
71
|
+
.toLowerCase());
|
|
72
|
+
}
|
|
50
73
|
//# sourceMappingURL=naming.js.map
|
package/dist/utils/naming.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"naming.js","sourceRoot":"","sources":["../../src/utils/naming.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAeH,oCA8BC;
|
|
1
|
+
{"version":3,"file":"naming.js","sourceRoot":"","sources":["../../src/utils/naming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;aACzE,IAAI,CAAC,EAAE,CAAC,CAAC;IACd,CAAC;IAED,OAAO,MAAM,CAAC,CAAC,CAAC,GAAG,UAAU,GAAG,MAAM,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC;AACxD,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,WAAW,CAAC,GAAW;IACrC,IAAI,CAAC,GAAG;QAAE,OAAO,GAAG,CAAC;IAErB,OAAO,CACL,GAAG;QACD,+DAA+D;SAC9D,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC;QAC3B,uCAAuC;SACtC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;QAClB,uBAAuB;SACtB,WAAW,EAAE,CACjB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for a single Unsupported field
|
|
3
|
+
*/
|
|
4
|
+
export interface UnsupportedFieldConfig {
|
|
5
|
+
effectType: string;
|
|
6
|
+
dbType: string;
|
|
7
|
+
dbName: string;
|
|
8
|
+
required: boolean;
|
|
9
|
+
comment?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Full configuration structure
|
|
13
|
+
*/
|
|
14
|
+
export interface UnsupportedConfig {
|
|
15
|
+
models: Record<string, Record<string, UnsupportedFieldConfig>>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Load unsupported fields configuration from JSON file
|
|
19
|
+
* Looks for prisma/unsupported-fields.json relative to schema location
|
|
20
|
+
*/
|
|
21
|
+
export declare function loadUnsupportedConfig(schemaPath: string): UnsupportedConfig | null;
|
|
22
|
+
/**
|
|
23
|
+
* Get unsupported fields for a specific model
|
|
24
|
+
*/
|
|
25
|
+
export declare function getUnsupportedFields(config: UnsupportedConfig | null, modelName: string): Record<string, UnsupportedFieldConfig>;
|
|
26
|
+
//# sourceMappingURL=unsupported-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unsupported-config.d.ts","sourceRoot":"","sources":["../../src/utils/unsupported-config.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC,CAAC;CAChE;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI,CAiBlF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,iBAAiB,GAAG,IAAI,EAChC,SAAS,EAAE,MAAM,GAChB,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAGxC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadUnsupportedConfig = loadUnsupportedConfig;
|
|
4
|
+
exports.getUnsupportedFields = getUnsupportedFields;
|
|
5
|
+
const fs_1 = require("fs");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
/**
|
|
8
|
+
* Load unsupported fields configuration from JSON file
|
|
9
|
+
* Looks for prisma/unsupported-fields.json relative to schema location
|
|
10
|
+
*/
|
|
11
|
+
function loadUnsupportedConfig(schemaPath) {
|
|
12
|
+
try {
|
|
13
|
+
// Assume schema is in prisma/schema/ directory
|
|
14
|
+
// Config should be in prisma/unsupported-fields.json
|
|
15
|
+
const schemaDir = (0, path_1.dirname)((0, path_1.dirname)(schemaPath)); // Go up to prisma/
|
|
16
|
+
const configPath = (0, path_1.join)(schemaDir, 'unsupported-fields.json');
|
|
17
|
+
if (!(0, fs_1.existsSync)(configPath)) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
const content = (0, fs_1.readFileSync)(configPath, 'utf-8');
|
|
21
|
+
return JSON.parse(content);
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
console.warn(`⚠️ Failed to load unsupported-fields.json: ${error}`);
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Get unsupported fields for a specific model
|
|
30
|
+
*/
|
|
31
|
+
function getUnsupportedFields(config, modelName) {
|
|
32
|
+
if (!config)
|
|
33
|
+
return {};
|
|
34
|
+
return config.models[modelName] || {};
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=unsupported-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unsupported-config.js","sourceRoot":"","sources":["../../src/utils/unsupported-config.ts"],"names":[],"mappings":";;AAyBA,sDAiBC;AAKD,oDAMC;AArDD,2BAA8C;AAC9C,+BAAqC;AAoBrC;;;GAGG;AACH,SAAgB,qBAAqB,CAAC,UAAkB;IACtD,IAAI,CAAC;QACH,+CAA+C;QAC/C,qDAAqD;QACrD,MAAM,SAAS,GAAG,IAAA,cAAO,EAAC,IAAA,cAAO,EAAC,UAAU,CAAC,CAAC,CAAC,CAAC,mBAAmB;QACnE,MAAM,UAAU,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,yBAAyB,CAAC,CAAC;QAE9D,IAAI,CAAC,IAAA,eAAU,EAAC,UAAU,CAAC,EAAE,CAAC;YAC5B,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,OAAO,GAAG,IAAA,iBAAY,EAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAClD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAsB,CAAC;IAClD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,+CAA+C,KAAK,EAAE,CAAC,CAAC;QACrE,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAgB,oBAAoB,CAClC,MAAgC,EAChC,SAAiB;IAEjB,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IACvB,OAAO,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;AACxC,CAAC"}
|