Options (2)
-f, --filebooleanExecute commands from a file
Example:
usql {{[-f|--file]}} {{path/to/query.sql}}-c, --commandbooleanExecute a specific SQL command
Example:
usql {{[-c|--command]}} "{{sql_command}}"Examples (7)
Connect to a specific database
usql sqlserver|mysql|postgres|sqlite3|...://username:password@host:port/database_nameExecute commands from a file
usql [-f|--file] path/to/query.sqlExecute a specific SQL command
usql [-c|--command] "sql_command"[Interactive] Run an SQL command in the `usql` prompt
[Interactive] Display the database schema
\d[Interactive] Export query results to a specific file
\g path/to/file_with_results[Interactive] Import data from a CSV file into a specific table
\copy path/to/data.csv table_namemade by @shridhargupta | data from tldr-pages