SQL(1) parallel SQL(1) (NAME) sql - dburl (SYNOPSIS) sql [options] dburl [commands] sql [options] dburl < commandfile #!/usr/bin/sql --shebang [options] dburl (DESCRIPTION) GNU sql . ( ) ( ) (queries) . DBURL . commands . GNU sql GNU parallel . dburl DBURL : [sql:]vendor:// [[user][:password]@][host][:port]/[database][?sqlquery] DBURL . commands SQL . (newline) . : "SELECT * FROM foo;" "SELECT * FROM bar;" '\n' '\x0a' : : "SELECT * FROM foo;\n SELECT * FROM bar;" SQL STDIN . : echo 'SELECT * FROM foo;' | sql mysql:/// --csv CSV. --db-size --dbsize . . Oracle dba_data_files - system . --help -h GNU sql . --html HTML. HTML. --json --pretty JSON (Pretty). --list-databases --listdbs --show-databases --showdbs ( / table spaces) . --listproc --proclist --show-processlist . --list-tables --show-tables --table-list . --noheaders --no-headers -n (). Oracle: . -p pass-through -p . -p . : '-U' : -p "-U scott" -p -U -p scott . --precision (timestamps). : rfc3339 h m s ms u ns. -r . --retries 3. --retries ntimes ntimes . . --retries 1 . --sep string -s string . string ..IP --skip-first-line 9 ( --shebang GNU sql ). --table-size --tablesize . . --verbose -v . --version -V GNU sql . --shebang -Y GNU sql (#!) . : #!/usr/bin/sql -Y mysql:/// SELECT * FROM foo; --shebang -Y . DBURL DBURL : [sql:]vendor:// [[user][:password]@][host][:port]/[database][?sqlquery] (%-encoding) http://tools.ietf.org/html/rfc3986#section-2.1 ( '/' '%2F' ). csv:///%2Ftmp%2Fparallel-bug-56096/mytable csv:////tmp/parallel-bug-56096/mytable mysql://me@/me/ mysql://// sqlite3:///%2Frun%2Fshm%2Fparallel.db sqlite3:///%2Frun%2Fshm%2Fparallel.db/table sqlite:///%2Ftmp%2Ffile.sqlite?SELECT csv:///%2Ftmp%2Fparallel-CSV/OK csv:///%2Fmust%2Ffail/fail sqlite3:///%2Frun%2Fshm%2Fparallel.db : mysql://scott:tiger@my.example.com/mydb influxdb://scott:tiger@influxdb.example.com/foo sql:oracle://scott:tiger@ora.example.com/xe postgresql://scott:tiger@pg.example.com/pgdb pg:/// postgresqlssl://scott@pg.example.com:3333/pgdb sql:sqlite2:////tmp/db.sqlite?SELECT * FROM foo; sqlite3:///../db.sqlite3?SELECT%20*%20FROM%20foo; : o MySQL (mysql) SSL (mysqls, mysqlssl) o Oracle (oracle, ora) o PostgreSQL (postgresql, pg, pgsql, postgres) SSL (postgresqlssl, pgs, pgsqlssl, postgresssl, pgssl, postgresqls, pgsqls, postgress) o SQLite2 (sqlite, sqlite2) o SQLite3 (sqlite3) o InfluxDB 1.x (influx, influxdb) SSL (influxdbssl, influxdbs, influxs, influxssl) ':' /etc/sql/aliases ~/.sql/aliases . ~/.sql/aliases . : :myalias1 pg://scott:tiger@pg.example.com/pgdb :myalias2 ora://scott:tiger@ora.example.com/xe # Short form of mysql://`whoami`:nopassword@localhost:3306/`whoami` :myalias3 mysql:/// # Short form of mysql://`whoami`:nopassword@localhost:33333/mydb :myalias4 mysql://:33333/mydb # Alias for an alias :m :myalias4 # the sortest alias possible : sqlite2:////tmp/db.sqlite # Including an SQL query :query sqlite:////tmp/db.sqlite?SELECT * FROM foo; (EXAMPLES) GNU sql : sql sql:oracle://scott:tiger@ora.example.com/xe : sql :myora.SS " " : sql :myalias "SELECT * FROM foo;" (Oracle) (newline) . : sql :myora "SELECT * FROM foo;" "SELECT * FROM bar;" : sql :myora "SELECT * FROM foo;\nSELECT * FROM bar;" PostgreSQL PostgreSQL pg_dump (dump) GNU sql (import) : pg_dump pg_database | sql pg://scott:tiger@pg.example.com/pgdb MySQL GNU parallel (drop) : sql -n mysql:/// 'show tables' | parallel sql mysql:/// DELETE FROM {}; PostgreSQL (drop) PostgreSQL : sql -n pg:/// '\dt' | parallel --colsep '\|' -r sql pg:/// DROP TABLE {2}; : sql mysql:/// < sqlfile sqlfile DBURL . demosql : #!/usr/bin/sql -Y mysql:/// SELECT * FROM foo; : chmod +x demosql; ./demosql --colsep --colsep GNU parallel : sql -s '\t' :myalias 'SELECT * FROM foo;' | parallel --colsep '\t' do_stuff {4} {1} --retries : sql --retries 5 :myalias 'SELECT * FROM really_big_foo;' : sql --db-size :myalias : sql --list-tables :myalias : sql --table-size :myalias : sql --show-processlist :myalias (REPORTING BUGS) GNU sql GNU parallel . . (AUTHOR) GNU sql : O. Tange (2011): GNU SQL - A Command Line Tool for Accessing Different Databases Using DBURLs, ;login: The USENIX Magazine, April 2011:29-32. Copyright (C) 2008-2010 Ole Tange http://ole.tange.dk Copyright (C) 2010-2026 Ole Tange, http://ole.tange.dk and Free Software Foundation, Inc. (LICENSE) << >> (GNU General Public License) ( ) . . << >> . << >> . . << >> (GNU Free Documentation License) / . LICENSES/GFDL-1.3-or-later.txt . : : ( ). . : . . : o o o . . cc-by-sa.txt ..SH " (DEPENDENCIES)" GNU sql Perl . mysql dburl MySQL . psql dburl PostgreSQL . sqlite dburl SQLite2 . sqlite3 dburl SQLite3 . sqlplus dburl Oracle . rlwrap GNU sql Oracle . (FILES) ~/.sql/aliases - DBURL /etc/sql/aliases - DBURL (SEE ALSO) mysql(1), psql(1), rlwrap(1), sqlite(1), sqlite3(1), sqlplus(1), influx(1) 20260722 2026-07-25 SQL(1)