fix query

This commit is contained in:
Rizky 2024-06-25 15:02:55 +07:00
parent 3323a6d801
commit 0f828bccce
1 changed files with 2 additions and 1 deletions

View File

@ -225,7 +225,8 @@ export const execQuery = async (args: DBArg, prisma: any) => {
const schema = createPrismaSchemaBuilder(await readAsync(schema_path));
if (action === "schema_tables") {
const tables = schema.findAllByType("model", {}).map((e) => e?.name);
return tables || [];
const view = schema.findAllByType("view", {}).map((e) => e?.name);
return [...tables, ...view];
} else {
const schema_table = schema.findByType("model", { name: table });
const columns = {} as Record<