hekireki 0.39.0 → 0.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/README.md +53 -148
  2. package/dist/bin/activerecord.js +2 -3
  3. package/dist/bin/ajv.js +2 -3
  4. package/dist/bin/arktype.js +2 -3
  5. package/dist/bin/atlas.js +2 -3
  6. package/dist/bin/django.js +2 -3
  7. package/dist/bin/drizzle.js +2 -3
  8. package/dist/bin/ecto.js +2 -3
  9. package/dist/bin/efcore.js +2 -3
  10. package/dist/bin/effect.js +2 -3
  11. package/dist/bin/eloquent.js +2 -3
  12. package/dist/bin/er.js +2 -3
  13. package/dist/bin/exposed.js +2 -3
  14. package/dist/bin/gorm.js +2 -3
  15. package/dist/bin/hekireki.js +13 -20
  16. package/dist/bin/kysely.js +2 -3
  17. package/dist/bin/openapi.d.ts +1 -0
  18. package/dist/bin/openapi.js +5 -0
  19. package/dist/bin/pydantic.js +2 -3
  20. package/dist/bin/sea-orm.js +2 -3
  21. package/dist/bin/seed.js +2 -3
  22. package/dist/bin/sqlalchemy.js +2 -3
  23. package/dist/bin/typebox.js +2 -3
  24. package/dist/bin/valibot.js +2 -3
  25. package/dist/bin/zod.js +2 -3
  26. package/dist/{bin-BqUSO3tD.js → bin-T1le3lMh.js} +643 -230
  27. package/dist/{discover-taxa67WN.js → discover-BaDQsKnF.js} +2 -3
  28. package/dist/{emit-D6EafjQn.js → emit-C4CeSye3.js} +3 -4
  29. package/dist/{file-BTbZL3ea.js → file-BAVQ-zst.js} +1 -2
  30. package/dist/index.d.ts +0 -2
  31. package/dist/index.js +1 -2
  32. package/dist/{migrate-BS2daXFS.js → migrate-2xlj7ayX.js} +7 -10
  33. package/dist/{plan-BtHvkK4c.js → plan-B8PRmVdV.js} +41 -77
  34. package/dist/{prisma-model-bvolNNow.js → prisma-model-DFq7AQgV.js} +3 -6
  35. package/dist/{run-C7QR2qhb.js → run-BQlJs4wi.js} +22 -37
  36. package/dist/{schema-DaaMSqfw.js → schema-CfxnFLAw.js} +3 -5
  37. package/dist/{sql-BGnCCgBa.js → sql-izRRI1Bi.js} +13 -23
  38. package/dist/{start-AZKmzv5G.js → start-C7m4KyUz.js} +280 -819
  39. package/dist/studio/assets/{chip-qtq7V4Rg.js → chip-D4JuozFz.js} +1 -1
  40. package/dist/studio/assets/client-DTRYUhbF.js +2 -0
  41. package/dist/studio/assets/{code-block-CMwrS7oX.js → code-block-B7oBDy4S.js} +1 -1
  42. package/dist/studio/assets/confirm-dialog-DgDjONHy.js +1 -0
  43. package/dist/studio/assets/{copy-CxzC330n.js → copy-CO4Wewxa.js} +1 -1
  44. package/dist/studio/assets/{copy-button-BdkKLTkw.js → copy-button-DDzfUcsZ.js} +1 -1
  45. package/dist/studio/assets/dist-gV8lABSq.js +13 -0
  46. package/dist/studio/assets/{docs-C7LO1TRA.js → docs-DyJ-qhu9.js} +1 -1
  47. package/dist/studio/assets/{editor.worker-BmdWdrHZ.js → editor.worker-CRz__AKW.js} +1 -1
  48. package/dist/studio/assets/{enums._name-39GUOK93.js → enums._name-CcIWxnq0.js} +1 -1
  49. package/dist/studio/assets/field-icon-DwOxCe9v.js +55 -0
  50. package/dist/studio/assets/hooks-6J-1786l.js +2 -0
  51. package/dist/studio/assets/index-D2cpa83b.js +15 -0
  52. package/dist/studio/assets/index-Dn9oYAy5.css +2 -0
  53. package/dist/studio/assets/labels-BrdjOFB0.js +2 -0
  54. package/dist/studio/assets/{lazyRouteComponent-65jX9pcP.js → lazyRouteComponent-CzElNsBd.js} +1 -1
  55. package/dist/studio/assets/lu-BwZ0uwaH.js +7 -0
  56. package/dist/studio/assets/marked-text-CRUtsVYt.js +3 -0
  57. package/dist/studio/assets/models._name-Drem1hqS.js +1 -0
  58. package/dist/studio/assets/{monaco-CTrNbz9K.js → monaco-CKCcdl6_.js} +1 -1
  59. package/dist/studio/assets/{monaco-XesTiddK.js → monaco-Doo5FK2W.js} +17 -17
  60. package/dist/studio/assets/{not-found-CMgHbtIb.js → not-found-KT_nPOAU.js} +1 -1
  61. package/dist/studio/assets/{prisma-BRcayuiL.js → prisma-4lQKwVn6.js} +1 -1
  62. package/dist/studio/assets/result-table-DY7sKJQq.js +1 -0
  63. package/dist/studio/assets/routes-D6hrrw5V.js +1 -0
  64. package/dist/studio/assets/{schema-gate-CJc_mlpl.js → schema-gate-Dq2l2Sh6.js} +1 -1
  65. package/dist/studio/assets/schema-view-CnitOLrD.js +9 -0
  66. package/dist/studio/assets/sql-CjIkv--0.js +6 -0
  67. package/dist/studio/assets/table-BxRDQMeA.js +1 -0
  68. package/dist/studio/assets/tabs-BwlFa2ot.js +1 -0
  69. package/dist/studio/assets/useFormValidation-DifOycKN.js +1 -0
  70. package/dist/studio/assets/{useMatch-C20PphzP.js → useMatch-D2UWqcDy.js} +1 -1
  71. package/dist/studio/assets/useMultipleSelectionState-2b0OEWtf.js +1 -0
  72. package/dist/studio/index.html +10 -11
  73. package/package.json +28 -25
  74. package/dist/studio/assets/client-CrHiNQcn.js +0 -2
  75. package/dist/studio/assets/confirm-dialog-D-QpTAoA.js +0 -1
  76. package/dist/studio/assets/dist-BxXzo21y.js +0 -13
  77. package/dist/studio/assets/field-icon-7dg1DynP.js +0 -55
  78. package/dist/studio/assets/hooks-zIaThymT.js +0 -2
  79. package/dist/studio/assets/index-6aoNJjln.css +0 -2
  80. package/dist/studio/assets/index-CkssgCVw.js +0 -11
  81. package/dist/studio/assets/labels-Kd2QEwTC.js +0 -2
  82. package/dist/studio/assets/lu-CMRQv6zo.js +0 -7
  83. package/dist/studio/assets/marked-text-CZD1SIT9.js +0 -3
  84. package/dist/studio/assets/models._name-CHe0Do2Y.js +0 -1
  85. package/dist/studio/assets/result-table-BINfktPB.js +0 -1
  86. package/dist/studio/assets/routes-BzUMSxYJ.js +0 -1
  87. package/dist/studio/assets/schema-view-D6zy0-V7.js +0 -9
  88. package/dist/studio/assets/search-field-Cch08a8e.js +0 -5
  89. package/dist/studio/assets/sql-D1dfGXuK.js +0 -6
  90. package/dist/studio/assets/table-Dd2Yy1pw.js +0 -1
  91. package/dist/studio/assets/tabs-Bn62CRYV.js +0 -1
  92. package/dist/studio/assets/useFormValidation-Bj-3Yj3r.js +0 -1
  93. package/dist/studio/assets/useMultipleSelectionState-DaV9XbLV.js +0 -1
package/README.md CHANGED
@@ -3,8 +3,8 @@
3
3
  # Hekireki
4
4
 
5
5
  **[Hekireki](https://www.npmjs.com/package/hekireki)** reads a [Prisma](https://www.prisma.io/)
6
- schema and writes what the rest of the project needs from it: validation schemas, ORM models for
7
- nine languages, an ER diagram, and seed data. It also comes with a Studio for the schema and its
6
+ schema and writes what the rest of the project needs from it: validation schemas, ORM models, an
7
+ OpenAPI document, an ER diagram and seed data. It also comes with a Studio for the schema and its
8
8
  database.
9
9
 
10
10
  ## Installation
@@ -25,13 +25,9 @@ generator Hekireki-Zod {
25
25
  }
26
26
  ```
27
27
 
28
- Every generator reads the tables and columns Prisma creates: a model or field without `@map`
29
- keeps the name it has in the schema (`"Todo"`, `"authorId"`), and each ORM is told so where its
30
- own convention would say otherwise.
31
-
32
- A `///` comment on a field can carry a line for one of the validation generators, which uses it
33
- as it is. The prefix says which: `@z.` for Zod, `@v.` Valibot, `@a.` ArkType, `@e.` Effect
34
- Schema, `@t.` TypeBox, `@j.` AJV, `@p.` Pydantic, `@ar.` Active Record and `@ecto.` Ecto.
28
+ A `///` comment on a field can carry a line for a validation generator, which uses it as it is.
29
+ The prefix says which: `@z.` Zod, `@v.` Valibot, `@a.` ArkType, `@e.` Effect Schema, `@t.`
30
+ TypeBox, `@j.` AJV, `@p.` Pydantic, `@ar.` Active Record, `@ecto.` Ecto.
35
31
 
36
32
  ```prisma
37
33
  model User {
@@ -43,100 +39,60 @@ model User {
43
39
 
44
40
  ## Generators
45
41
 
46
- The `provider` of the generator block picks the output. The options are optional unless a
47
- section below says otherwise.
42
+ The `provider` of the generator block picks the output. Every option is optional.
48
43
 
49
44
  ### Validation schemas
50
45
 
51
- - **`hekireki-zod`** writes [Zod](https://zod.dev/) schemas. `type` also exports the TypeScript
52
- type of each schema, `relation` adds a schema for each relation, and `zod` picks the flavour:
53
- `"v4"` (the default), `"mini"` or `"@hono/zod-openapi"`.
54
- - **`hekireki-valibot`**, **`hekireki-arktype`**, **`hekireki-effect`**, **`hekireki-typebox`**
55
- and **`hekireki-ajv`** write Valibot, ArkType, Effect Schema, TypeBox and AJV schemas, with the
56
- same `type` and `relation` options.
57
- - **`hekireki-pydantic`** writes Pydantic models, with `relation`.
46
+ | Provider | Writes | Options |
47
+ | ------------------- | ------------- | ------------------------------------------------------------------- |
48
+ | `hekireki-zod` | Zod | `type`, `relation`, `zod` (`"v4"`, `"mini"`, `"@hono/zod-openapi"`) |
49
+ | `hekireki-valibot` | Valibot | `type`, `relation` |
50
+ | `hekireki-arktype` | ArkType | `type`, `relation` |
51
+ | `hekireki-effect` | Effect Schema | `type`, `relation` |
52
+ | `hekireki-typebox` | TypeBox | `type`, `relation` |
53
+ | `hekireki-ajv` | AJV | `type`, `relation` |
54
+ | `hekireki-pydantic` | Pydantic | `relation` |
55
+
56
+ `type` also exports the TypeScript type of each schema; `relation` adds a schema per relation.
58
57
 
59
58
  ### ORM models
60
59
 
61
- Every ORM generator stores a `DateTime` as Prisma Client stores it, so that the ORM and Prisma
62
- read each other's rows alike. What that takes differs per ORM, and the sections further down say
63
- what each one does and what is left to the caller.
64
-
65
- - **`hekireki-drizzle`** writes Drizzle tables. See [Drizzle](#drizzle).
66
- - **`hekireki-kysely`** writes the `DB` interface for Kysely. See [Kysely](#kysely).
67
- - **`hekireki-sqlalchemy`** writes SQLAlchemy models.
68
- - **`hekireki-django`** writes Django models. See [Django](#django).
69
- - **`hekireki-activerecord`** writes Rails models. `locales` names the directory for translated
70
- messages. See [Active Record](#active-record).
71
- - **`hekireki-gorm`** writes GORM structs. `package` is the Go package name, `model` by default.
72
- - **`hekireki-sea-orm`** writes SeaORM entities. `renameAll` is serde's `rename_all` for the
73
- entities and enums (`"camelCase"`, for one). See [SeaORM](#seaorm).
74
- - **`hekireki-ecto`** writes Ecto schemas. `app` is the application module the schemas live
75
- under, `MyApp` by default. See [Ecto](#ecto).
76
- - **`hekireki-eloquent`** writes Eloquent models. `namespace` is the PHP namespace, `App\Models`
77
- by default.
78
- - **`hekireki-efcore`** writes EF Core entities and a `DbContext`, on PostgreSQL, MySQL and SQLite.
79
- `namespace` is the C# namespace, `Models` by default, and `context` the name of the context,
80
- `AppDbContext` by default. See [EF Core](#ef-core).
81
- - **`hekireki-exposed`** writes Exposed tables, on PostgreSQL. `package` is the Kotlin package,
82
- `models` by default, and `dao` writes the DAO classes beside the tables unless set to `false`.
83
- See [Exposed](#exposed).
84
-
85
- ### Database and diagrams
86
-
87
- - **`hekireki-atlas`** writes the schema as Atlas HCL. `schemaName` is the schema the tables go
88
- in. See [Atlas](#atlas).
89
- - **`hekireki-er`** draws the ER diagram. `outputs` lists the files to write, one rendering per
90
- extension (`.md`, `.dbml`, `.png`, `.svg`), and `theme` is `light` or `dark`.
91
- - **`hekireki-seed`** writes the schema module that `hekireki.config.ts` is typed against. See
92
- [Seed](#seed).
93
-
94
- ### Drizzle
95
-
96
- On MySQL, `hekireki-drizzle` reads and writes a `@db.Timestamp` column as UTC, and MySQL converts
97
- a `TIMESTAMP` through the connection's `time_zone`. Set it to `'+00:00'` on drizzle's connection,
98
- as Prisma's adapter does on its own, or the two see times that differ by the offset.
99
-
100
- On CockroachDB it writes the PostgreSQL schema, for node-postgres, and an `Int` key with
101
- `@default(sequence())` is an identity column, as Prisma makes it. Keep the session's `TimeZone` at
102
- UTC there, as on PostgreSQL, for a `dbgenerated("CURRENT_TIMESTAMP")` default to be UTC.
103
-
104
- ### Kysely
105
-
106
- `hekireki-kysely` writes one `DB` interface, each column typed as the driver of the datasource
107
- reads and binds it: better-sqlite3 on SQLite, pg on PostgreSQL, mysql2 on MySQL. Kysely converts
108
- nothing and runs no hook, so what the types cannot say is the caller's:
109
-
110
- - On SQLite a `DateTime` is text, compared as text: write it as Prisma does,
111
- `date.toISOString().replace('Z', '+00:00')`, or `=`, `@unique` and `@@id` do not meet Prisma's
112
- rows. A `DateTime` with `now()` or a literal default is asked for on insert there, as Prisma
113
- Client writes it itself: SQLite's own default is other text (`CURRENT_TIMESTAMP` sorts before
114
- Prisma's rows, and Prisma reads the literal as an Invalid Date).
115
- - pg and mysql2 read a column without a zone in the process's zone, Prisma in UTC: set pg's type
116
- parsers 1114, 1082, 1115 and 1182 to UTC with `pg.defaults.parseInputDatesAsUTC = true`, and
117
- give mysql2 `timezone: 'Z'`. MySQL refuses ISO text with a `Z`; write a `Date` or MySQL's
118
- `2030-01-02 03:04:05.678901`.
119
- - `@db.Time` and `@db.Timetz` are `string`, the time of day the drivers read.
120
- - `@updatedAt` is asked for on insert, optional or not, and must be set on every update.
121
-
122
- `examples/kysely` in the repository runs a schema against Kysely on SQLite.
123
-
124
- ### Django
125
-
126
- `hekireki-django` keeps a `DateTime` as Prisma Client keeps it:
127
-
128
- - A column without a zone is declared with the `UtcDateTimeField` written into `models.py`. It
129
- stores the UTC instant (on SQLite Prisma's text, `2030-01-02T03:04:05.678+00:00`) and reads it
130
- back as UTC, aware under `USE_TZ = True` and in `TIME_ZONE` under `False`. A `@db.Timestamptz`
131
- is Django's own field.
132
- - `now()` is filled in by the model, in UTC (the UTC date or time on `@db.Date` and `@db.Time`),
133
- and a literal default on a date or time column is its UTC date or time.
134
- - An `@updatedAt` on a date or time column stamps the UTC date or time (`UtcDateField`,
135
- `UtcTimeField`) where Django's `auto_now` would take the local one. A model with `@updatedAt`
136
- is managed by `AutoNowQuerySet`, so `QuerySet.update()` bumps it as `updateMany` does.
137
-
138
- Keep `USE_TZ = True`, Django's default: with `False`, Django sets a PostgreSQL session to
139
- `TIME_ZONE`, and a `dbgenerated()` default such as `CURRENT_TIMESTAMP` is evaluated in that zone.
60
+ | Provider | Writes | Options |
61
+ | ----------------------- | ----------------------------- | -------------------------------------------------- |
62
+ | `hekireki-drizzle` | Drizzle tables | |
63
+ | `hekireki-kysely` | Kysely `DB` interface | |
64
+ | `hekireki-sqlalchemy` | SQLAlchemy models | |
65
+ | `hekireki-django` | Django models | |
66
+ | `hekireki-activerecord` | Rails models | `locales`: directory of the translated messages |
67
+ | `hekireki-gorm` | GORM structs | `package` (`model`) |
68
+ | `hekireki-sea-orm` | SeaORM entities | `renameAll`: serde's `rename_all` |
69
+ | `hekireki-ecto` | Ecto schemas | `app` (`MyApp`) |
70
+ | `hekireki-eloquent` | Eloquent models | `namespace` (`App\Models`) |
71
+ | `hekireki-efcore` | EF Core entities, `DbContext` | `namespace` (`Models`), `context` (`AppDbContext`) |
72
+ | `hekireki-exposed` | Exposed tables | `package` (`models`), `dao` (`true`) |
73
+
74
+ Every ORM generator stores a `DateTime` as Prisma Client stores it, so the ORM and Prisma read
75
+ each other's rows alike.
76
+
77
+ ### Database and documents
78
+
79
+ | Provider | Writes | Options |
80
+ | ------------------ | --------------------------------- | ----------------------------------------------------------------------------------------------- |
81
+ | `hekireki-atlas` | Atlas HCL | `schemaName` (`public`, `main` on SQLite) |
82
+ | `hekireki-openapi` | OpenAPI 3.1 (`.yaml`, `.json`) | `title`, `version`, `paths`: the CRUD of each model |
83
+ | `hekireki-er` | ER diagram | `outputs`: files, one per extension (`.md`, `.dbml`, `.png`, `.svg`); `theme` (`light`, `dark`) |
84
+ | `hekireki-seed` | Schema module for `hekireki seed` | |
85
+
86
+ `hekireki-atlas` writes the tables as Prisma Migrate makes them, so `atlas schema diff` against a
87
+ database Prisma made has nothing to change. `hekireki-openapi` writes them as the
88
+ `components.schemas` Atlas's template writes, `///` comments as descriptions; with `paths`, each
89
+ model gets `GET` and `POST /users` and `GET`, `PATCH` and `DELETE /users/{id}`.
90
+
91
+ Every generator keeps Prisma's names: a model or field without `@map` keeps the name it has in the
92
+ schema, and each ORM is told so where its own convention would say otherwise. What each generator
93
+ does beyond that, and what it leaves to the caller, is in
94
+ [docs/generators.md](https://github.com/nakita628/hekireki/blob/main/packages/hekireki/docs/generators.md).
95
+ Active Record and Ecto take `///` lines of their own, so they are here.
140
96
 
141
97
  ### Active Record
142
98
 
@@ -298,57 +254,6 @@ the module's documentation names the session time zone a `@db.Timestamptz`, `@db
298
254
 
299
255
  `examples/ecto` in the repository runs a schema against Ecto on SQLite.
300
256
 
301
- ### Exposed
302
-
303
- `hekireki-exposed` keeps a `DateTime` as Prisma Client keeps it, with no conversion through the
304
- JVM's zone: an `Instant` bound and read as the UTC instant, to the millisecond (a finer value is
305
- truncated, as a JavaScript Date holds it, in every native type), the UTC date of a `@db.Date`, the
306
- UTC time of a `@db.Time`, and a `@db.Timetz` at offset zero.
307
-
308
- `now()`, literal defaults and every `@updatedAt` are filled in by the client on a DAO or DSL
309
- insert, and the DAO bumps `@updatedAt` on update. A DSL `Table.update` has no such hook, so set it
310
- there yourself: `it[updatedAt] = Instant.now()`.
311
-
312
- pgjdbc sets the session to the JVM's zone, so open the connection in UTC, as Prisma's is, for a
313
- `dbgenerated("CURRENT_TIMESTAMP")` default or `now()` in SQL:
314
-
315
- ```kotlin
316
- Database.connect(url, setupConnection = { it.createStatement().use { s -> s.execute("SET TIME ZONE 'UTC'") } })
317
- ```
318
-
319
- ### EF Core
320
-
321
- `hekireki-efcore` stores a `DateTime` as Prisma Client does, whatever its `DateTimeKind`: the UTC
322
- instant (a `Local` value converted), read back as `Utc`, in Prisma's text form on SQLite, and
323
- `now()` filled in by EF Core rather than by the database's clock. It takes Npgsql's legacy
324
- timestamp behaviour to be off.
325
-
326
- On MySQL, compare a `@db.Time` column with a parameter rather than a constant:
327
- MySql.EntityFrameworkCore writes a constant `TimeSpan` as `TIME '03:04:05'`, without its fraction.
328
-
329
- ### SeaORM
330
-
331
- `hekireki-sea-orm` writes one entity per model into a directory, with a `mod.rs` and a
332
- `prelude.rs`. A `DateTime` is kept as Prisma Client keeps it:
333
-
334
- - `now()`, `@updatedAt` and a literal default are filled by `ActiveModelBehavior::before_save`, in
335
- UTC with milliseconds, so the crate needs `chrono` and `async-trait` beside `sea-orm`.
336
- - On SQLite every `DateTime` is a `PrismaDateTime` (written into `prisma_date_time.rs`), which
337
- binds Prisma's text, `2030-01-02T03:04:05.000+00:00`: filter with
338
- `Column::At.eq(PrismaDateTime(instant))`, not a bare `DateTimeUtc`, which sqlx writes without
339
- the `.000` of a whole second.
340
- - On PostgreSQL and MySQL a `DateTime` is a `NaiveDateTime` in UTC, `@db.Timestamptz` a
341
- `DateTimeWithTimeZone`, a MySQL `@db.Timestamp` a `DateTimeUtc`. `@db.Timetz` is refused: sqlx
342
- has no type to read it into.
343
-
344
- `examples/sea-orm` in the repository runs a schema against SeaORM on SQLite, PostgreSQL and MySQL.
345
-
346
- ### Atlas
347
-
348
- `hekireki-atlas` writes the tables as Prisma Migrate makes them, so that `atlas schema diff`
349
- against a database Prisma made has nothing to change. Its `schemaName` is `public` unless given
350
- (`main` on SQLite): on MySQL, where the schema is the database, give the database's name.
351
-
352
257
  ## Studio
353
258
 
354
259
  ```bash
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as registerGenerator } from "../bin-BqUSO3tD.js";
3
- //#region src/bin/activerecord.ts
2
+ import { t as registerGenerator } from "../bin-T1le3lMh.js";
3
+ // src/bin/activerecord.ts
4
4
  registerGenerator("activerecord");
5
- //#endregion
6
5
  export {};
package/dist/bin/ajv.js CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as registerGenerator } from "../bin-BqUSO3tD.js";
3
- //#region src/bin/ajv.ts
2
+ import { t as registerGenerator } from "../bin-T1le3lMh.js";
3
+ // src/bin/ajv.ts
4
4
  registerGenerator("ajv");
5
- //#endregion
6
5
  export {};
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as registerGenerator } from "../bin-BqUSO3tD.js";
3
- //#region src/bin/arktype.ts
2
+ import { t as registerGenerator } from "../bin-T1le3lMh.js";
3
+ // src/bin/arktype.ts
4
4
  registerGenerator("arktype");
5
- //#endregion
6
5
  export {};
package/dist/bin/atlas.js CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as registerGenerator } from "../bin-BqUSO3tD.js";
3
- //#region src/bin/atlas.ts
2
+ import { t as registerGenerator } from "../bin-T1le3lMh.js";
3
+ // src/bin/atlas.ts
4
4
  registerGenerator("atlas");
5
- //#endregion
6
5
  export {};
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as registerGenerator } from "../bin-BqUSO3tD.js";
3
- //#region src/bin/django.ts
2
+ import { t as registerGenerator } from "../bin-T1le3lMh.js";
3
+ // src/bin/django.ts
4
4
  registerGenerator("django");
5
- //#endregion
6
5
  export {};
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as registerGenerator } from "../bin-BqUSO3tD.js";
3
- //#region src/bin/drizzle.ts
2
+ import { t as registerGenerator } from "../bin-T1le3lMh.js";
3
+ // src/bin/drizzle.ts
4
4
  registerGenerator("drizzle");
5
- //#endregion
6
5
  export {};
package/dist/bin/ecto.js CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as registerGenerator } from "../bin-BqUSO3tD.js";
3
- //#region src/bin/ecto.ts
2
+ import { t as registerGenerator } from "../bin-T1le3lMh.js";
3
+ // src/bin/ecto.ts
4
4
  registerGenerator("ecto");
5
- //#endregion
6
5
  export {};
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as registerGenerator } from "../bin-BqUSO3tD.js";
3
- //#region src/bin/efcore.ts
2
+ import { t as registerGenerator } from "../bin-T1le3lMh.js";
3
+ // src/bin/efcore.ts
4
4
  registerGenerator("efcore");
5
- //#endregion
6
5
  export {};
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as registerGenerator } from "../bin-BqUSO3tD.js";
3
- //#region src/bin/effect.ts
2
+ import { t as registerGenerator } from "../bin-T1le3lMh.js";
3
+ // src/bin/effect.ts
4
4
  registerGenerator("effect");
5
- //#endregion
6
5
  export {};
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as registerGenerator } from "../bin-BqUSO3tD.js";
3
- //#region src/bin/eloquent.ts
2
+ import { t as registerGenerator } from "../bin-T1le3lMh.js";
3
+ // src/bin/eloquent.ts
4
4
  registerGenerator("eloquent");
5
- //#endregion
6
5
  export {};
package/dist/bin/er.js CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as registerGenerator } from "../bin-BqUSO3tD.js";
3
- //#region src/bin/er.ts
2
+ import { t as registerGenerator } from "../bin-T1le3lMh.js";
3
+ // src/bin/er.ts
4
4
  registerGenerator("er");
5
- //#endregion
6
5
  export {};
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as registerGenerator } from "../bin-BqUSO3tD.js";
3
- //#region src/bin/exposed.ts
2
+ import { t as registerGenerator } from "../bin-T1le3lMh.js";
3
+ // src/bin/exposed.ts
4
4
  registerGenerator("exposed");
5
- //#endregion
6
5
  export {};
package/dist/bin/gorm.js CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as registerGenerator } from "../bin-BqUSO3tD.js";
3
- //#region src/bin/gorm.ts
2
+ import { t as registerGenerator } from "../bin-T1le3lMh.js";
3
+ // src/bin/gorm.ts
4
4
  registerGenerator("gorm");
5
- //#endregion
6
5
  export {};
@@ -1,14 +1,13 @@
1
1
  #!/usr/bin/env node
2
- import { s as readFile, t as exists } from "../file-BTbZL3ea.js";
2
+ import { s as readFile, t as exists } from "../file-BAVQ-zst.js";
3
3
  import { runMain } from "@effect/platform-node/NodeRuntime";
4
4
  import { layer } from "@effect/platform-node/NodeServices";
5
5
  import { Console, Data, Effect, Schema } from "effect";
6
6
  import path from "node:path";
7
7
  import { CliError, Command, Flag } from "effect/cli";
8
- //#region package.json
9
- var version = "0.39.0";
10
- //#endregion
11
- //#region src/schema/path.ts
8
+ // package.json
9
+ var version = "0.41.0";
10
+ // src/schema/path.ts
12
11
  /** Where Prisma looks for a schema when neither the command nor prisma.config.ts names one. */
13
12
  const DEFAULT_SCHEMA_PATHS = ["prisma/schema.prisma", "schema.prisma"];
14
13
  const CONFIG_EXTENSIONS = [
@@ -64,8 +63,7 @@ function prismaSchemaPath(dir) {
64
63
  return null;
65
64
  });
66
65
  }
67
- //#endregion
68
- //#region src/studio/server/constants/index.ts
66
+ // src/studio/server/constants/index.ts
69
67
  /** Studio only listens on loopback: the API serves the raw schema and runs SQL without authentication. */
70
68
  const STUDIO_HOSTNAME = "127.0.0.1";
71
69
  const DEFAULT_PORT = 5555;
@@ -76,8 +74,7 @@ const SSE_PING_MS = 15e3;
76
74
  const PRISMA_FILE_URI = "file:///schema.prisma";
77
75
  /** How often the migrations directory is read for a change. */
78
76
  const MIGRATIONS_POLL_MS = 1e3;
79
- //#endregion
80
- //#region src/studio/server/errors/index.ts
77
+ // src/studio/server/errors/index.ts
81
78
  var UnknownModelError = class extends Data.TaggedError("UnknownModelError") {};
82
79
  var UnknownFileError = class extends Data.TaggedError("UnknownFileError") {};
83
80
  var FileWriteError = class extends Data.TaggedError("FileWriteError") {};
@@ -87,12 +84,10 @@ var ClientUnavailableError = class extends Data.TaggedError("ClientUnavailableEr
87
84
  var ClientQueryError = class extends Data.TaggedError("ClientQueryError") {};
88
85
  var InvalidInputError = class extends Data.TaggedError("InvalidInputError") {};
89
86
  var FormatError = class extends Data.TaggedError("FormatError") {};
90
- var ContractViolationError = class extends Data.TaggedError("ContractViolationError") {};
91
87
  var SchemaLoadError = class extends Data.TaggedError("SchemaLoadError") {};
92
88
  var SchemaParseError = class extends Data.TaggedError("SchemaParseError") {};
93
89
  var ServerListenError = class extends Data.TaggedError("ServerListenError") {};
94
- //#endregion
95
- //#region src/cli/index.ts
90
+ // src/cli/index.ts
96
91
  const COMMAND_NAME = "hekireki";
97
92
  const STATIC_DIR = path.resolve(import.meta.dirname, "../studio");
98
93
  const DatabaseUrl = Schema.String.pipe(Schema.check(Schema.isPattern(/^(?:postgres|postgresql|mysql|file):/u, { message: "a postgres://, postgresql://, mysql:// or file: connection string" })));
@@ -140,7 +135,7 @@ const studioFlags = {
140
135
  function runStudio(args) {
141
136
  return Effect.gen(function* () {
142
137
  const schemaPath = yield* resolveSchemaPath(args.schema, [COMMAND_NAME, "studio"]);
143
- const { startStudioServer } = yield* Effect.promise(() => import("../start-AZKmzv5G.js"));
138
+ const { startStudioServer } = yield* Effect.promise(() => import("../start-C7m4KyUz.js"));
144
139
  const started = yield* startStudioServer({
145
140
  schemaPath,
146
141
  port: args.port,
@@ -188,7 +183,7 @@ const seedFlags = {
188
183
  };
189
184
  function runSeedCommand(args) {
190
185
  return Effect.gen(function* () {
191
- const { runSeed, seedBanner } = yield* Effect.promise(() => import("../run-C7QR2qhb.js"));
186
+ const { runSeed, seedBanner } = yield* Effect.promise(() => import("../run-BQlJs4wi.js"));
192
187
  const report = yield* runSeed(args, process.cwd()).pipe(Effect.mapError((error) => new CliError.UserError({ cause: error.message })));
193
188
  yield* Console.log(seedBanner(report));
194
189
  });
@@ -231,7 +226,7 @@ function runMigrateCheckCommand(args) {
231
226
  "migrate",
232
227
  "check"
233
228
  ]);
234
- const { checkBanner, checkJson, runMigrateCheck, summarize } = yield* Effect.promise(() => import("../migrate-BS2daXFS.js"));
229
+ const { checkBanner, checkJson, runMigrateCheck, summarize } = yield* Effect.promise(() => import("../migrate-2xlj7ayX.js"));
235
230
  const report = yield* runMigrateCheck({
236
231
  ...args,
237
232
  schemaPath,
@@ -278,7 +273,7 @@ function runMigratePlanCommand(args) {
278
273
  "migrate",
279
274
  "plan"
280
275
  ]);
281
- const { checkBanner, planSql, readMigration, runMigrateCheck, summarize, writePlan } = yield* Effect.promise(() => import("../migrate-BS2daXFS.js"));
276
+ const { checkBanner, planSql, readMigration, runMigrateCheck, summarize, writePlan } = yield* Effect.promise(() => import("../migrate-2xlj7ayX.js"));
282
277
  const report = yield* runMigrateCheck({
283
278
  ...args,
284
279
  schemaPath,
@@ -335,8 +330,6 @@ function cli() {
335
330
  function hekireki() {
336
331
  return Command.run(cli(), { version });
337
332
  }
338
- //#endregion
339
- //#region src/bin/hekireki.ts
333
+ // src/bin/hekireki.ts
340
334
  runMain(hekireki().pipe(Effect.provide(layer)));
341
- //#endregion
342
- export { SSE_PING_MS as _, DatabaseUnavailableError as a, prismaSchemaPath as b, InvalidInputError as c, ServerListenError as d, UnknownFileError as f, PRISMA_FILE_URI as g, MIGRATIONS_POLL_MS as h, DatabaseError as i, SchemaLoadError as l, FORBIDDEN_HOST_MESSAGE as m, ClientUnavailableError as n, FileWriteError as o, UnknownModelError as p, ContractViolationError as r, FormatError as s, ClientQueryError as t, SchemaParseError as u, STUDIO_HOSTNAME as v, readPrismaConfig as x, DEFAULT_SCHEMA_PATHS as y };
335
+ export { STUDIO_HOSTNAME as _, FileWriteError as a, readPrismaConfig as b, SchemaLoadError as c, UnknownFileError as d, UnknownModelError as f, SSE_PING_MS as g, PRISMA_FILE_URI as h, DatabaseUnavailableError as i, SchemaParseError as l, MIGRATIONS_POLL_MS as m, ClientUnavailableError as n, FormatError as o, FORBIDDEN_HOST_MESSAGE as p, DatabaseError as r, InvalidInputError as s, ClientQueryError as t, ServerListenError as u, DEFAULT_SCHEMA_PATHS as v, prismaSchemaPath as y };
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as registerGenerator } from "../bin-BqUSO3tD.js";
3
- //#region src/bin/kysely.ts
2
+ import { t as registerGenerator } from "../bin-T1le3lMh.js";
3
+ // src/bin/kysely.ts
4
4
  registerGenerator("kysely");
5
- //#endregion
6
5
  export {};
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ import { t as registerGenerator } from "../bin-T1le3lMh.js";
3
+ // src/bin/openapi.ts
4
+ registerGenerator("openapi");
5
+ export {};
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as registerGenerator } from "../bin-BqUSO3tD.js";
3
- //#region src/bin/pydantic.ts
2
+ import { t as registerGenerator } from "../bin-T1le3lMh.js";
3
+ // src/bin/pydantic.ts
4
4
  registerGenerator("pydantic");
5
- //#endregion
6
5
  export {};
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as registerGenerator } from "../bin-BqUSO3tD.js";
3
- //#region src/bin/sea-orm.ts
2
+ import { t as registerGenerator } from "../bin-T1le3lMh.js";
3
+ // src/bin/sea-orm.ts
4
4
  registerGenerator("sea-orm");
5
- //#endregion
6
5
  export {};
package/dist/bin/seed.js CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as registerGenerator } from "../bin-BqUSO3tD.js";
3
- //#region src/bin/seed.ts
2
+ import { t as registerGenerator } from "../bin-T1le3lMh.js";
3
+ // src/bin/seed.ts
4
4
  registerGenerator("seed");
5
- //#endregion
6
5
  export {};
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as registerGenerator } from "../bin-BqUSO3tD.js";
3
- //#region src/bin/sqlalchemy.ts
2
+ import { t as registerGenerator } from "../bin-T1le3lMh.js";
3
+ // src/bin/sqlalchemy.ts
4
4
  registerGenerator("sqlalchemy");
5
- //#endregion
6
5
  export {};
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as registerGenerator } from "../bin-BqUSO3tD.js";
3
- //#region src/bin/typebox.ts
2
+ import { t as registerGenerator } from "../bin-T1le3lMh.js";
3
+ // src/bin/typebox.ts
4
4
  registerGenerator("typebox");
5
- //#endregion
6
5
  export {};
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as registerGenerator } from "../bin-BqUSO3tD.js";
3
- //#region src/bin/valibot.ts
2
+ import { t as registerGenerator } from "../bin-T1le3lMh.js";
3
+ // src/bin/valibot.ts
4
4
  registerGenerator("valibot");
5
- //#endregion
6
5
  export {};
package/dist/bin/zod.js CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as registerGenerator } from "../bin-BqUSO3tD.js";
3
- //#region src/bin/zod.ts
2
+ import { t as registerGenerator } from "../bin-T1le3lMh.js";
3
+ // src/bin/zod.ts
4
4
  registerGenerator("zod");
5
- //#endregion
6
5
  export {};