| 123456789101112131415161718192021222324 |
- import 'dotenv/config';
- import { Pool } from 'pg';
- async function main() {
- const pool = new Pool({ connectionString: process.env.DATABASE_URL });
- try {
- const result = await pool.query(`
- SELECT column_name
- FROM information_schema.columns
- WHERE table_name = 'media'
- ORDER BY ordinal_position
- `);
- console.log(result.rows.map((row) => row.column_name).join('\n'));
- } finally {
- await pool.end();
- }
- }
- main().catch((error) => {
- console.error(error);
- process.exit(1);
- });
|