usql Command Examples

Universal CLI interface for SQL databases. More information: https://github.com/xo/usql.

usql {{sqlserver|mysql|postgres|sqlite3|...}}://{{username}}:{{password}}@{{host}}:{{port}}/{{database_name}}

usql --file={{path/to/query.sql}}

usql --command="{{sql_command}}"

{{prompt}}=> {{command}}

{{prompt}}=> \d

{{prompt}}=> \g {{path/to/file_with_results}}

{{prompt}}=> \copy {{path/to/data.csv}} {{table_name}}