-
-
Save lukeledet/4bfeca0a5cf963a2caed929719b7185b to your computer and use it in GitHub Desktop.
Format SQL results for a Google spreadsheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Pipe SQL commands to this command to get them in a format ready for a Google Spreadsheet | |
DB=${1-$USER} | |
shift | |
QUERY=$(cat <&0) | |
psql --field-separator=$'\t' --no-align --pset=footer=off -c "$QUERY" "$@" $DB |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment