mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-22 21:46:43 +02:00
style: auto-format codebase with Prettier
Applied formatting to 1487+ files using pnpm format:write - TypeScript/JavaScript files - Svelte components - Astro pages - JSON configs - Markdown docs 13 files still need manual review (Astro JSX comments)
This commit is contained in:
parent
0241f5554c
commit
d36b321d9d
3952 changed files with 661498 additions and 739751 deletions
|
|
@ -6,39 +6,39 @@
|
|||
import { getDb, closeDb, sql } from './client.js';
|
||||
|
||||
async function testConnection() {
|
||||
console.log('Testing database connection...\n');
|
||||
console.log('Testing database connection...\n');
|
||||
|
||||
try {
|
||||
const db = getDb();
|
||||
try {
|
||||
const db = getDb();
|
||||
|
||||
// Test basic connection
|
||||
const result = await db.execute(sql`SELECT NOW() as current_time, version() as pg_version`);
|
||||
console.log('✅ Connection successful!');
|
||||
console.log(` Time: ${result[0].current_time}`);
|
||||
console.log(` PostgreSQL: ${result[0].pg_version}\n`);
|
||||
// Test basic connection
|
||||
const result = await db.execute(sql`SELECT NOW() as current_time, version() as pg_version`);
|
||||
console.log('✅ Connection successful!');
|
||||
console.log(` Time: ${result[0].current_time}`);
|
||||
console.log(` PostgreSQL: ${result[0].pg_version}\n`);
|
||||
|
||||
// List tables
|
||||
const tables = await db.execute(sql`
|
||||
// List tables
|
||||
const tables = await db.execute(sql`
|
||||
SELECT tablename
|
||||
FROM pg_tables
|
||||
WHERE schemaname = 'public'
|
||||
ORDER BY tablename
|
||||
`);
|
||||
|
||||
if (tables.length > 0) {
|
||||
console.log('📋 Tables in database:');
|
||||
tables.forEach((t: any) => console.log(` - ${t.tablename}`));
|
||||
} else {
|
||||
console.log('📋 No tables found. Run "pnpm db:push" to create schema.');
|
||||
}
|
||||
if (tables.length > 0) {
|
||||
console.log('📋 Tables in database:');
|
||||
tables.forEach((t: any) => console.log(` - ${t.tablename}`));
|
||||
} else {
|
||||
console.log('📋 No tables found. Run "pnpm db:push" to create schema.');
|
||||
}
|
||||
|
||||
console.log('\n✅ All tests passed!');
|
||||
} catch (error) {
|
||||
console.error('❌ Connection failed:', error);
|
||||
process.exit(1);
|
||||
} finally {
|
||||
await closeDb();
|
||||
}
|
||||
console.log('\n✅ All tests passed!');
|
||||
} catch (error) {
|
||||
console.error('❌ Connection failed:', error);
|
||||
process.exit(1);
|
||||
} finally {
|
||||
await closeDb();
|
||||
}
|
||||
}
|
||||
|
||||
testConnection();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue