#!/bin/sh
export PGPASSWORD=PYnuOIXNbkVOvdTL
P="psql -h 127.0.0.1 -U bgar1_delta_com -d bgar1_delta_com_ingredi"
echo "== counts"
for t in account credential local_account saved_credentials api_account client_secret oauth_access_token saml_token endpoint; do printf '%-20s ' $t; $P -tA -c "select count(*) from $t" 2>&1; done
echo "== users sample"
$P -tA -F' | ' -c "select id,username,private_display_name,email_address,type,perm_admin,last_authenticated_date,password from users order by id limit 6" 2>&1 | cut -c1-260
echo "== account schema"
$P -tA -c "select column_name from information_schema.columns where table_name='account' order by ordinal_position" | tr '\n' ' '; echo
echo "== account rows"
$P -x -c "select * from account limit 3" 2>&1 | cut -c1-220 | head -50
