import { pgQuery, getPgPool } from '../lib/postgres/client';

async function main() {
  const query = "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public' AND (table_name LIKE 'expense_%' OR table_name LIKE 'recurring_%') ORDER BY table_name;";
  const result = await pgQuery<{ table_name: string }>(query);
  console.log(JSON.stringify(result.rows, null, 2));
}

main()
  .catch((error) => {
    console.error(error);
    process.exitCode = 1;
  })
  .finally(async () => {
    await getPgPool().end();
  });
