- uses \G at end of sql query, resulting in line-formated output (at least for mysql)
@@ -983,6 +983,15 @@ db_ops() {
QUERY="select * FROM $1;"
$DBROCMD "$QUERY"
;;
+ showg)
+ shift
+ if [ $# -ne 1 ] ; then
+ merr "missing table parameter"
+ exit 1
+ fi
+ QUERY="select * FROM $1\\G;"
+ $DBROCMD "$QUERY"
+ ;;
*)
usage_db_ops
exit 1
@@ -60,6 +60,7 @@ cat <<EOF
db rorun <id> ....................... execute read-only SQL query from
\$id variable
db show <table> ..................... display table content
+ db showg <table> .................... display formatted table content
EOF
}
USAGE_FUNCTIONS="$USAGE_FUNCTIONS usage_db_ops"