File tree Expand file tree Collapse file tree
packages/mcp-server/app/api/db-table-check Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments