fix
This commit is contained in:
parent
36f795222a
commit
9434c4a188
|
|
@ -24,7 +24,6 @@ export const execQuery = async (args: DBArg, prisma: any) => {
|
||||||
mode: "field" | "relation";
|
mode: "field" | "relation";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
console.log(arg);
|
|
||||||
if (arg) {
|
if (arg) {
|
||||||
const { table, where, data } = arg;
|
const { table, where, data } = arg;
|
||||||
const mode = arg.mode || "field";
|
const mode = arg.mode || "field";
|
||||||
|
|
@ -32,8 +31,14 @@ export const execQuery = async (args: DBArg, prisma: any) => {
|
||||||
const transactions = [];
|
const transactions = [];
|
||||||
|
|
||||||
const schema_path = dir("app/db/prisma/schema.prisma");
|
const schema_path = dir("app/db/prisma/schema.prisma");
|
||||||
|
console.log("a", schema_path);
|
||||||
|
|
||||||
const schema = createPrismaSchemaBuilder(await readAsync(schema_path));
|
const schema = createPrismaSchemaBuilder(await readAsync(schema_path));
|
||||||
|
console.log("b");
|
||||||
|
|
||||||
const schema_table = schema.findByType("model", { name: table });
|
const schema_table = schema.findByType("model", { name: table });
|
||||||
|
|
||||||
|
console.log(schema_table);
|
||||||
const tables = schema
|
const tables = schema
|
||||||
.findAllByType("model", {})
|
.findAllByType("model", {})
|
||||||
.map((e) => e?.name) as string[];
|
.map((e) => e?.name) as string[];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue