citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

sql (218B)


      1 #!/usr/bin/env bash
      2 
      3 dosql() {
      4   local query="$1"
      5   local args=("-U" "$pg_user" -A)
      6   if [ ! -z "$query" ];
      7   then
      8     args+=(-c "$query")
      9   fi
     10   psql -F $'\t' "${args[@]}"
     11 }
     12 
     13 dosql "$@" | column -t -s $'\t' | less -S