Skip to content

Commit 068f715

Browse files
committed
Include effect_patterns columns in db-table-check
1 parent 2b924e1 commit 068f715

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

  • packages/mcp-server/app/api/db-table-check

packages/mcp-server/app/api/db-table-check/route.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,25 @@ const handleDbTableCheck = Effect.fn("db-table-check")(function* (
2727
const result = yield* Effect.gen(function* () {
2828
const { db, close } = createDatabase(dbUrl);
2929
const count = yield* Effect.tryPromise(async () => {
30-
return await db.execute(sql`SELECT COUNT(*)::int as count FROM effect_patterns`);
30+
return await db.execute(
31+
sql`SELECT COUNT(*)::int as count FROM effect_patterns`
32+
);
33+
});
34+
const columns = yield* Effect.tryPromise(async () => {
35+
return await db.execute(sql`
36+
SELECT column_name, data_type
37+
FROM information_schema.columns
38+
WHERE table_schema = 'public' AND table_name = 'effect_patterns'
39+
ORDER BY ordinal_position
40+
`);
3141
});
3242
yield* Effect.promise(() => close());
3343
return count;
3444
});
3545

3646
return {
3747
success: true,
38-
result,
48+
result: { count, columns },
3949
};
4050
});
4151

0 commit comments

Comments
 (0)