fix query
This commit is contained in:
parent
3323a6d801
commit
0f828bccce
|
|
@ -225,7 +225,8 @@ export const execQuery = async (args: DBArg, prisma: any) => {
|
||||||
const schema = createPrismaSchemaBuilder(await readAsync(schema_path));
|
const schema = createPrismaSchemaBuilder(await readAsync(schema_path));
|
||||||
if (action === "schema_tables") {
|
if (action === "schema_tables") {
|
||||||
const tables = schema.findAllByType("model", {}).map((e) => e?.name);
|
const tables = schema.findAllByType("model", {}).map((e) => e?.name);
|
||||||
return tables || [];
|
const view = schema.findAllByType("view", {}).map((e) => e?.name);
|
||||||
|
return [...tables, ...view];
|
||||||
} else {
|
} else {
|
||||||
const schema_table = schema.findByType("model", { name: table });
|
const schema_table = schema.findByType("model", { name: table });
|
||||||
const columns = {} as Record<
|
const columns = {} as Record<
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue