hekireki 0.34.0 → 0.37.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/README.md +17 -17
- package/dist/bin/activerecord.js +1 -1
- package/dist/bin/ajv.js +1 -1
- package/dist/bin/arktype.js +1 -1
- package/dist/bin/atlas.js +1 -1
- package/dist/bin/django.js +1 -1
- package/dist/bin/drizzle.js +1 -1
- package/dist/bin/ecto.js +1 -1
- package/dist/bin/efcore.js +1 -1
- package/dist/bin/effect.js +1 -1
- package/dist/bin/eloquent.js +1 -1
- package/dist/bin/er.js +1 -1
- package/dist/bin/exposed.js +1 -1
- package/dist/bin/gorm.js +1 -1
- package/dist/bin/hekireki.js +80 -20
- package/dist/bin/kysely.js +1 -1
- package/dist/bin/pydantic.js +1 -1
- package/dist/bin/sea-orm.js +1 -1
- package/dist/bin/seed.js +1 -1
- package/dist/bin/sqlalchemy.js +1 -1
- package/dist/bin/typebox.js +1 -1
- package/dist/bin/valibot.js +1 -1
- package/dist/bin/zod.js +1 -1
- package/dist/{bin-B2PLRVJb.js → bin-CVN0pzc4.js} +412 -674
- package/dist/{discover-BNQ5gbRn.js → discover-CcuFW0ZA.js} +1 -1
- package/dist/{emit-BeblTVH8.js → emit-ALVe1wlq.js} +2 -2
- package/dist/{file-Df9ykHXv.js → file-BTbZL3ea.js} +12 -6
- package/dist/index.d.ts +1 -1
- package/dist/{migrate-Icu7Se0-.js → migrate-DmUsB0Wq.js} +4 -4
- package/dist/{plan-EKATG1WY.js → plan-FKGe6CzO.js} +8 -8
- package/dist/{utils-ckthTWS0.js → prisma-model-NuNLrPtP.js} +103 -11
- package/dist/{run-C13eFGuX.js → run-qU5ejzJJ.js} +17 -19
- package/dist/{schema-RYU_i7qd.js → schema-D8vxD4Kv.js} +3 -8
- package/dist/{sql-F40UQMF6.js → sql-BWRXT82c.js} +157 -78
- package/dist/{start-HLOLxRBL.js → start-DCHq_ac3.js} +57 -98
- package/dist/studio/assets/{chip-BasDLVHw.js → chip-DzylbrFL.js} +1 -1
- package/dist/studio/assets/{client-D-BDuDx5.js → client-Dntzxukj.js} +1 -1
- package/dist/studio/assets/{code-block-Bo0pcw3d.js → code-block-9KOaLIVF.js} +1 -1
- package/dist/studio/assets/{codicon-Brq4_Ui5.ttf → codicon-DF1abBS2.ttf} +0 -0
- package/dist/studio/assets/{confirm-dialog-GIPt_m1h.js → confirm-dialog-_tJslTz8.js} +1 -1
- package/dist/studio/assets/{copy-DVfEjDPw.js → copy-BU2HaQi8.js} +1 -1
- package/dist/studio/assets/{copy-button-Di-sHQ2O.js → copy-button-0vjAmGWM.js} +1 -1
- package/dist/studio/assets/{dist-CebhqUaX.js → dist-DZceSPCo.js} +1 -1
- package/dist/studio/assets/{docs-CnzWByuq.js → docs-CaVCv7nB.js} +1 -1
- package/dist/studio/assets/editor.worker-DWPaKKV_.js +33 -0
- package/dist/studio/assets/{enums._name-I0mP3WCt.js → enums._name-z71scSmR.js} +1 -1
- package/dist/studio/assets/{hooks-B5oExX5W.js → hooks-CIyp76Ha.js} +1 -1
- package/dist/studio/assets/{index-CMmzpMBz.js → index-BplvUeah.js} +7 -7
- package/dist/studio/assets/{labels-DuphOVul.js → labels-CxkkiH5p.js} +1 -1
- package/dist/studio/assets/{lazyRouteComponent-tS2t_LrD.js → lazyRouteComponent-HlW_UM7H.js} +1 -1
- package/dist/studio/assets/{lu-cVORv6D3.js → lu-C9ww8Xn7.js} +2 -2
- package/dist/studio/assets/{marked-text-tf7-IzXm.js → marked-text-DkIbIGaf.js} +1 -1
- package/dist/studio/assets/{models._name-DsOwcKoe.js → models._name-Bf8RXxTl.js} +1 -1
- package/dist/studio/assets/{monaco-GJe6VaZ-.js → monaco-B9PsjQQo.js} +1 -1
- package/dist/studio/assets/monaco-CT2wGeIj.css +1 -0
- package/dist/studio/assets/monaco-dYT_niNG.js +943 -0
- package/dist/studio/assets/{not-found-yBWFg0rP.js → not-found-4wswYq0J.js} +1 -1
- package/dist/studio/assets/{prisma-CWAhnzN5.js → prisma-BpS-GoYm.js} +1 -1
- package/dist/studio/assets/{result-table-CGvil3pc.js → result-table-DvGl9IoJ.js} +1 -1
- package/dist/studio/assets/routes-cRDXK5Bp.js +1 -0
- package/dist/studio/assets/{schema-gate-BC3i18Tp.js → schema-gate-BvdKOqn1.js} +1 -1
- package/dist/studio/assets/{schema-view-C2X5nwuH.js → schema-view-CqNyYGB0.js} +1 -1
- package/dist/studio/assets/{sql-CMRDYX3Z.js → sql-iadv3BWl.js} +1 -1
- package/dist/studio/assets/{table-bAwthXaP.js → table-DUjzf1P8.js} +1 -1
- package/dist/studio/assets/{tabs-DfoRK_ae.js → tabs-DJr-DjH8.js} +1 -1
- package/dist/studio/assets/{useFormValidation-B7STfHY3.js → useFormValidation-BB_6NZbP.js} +1 -1
- package/dist/studio/assets/{useMatch-DMTwaRaz.js → useMatch-CLknNl5M.js} +1 -1
- package/dist/studio/assets/{useMultipleSelectionState-vASeYbQk.js → useMultipleSelectionState-BqzE75CP.js} +1 -1
- package/dist/studio/assets/{useOverlayTriggerState-BO95y8NP.js → useOverlayTriggerState-DVeiBmOc.js} +1 -1
- package/dist/studio/index.html +10 -10
- package/package.json +19 -19
- package/dist/studio/assets/editor.worker-BbVB3hfz.js +0 -33
- package/dist/studio/assets/monaco-DbPgUJqj.js +0 -880
- package/dist/studio/assets/monaco-I0M_1p4d.css +0 -1
- package/dist/studio/assets/routes-CBvE-Puz.js +0 -1
package/README.md
CHANGED
|
@@ -26,22 +26,22 @@ generator Hekireki-Zod {
|
|
|
26
26
|
}
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
| Provider | Generates | Options
|
|
30
|
-
| --------------------------------------------------------------------------------------------- | ------------------------------------------------------- |
|
|
31
|
-
| `hekireki-zod` | [Zod](https://zod.dev/) | `type`, `
|
|
32
|
-
| `hekireki-valibot`, `hekireki-arktype`, `hekireki-effect`, `hekireki-typebox`, `hekireki-ajv` | Valibot, ArkType, Effect Schema, TypeBox, AJV | `type`, `
|
|
33
|
-
| `hekireki-pydantic` | Pydantic | `relation`
|
|
34
|
-
| `hekireki-drizzle`, `hekireki-kysely`, `hekireki-sqlalchemy`, `hekireki-django` | Drizzle, Kysely, SQLAlchemy, Django |
|
|
35
|
-
| `hekireki-activerecord` | Active Record | `locales`
|
|
36
|
-
| `hekireki-gorm` | GORM | `package`
|
|
37
|
-
| `hekireki-sea-orm` | SeaORM | `renameAll`
|
|
38
|
-
| `hekireki-ecto` | Ecto | `app`
|
|
39
|
-
| `hekireki-eloquent` | Eloquent | `namespace`
|
|
40
|
-
| `hekireki-efcore` (PostgreSQL, MySQL, SQLite) | EF Core | `namespace`, `context`
|
|
41
|
-
| `hekireki-exposed` (PostgreSQL) | Exposed | `package`, `dao`
|
|
42
|
-
| `hekireki-atlas` | Atlas HCL | `schemaName`
|
|
43
|
-
| `hekireki-er` | ER diagram | `outputs` (`.md`, `.dbml`, `.png`, `.svg`), `theme`
|
|
44
|
-
| `hekireki-seed` | The schema module `hekireki.config.ts` is typed against |
|
|
29
|
+
| Provider | Generates | Options |
|
|
30
|
+
| --------------------------------------------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------- |
|
|
31
|
+
| `hekireki-zod` | [Zod](https://zod.dev/) | `type`, `relation`, `zod` (`"v4"`, `"mini"`, `"@hono/zod-openapi"`) |
|
|
32
|
+
| `hekireki-valibot`, `hekireki-arktype`, `hekireki-effect`, `hekireki-typebox`, `hekireki-ajv` | Valibot, ArkType, Effect Schema, TypeBox, AJV | `type`, `relation` |
|
|
33
|
+
| `hekireki-pydantic` | Pydantic | `relation` |
|
|
34
|
+
| `hekireki-drizzle`, `hekireki-kysely`, `hekireki-sqlalchemy`, `hekireki-django` | Drizzle, Kysely, SQLAlchemy, Django | |
|
|
35
|
+
| `hekireki-activerecord` | Active Record | `locales` |
|
|
36
|
+
| `hekireki-gorm` | GORM | `package` |
|
|
37
|
+
| `hekireki-sea-orm` | SeaORM | `renameAll` |
|
|
38
|
+
| `hekireki-ecto` | Ecto | `app` |
|
|
39
|
+
| `hekireki-eloquent` | Eloquent | `namespace` |
|
|
40
|
+
| `hekireki-efcore` (PostgreSQL, MySQL, SQLite) | EF Core | `namespace`, `context` |
|
|
41
|
+
| `hekireki-exposed` (PostgreSQL) | Exposed | `package`, `dao` |
|
|
42
|
+
| `hekireki-atlas` | Atlas HCL | `schemaName` |
|
|
43
|
+
| `hekireki-er` | ER diagram | `outputs` (`.md`, `.dbml`, `.png`, `.svg`), `theme` |
|
|
44
|
+
| `hekireki-seed` | The schema module `hekireki.config.ts` is typed against | |
|
|
45
45
|
|
|
46
46
|
On MySQL, `hekireki-drizzle` reads and writes a `@db.Timestamp` column as UTC, and MySQL converts a
|
|
47
47
|
`TIMESTAMP` through the connection's `time_zone`: set it to `'+00:00'` on drizzle's connection, as
|
|
@@ -282,7 +282,7 @@ nothing and runs no hook, so what the types cannot say is the caller's:
|
|
|
282
282
|
## Studio
|
|
283
283
|
|
|
284
284
|
```bash
|
|
285
|
-
npx hekireki studio # ./prisma/schema.prisma or ./schema.prisma, port 5555
|
|
285
|
+
npx hekireki studio # `schema` of prisma.config.ts, else ./prisma/schema.prisma or ./schema.prisma, port 5555
|
|
286
286
|
npx hekireki studio --url file:./dev.db
|
|
287
287
|
```
|
|
288
288
|
|
package/dist/bin/activerecord.js
CHANGED
package/dist/bin/ajv.js
CHANGED
package/dist/bin/arktype.js
CHANGED
package/dist/bin/atlas.js
CHANGED
package/dist/bin/django.js
CHANGED
package/dist/bin/drizzle.js
CHANGED
package/dist/bin/ecto.js
CHANGED
package/dist/bin/efcore.js
CHANGED
package/dist/bin/effect.js
CHANGED
package/dist/bin/eloquent.js
CHANGED
package/dist/bin/er.js
CHANGED
package/dist/bin/exposed.js
CHANGED
package/dist/bin/gorm.js
CHANGED
package/dist/bin/hekireki.js
CHANGED
|
@@ -1,11 +1,69 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as exists } from "../file-
|
|
3
|
-
import {
|
|
2
|
+
import { s as readFile, t as exists } from "../file-BTbZL3ea.js";
|
|
3
|
+
import { runMain } from "@effect/platform-node/NodeRuntime";
|
|
4
|
+
import { layer } from "@effect/platform-node/NodeServices";
|
|
4
5
|
import { Console, Data, Effect, Schema } from "effect";
|
|
5
6
|
import path from "node:path";
|
|
6
|
-
import { CliError, Command, Flag } from "effect/
|
|
7
|
+
import { CliError, Command, Flag } from "effect/cli";
|
|
7
8
|
//#region package.json
|
|
8
|
-
var version = "0.
|
|
9
|
+
var version = "0.37.0";
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/schema/path.ts
|
|
12
|
+
/** Where Prisma looks for a schema when neither the command nor prisma.config.ts names one. */
|
|
13
|
+
const DEFAULT_SCHEMA_PATHS = ["prisma/schema.prisma", "schema.prisma"];
|
|
14
|
+
const CONFIG_EXTENSIONS = [
|
|
15
|
+
".js",
|
|
16
|
+
".ts",
|
|
17
|
+
".mjs",
|
|
18
|
+
".cjs",
|
|
19
|
+
".mts",
|
|
20
|
+
".cts"
|
|
21
|
+
];
|
|
22
|
+
const CONFIG_FILES = [
|
|
23
|
+
"prisma7.config",
|
|
24
|
+
path.join(".config", "prisma7"),
|
|
25
|
+
...[
|
|
26
|
+
"prisma.config",
|
|
27
|
+
path.join(".config", "prisma"),
|
|
28
|
+
path.join(".config", "prisma.config")
|
|
29
|
+
].flatMap((name) => [name, path.join(name, "index")])
|
|
30
|
+
].flatMap((base) => CONFIG_EXTENSIONS.map((extension) => `${base}${extension}`));
|
|
31
|
+
/** The Prisma config file of `dir` as Prisma finds it, with its text; null when there is none. */
|
|
32
|
+
function readPrismaConfig(dir) {
|
|
33
|
+
return Effect.gen(function* () {
|
|
34
|
+
for (const name of CONFIG_FILES) {
|
|
35
|
+
const file = path.join(dir, name);
|
|
36
|
+
const text = yield* readFile(file).pipe(Effect.orElseSucceed(() => null));
|
|
37
|
+
if (text !== null) return {
|
|
38
|
+
file,
|
|
39
|
+
text
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
return null;
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/** The `schema` of a Prisma config when it is written as a string; a computed path is not read. */
|
|
46
|
+
function configuredSchema(configText) {
|
|
47
|
+
return /\bschema\s*:\s*["'`]([^"'`]+)["'`]/u.exec(configText)?.[1] ?? null;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The schema Prisma reads in `dir` when the command names none: the `schema` of the Prisma config
|
|
51
|
+
* there, from the config file's own directory as Prisma resolves it, whether or not it exists (so
|
|
52
|
+
* a wrong one is named rather than passed over), else the first default path that exists; null
|
|
53
|
+
* when there is neither.
|
|
54
|
+
*/
|
|
55
|
+
function prismaSchemaPath(dir) {
|
|
56
|
+
return Effect.gen(function* () {
|
|
57
|
+
const config = yield* readPrismaConfig(dir);
|
|
58
|
+
const configured = config === null ? null : configuredSchema(config.text);
|
|
59
|
+
if (config !== null && configured !== null) return path.isAbsolute(configured) ? configured : path.join(path.dirname(config.file), configured);
|
|
60
|
+
for (const candidate of DEFAULT_SCHEMA_PATHS) {
|
|
61
|
+
const resolved = path.join(dir, candidate);
|
|
62
|
+
if (yield* exists(resolved)) return resolved;
|
|
63
|
+
}
|
|
64
|
+
return null;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
9
67
|
//#endregion
|
|
10
68
|
//#region src/studio/server/constants/index.ts
|
|
11
69
|
/** Studio only listens on loopback: the API serves the raw schema and runs SQL without authentication. */
|
|
@@ -36,12 +94,11 @@ var ServerListenError = class extends Data.TaggedError("ServerListenError") {};
|
|
|
36
94
|
//#endregion
|
|
37
95
|
//#region src/cli/index.ts
|
|
38
96
|
const COMMAND_NAME = "hekireki";
|
|
39
|
-
/** Where `--schema` looks when it is omitted, in order. */
|
|
40
|
-
const DEFAULT_SCHEMA_PATHS = ["prisma/schema.prisma", "schema.prisma"];
|
|
41
97
|
const STATIC_DIR = path.resolve(import.meta.dirname, "../studio");
|
|
42
98
|
const DatabaseUrl = Schema.String.pipe(Schema.check(Schema.isPattern(/^(?:postgres|postgresql|mysql|file):/u, { message: "a postgres://, postgresql://, mysql:// or file: connection string" })));
|
|
43
99
|
/**
|
|
44
|
-
* The explicit schema when it exists, else the
|
|
100
|
+
* The explicit schema when it exists, else the one Prisma itself reads: the `schema` of
|
|
101
|
+
* prisma.config.ts, then the first default path that exists.
|
|
45
102
|
*
|
|
46
103
|
* A path that was typed out and is not there names itself, and the usage block would only bury
|
|
47
104
|
* it. Nothing typed and nothing found is the other case — the command was run somewhere without
|
|
@@ -53,10 +110,11 @@ function resolveSchemaPath(explicit, commandPath) {
|
|
|
53
110
|
if (yield* exists(explicit)) return explicit;
|
|
54
111
|
return yield* new CliError.UserError({ cause: `Schema not found: ${explicit}\n Check the path passed to --schema.` });
|
|
55
112
|
}
|
|
56
|
-
|
|
113
|
+
const found = yield* prismaSchemaPath(".");
|
|
114
|
+
if (found !== null) return found;
|
|
57
115
|
return yield* new CliError.ShowHelp({
|
|
58
116
|
commandPath: [...commandPath],
|
|
59
|
-
errors: [new CliError.UserError({ cause: `No Prisma schema found (looked for ${DEFAULT_SCHEMA_PATHS.join(", ")}).\n Pass --schema <path> to point at your schema.prisma or a directory of .prisma files.` })]
|
|
117
|
+
errors: [new CliError.UserError({ cause: `No Prisma schema found (looked for \`schema\` in prisma.config.ts, then ${DEFAULT_SCHEMA_PATHS.join(", ")}).\n Pass --schema <path> to point at your schema.prisma or a directory of .prisma files.` })]
|
|
60
118
|
});
|
|
61
119
|
});
|
|
62
120
|
}
|
|
@@ -72,15 +130,17 @@ const Port = Schema.Int.check(Schema.isBetween({
|
|
|
72
130
|
minimum: 1,
|
|
73
131
|
maximum: 65535
|
|
74
132
|
}));
|
|
133
|
+
const RowCount = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));
|
|
134
|
+
const Milliseconds = Schema.Int.check(Schema.isGreaterThanOrEqualTo(1));
|
|
75
135
|
const studioFlags = {
|
|
76
136
|
port: Flag.Int("port").pipe(Flag.withAlias("p"), Flag.withSchema(Port), Flag.withDescription(`Port to listen on (default: ${DEFAULT_PORT})`), Flag.withMetavar("port"), Flag.withDefault(DEFAULT_PORT)),
|
|
77
|
-
schema: Flag.String("schema").pipe(Flag.withAlias("s"), Flag.withDescription(`Path to schema.prisma or a directory of .prisma files (default: ${DEFAULT_SCHEMA_PATHS.join(", then ")})`), Flag.withMetavar("schema.prisma|dir"), Flag.withDefault(null)),
|
|
137
|
+
schema: Flag.String("schema").pipe(Flag.withAlias("s"), Flag.withDescription(`Path to schema.prisma or a directory of .prisma files (default: \`schema\` in prisma.config.ts, then ${DEFAULT_SCHEMA_PATHS.join(", then ")})`), Flag.withMetavar("schema.prisma|dir"), Flag.withDefault(null)),
|
|
78
138
|
url: Flag.String("url").pipe(Flag.withAlias("u"), Flag.withSchema(DatabaseUrl), Flag.withDescription("Database connection URL for browsing and editing data (default: `url` in hekireki.config.ts, then the variable datasource.url names in prisma.config.ts or the schema, read from the environment or .env; DATABASE_URL when it names none)"), Flag.withMetavar("connection-string"), Flag.withDefault(null))
|
|
79
139
|
};
|
|
80
140
|
function runStudio(args) {
|
|
81
141
|
return Effect.gen(function* () {
|
|
82
142
|
const schemaPath = yield* resolveSchemaPath(args.schema, [COMMAND_NAME, "studio"]);
|
|
83
|
-
const { startStudioServer } = yield* Effect.promise(() => import("../start-
|
|
143
|
+
const { startStudioServer } = yield* Effect.promise(() => import("../start-DCHq_ac3.js"));
|
|
84
144
|
const started = yield* startStudioServer({
|
|
85
145
|
schemaPath,
|
|
86
146
|
port: args.port,
|
|
@@ -118,17 +178,17 @@ function studio() {
|
|
|
118
178
|
}
|
|
119
179
|
const seedFlags = {
|
|
120
180
|
config: Flag.String("config").pipe(Flag.withAlias("c"), Flag.withDescription("Path to the config, a TypeScript file (default: hekireki.config.ts in the working directory)"), Flag.withMetavar("hekireki.config.ts"), Flag.withDefault(null)),
|
|
121
|
-
schema: Flag.String("schema").pipe(Flag.withAlias("s"), Flag.withDescription(`Path to schema.prisma or a directory of .prisma files (default: \`schema\` in
|
|
181
|
+
schema: Flag.String("schema").pipe(Flag.withAlias("s"), Flag.withDescription(`Path to schema.prisma or a directory of .prisma files (default: \`schema\` in hekireki.config.ts, then \`schema\` in prisma.config.ts, then ${DEFAULT_SCHEMA_PATHS.join(", then ")})`), Flag.withMetavar("schema.prisma|dir"), Flag.withDefault(null)),
|
|
122
182
|
url: Flag.String("url").pipe(Flag.withAlias("u"), Flag.withSchema(DatabaseUrl), Flag.withDescription("Database connection URL to insert into (default: `url` in hekireki.config.ts, then the variable datasource.url names in prisma.config.ts or the schema, read from the environment or .env; DATABASE_URL when it names none)"), Flag.withMetavar("connection-string"), Flag.withDefault(null)),
|
|
123
183
|
output: Flag.String("sql").pipe(Flag.withDescription("Write the rows to this SQL file instead of inserting them"), Flag.withMetavar("seed.sql"), Flag.withDefault(null)),
|
|
124
184
|
seed: Flag.Int("seed").pipe(Flag.withDescription("The faker seed; the same seed always gives the same rows (left out: every run differs)"), Flag.withMetavar("n"), Flag.withDefault(null)),
|
|
125
|
-
count: Flag.Int("count").pipe(Flag.withAlias("n"), Flag.withDescription("Rows for every faker model, over the per-model counts of the config; models given as data keep their rows (left out: the config decides, and only the configured models are seeded)"), Flag.withMetavar("rows"), Flag.withDefault(null)),
|
|
185
|
+
count: Flag.Int("count").pipe(Flag.withAlias("n"), Flag.withSchema(RowCount), Flag.withDescription("Rows for every faker model, over the per-model counts of the config; models given as data keep their rows (left out: the config decides, and only the configured models are seeded)"), Flag.withMetavar("rows"), Flag.withDefault(null)),
|
|
126
186
|
locale: Flag.String("locale").pipe(Flag.withAlias("l"), Flag.withDescription("Faker locale, or a comma-separated list tried in order (left out: faker's English)"), Flag.withMetavar("ja,en"), Flag.withDefault(null)),
|
|
127
187
|
reset: Flag.Boolean("reset").pipe(Flag.withDescription("Delete every row of the seeded tables before inserting"), Flag.withDefault(false))
|
|
128
188
|
};
|
|
129
189
|
function runSeedCommand(args) {
|
|
130
190
|
return Effect.gen(function* () {
|
|
131
|
-
const { runSeed, seedBanner } = yield* Effect.promise(() => import("../run-
|
|
191
|
+
const { runSeed, seedBanner } = yield* Effect.promise(() => import("../run-qU5ejzJJ.js"));
|
|
132
192
|
const report = yield* runSeed(args, process.cwd()).pipe(Effect.mapError((error) => new CliError.UserError({ cause: error.message })));
|
|
133
193
|
yield* Console.log(seedBanner(report));
|
|
134
194
|
});
|
|
@@ -154,10 +214,10 @@ function seed() {
|
|
|
154
214
|
]));
|
|
155
215
|
}
|
|
156
216
|
const migrateCheckFlags = {
|
|
157
|
-
schema: Flag.String("schema").pipe(Flag.withAlias("s"), Flag.withDescription(`Path to the schema about to be migrated: schema.prisma or a directory of .prisma files (default: ${DEFAULT_SCHEMA_PATHS.join(", then ")})`), Flag.withMetavar("schema.prisma|dir"), Flag.withDefault(null)),
|
|
217
|
+
schema: Flag.String("schema").pipe(Flag.withAlias("s"), Flag.withDescription(`Path to the schema about to be migrated: schema.prisma or a directory of .prisma files (default: \`schema\` in prisma.config.ts, then ${DEFAULT_SCHEMA_PATHS.join(", then ")})`), Flag.withMetavar("schema.prisma|dir"), Flag.withDefault(null)),
|
|
158
218
|
url: Flag.String("url").pipe(Flag.withAlias("u"), Flag.withSchema(DatabaseUrl), Flag.withDescription("Database connection URL to check, read only (default: `url` in hekireki.config.ts, then the variable datasource.url names in prisma.config.ts or the schema, read from the environment or .env; DATABASE_URL when it names none)"), Flag.withMetavar("connection-string"), Flag.withDefault(null)),
|
|
159
219
|
decisions: Flag.String("decisions").pipe(Flag.withAlias("d"), Flag.withDescription("Path to the decisions made on the Migrate page of `hekireki studio`: what becomes of the rows that stand in the way (default: .hekireki/migrate.json beside the schema)"), Flag.withMetavar("migrate.json"), Flag.withDefault(null)),
|
|
160
|
-
timeout: Flag.Int("timeout").pipe(Flag.withDescription("How long one query may run, in milliseconds, on PostgreSQL and MySQL (default: no limit)"), Flag.withMetavar("ms"), Flag.withDefault(null)),
|
|
220
|
+
timeout: Flag.Int("timeout").pipe(Flag.withSchema(Milliseconds), Flag.withDescription("How long one query may run, in milliseconds, on PostgreSQL and MySQL (default: no limit)"), Flag.withMetavar("ms"), Flag.withDefault(null)),
|
|
161
221
|
json: Flag.Boolean("json").pipe(Flag.withDescription("Print the report as JSON, every check with its count and SQL"), Flag.withDefault(false))
|
|
162
222
|
};
|
|
163
223
|
/** Why the data is not ready, as the command fails with it. */
|
|
@@ -171,7 +231,7 @@ function runMigrateCheckCommand(args) {
|
|
|
171
231
|
"migrate",
|
|
172
232
|
"check"
|
|
173
233
|
]);
|
|
174
|
-
const { checkBanner, checkJson, runMigrateCheck, summarize } = yield* Effect.promise(() => import("../migrate-
|
|
234
|
+
const { checkBanner, checkJson, runMigrateCheck, summarize } = yield* Effect.promise(() => import("../migrate-DmUsB0Wq.js"));
|
|
175
235
|
const report = yield* runMigrateCheck({
|
|
176
236
|
...args,
|
|
177
237
|
schemaPath,
|
|
@@ -218,7 +278,7 @@ function runMigratePlanCommand(args) {
|
|
|
218
278
|
"migrate",
|
|
219
279
|
"plan"
|
|
220
280
|
]);
|
|
221
|
-
const { checkBanner, planSql, readMigration, runMigrateCheck, summarize, writePlan } = yield* Effect.promise(() => import("../migrate-
|
|
281
|
+
const { checkBanner, planSql, readMigration, runMigrateCheck, summarize, writePlan } = yield* Effect.promise(() => import("../migrate-DmUsB0Wq.js"));
|
|
222
282
|
const report = yield* runMigrateCheck({
|
|
223
283
|
...args,
|
|
224
284
|
schemaPath,
|
|
@@ -277,6 +337,6 @@ function hekireki() {
|
|
|
277
337
|
}
|
|
278
338
|
//#endregion
|
|
279
339
|
//#region src/bin/hekireki.ts
|
|
280
|
-
|
|
340
|
+
runMain(hekireki().pipe(Effect.provide(layer)));
|
|
281
341
|
//#endregion
|
|
282
|
-
export { SSE_PING_MS as _, DatabaseUnavailableError as a, 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 };
|
|
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 };
|
package/dist/bin/kysely.js
CHANGED
package/dist/bin/pydantic.js
CHANGED
package/dist/bin/sea-orm.js
CHANGED
package/dist/bin/seed.js
CHANGED
package/dist/bin/sqlalchemy.js
CHANGED
package/dist/bin/typebox.js
CHANGED
package/dist/bin/valibot.js
CHANGED
package/dist/bin/zod.js
CHANGED