@zenstackhq/cli 3.3.0-beta.3 → 3.3.0-beta.4
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/dist/index.cjs +16 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -10
- package/dist/index.js.map +1 -1
- package/package.json +11 -10
package/dist/index.js
CHANGED
|
@@ -226,7 +226,7 @@ function execPrisma(args, options) {
|
|
|
226
226
|
execPackage(`prisma ${args}`, _options);
|
|
227
227
|
return;
|
|
228
228
|
}
|
|
229
|
-
execSync(`node ${prismaPath} ${args}`, _options);
|
|
229
|
+
execSync(`node "${prismaPath}" ${args}`, _options);
|
|
230
230
|
}
|
|
231
231
|
__name(execPrisma, "execPrisma");
|
|
232
232
|
|
|
@@ -913,20 +913,23 @@ function handleSubProcessError2(err) {
|
|
|
913
913
|
__name(handleSubProcessError2, "handleSubProcessError");
|
|
914
914
|
|
|
915
915
|
// src/actions/proxy.ts
|
|
916
|
-
import { isDataSource as isDataSource2 } from "@zenstackhq/language/ast";
|
|
917
916
|
import { ZModelCodeGenerator } from "@zenstackhq/language";
|
|
917
|
+
import { isDataSource as isDataSource2 } from "@zenstackhq/language/ast";
|
|
918
918
|
import { getStringLiteral } from "@zenstackhq/language/utils";
|
|
919
|
-
import { SqliteDialect } from "@zenstackhq/orm/dialects/sqlite";
|
|
920
|
-
import { PostgresDialect } from "@zenstackhq/orm/dialects/postgres";
|
|
921
|
-
import SQLite from "better-sqlite3";
|
|
922
|
-
import { Pool } from "pg";
|
|
923
|
-
import path9 from "path";
|
|
924
919
|
import { ZenStackClient } from "@zenstackhq/orm";
|
|
920
|
+
import { MysqlDialect } from "@zenstackhq/orm/dialects/mysql";
|
|
921
|
+
import { PostgresDialect } from "@zenstackhq/orm/dialects/postgres";
|
|
922
|
+
import { SqliteDialect } from "@zenstackhq/orm/dialects/sqlite";
|
|
925
923
|
import { RPCApiHandler } from "@zenstackhq/server/api";
|
|
926
924
|
import { ZenStackMiddleware } from "@zenstackhq/server/express";
|
|
927
|
-
import
|
|
925
|
+
import SQLite from "better-sqlite3";
|
|
928
926
|
import colors9 from "colors";
|
|
927
|
+
import cors from "cors";
|
|
928
|
+
import express from "express";
|
|
929
929
|
import { createJiti as createJiti2 } from "jiti";
|
|
930
|
+
import { createPool as createMysqlPool } from "mysql2";
|
|
931
|
+
import path9 from "path";
|
|
932
|
+
import { Pool as PgPool } from "pg";
|
|
930
933
|
|
|
931
934
|
// src/utils/version-utils.ts
|
|
932
935
|
import colors8 from "colors";
|
|
@@ -977,7 +980,6 @@ async function getLatestVersion() {
|
|
|
977
980
|
__name(getLatestVersion, "getLatestVersion");
|
|
978
981
|
|
|
979
982
|
// src/actions/proxy.ts
|
|
980
|
-
import cors from "cors";
|
|
981
983
|
async function run9(options) {
|
|
982
984
|
const schemaFile = getSchemaFile(options.schema);
|
|
983
985
|
console.log(colors9.gray(`Loading ZModel schema from: ${schemaFile}`));
|
|
@@ -1056,10 +1058,15 @@ function createDialect(provider, databaseUrl, outputPath) {
|
|
|
1056
1058
|
case "postgresql":
|
|
1057
1059
|
console.log(colors9.gray(`Connecting to PostgreSQL database at: ${databaseUrl}`));
|
|
1058
1060
|
return new PostgresDialect({
|
|
1059
|
-
pool: new
|
|
1061
|
+
pool: new PgPool({
|
|
1060
1062
|
connectionString: databaseUrl
|
|
1061
1063
|
})
|
|
1062
1064
|
});
|
|
1065
|
+
case "mysql":
|
|
1066
|
+
console.log(colors9.gray(`Connecting to MySQL database at: ${databaseUrl}`));
|
|
1067
|
+
return new MysqlDialect({
|
|
1068
|
+
pool: createMysqlPool(databaseUrl)
|
|
1069
|
+
});
|
|
1063
1070
|
default:
|
|
1064
1071
|
throw new CliError(`Unsupported database provider: ${provider}`);
|
|
1065
1072
|
}
|