#!/bin/bash
cd /var/www/sneakerpicks

# Test with postgres user
node -e "
const pg = require('pg');
const pool = new pg.Pool({ connectionString: 'postgresql://postgres:postgres@172.18.0.5:5432/sneakerpicks' });
pool.query('SELECT COUNT(*) FROM products').then(r => console.log('postgres user - Products:', r.rows[0].count)).catch(e => console.error('postgres user Error:', e.message)).finally(() => pool.end());
"

# Test with current env
node -e "
const pg = require('pg');
const pool = new pg.Pool({ connectionString: process.env.DATABASE_URL });
pool.query('SELECT COUNT(*) FROM products').then(r => console.log('env user - Products:', r.rows[0].count)).catch(e => console.error('env user Error:', e.message)).finally(() => pool.end());
"

# Check what port supabase is on
docker ps | grep supabase-db
