From 0781cf1656572493118b6a8cdb4e7613da142f3e Mon Sep 17 00:00:00 2001 From: Vitor Henrique <87824454+vitorhcl@users.noreply.github.com> Date: Mon, 19 Feb 2024 11:34:37 -0300 Subject: [PATCH] usql: add page (#12275) * usql: add page --------- Co-authored-by: K.B.Dharun Krishna --- pages/common/usql.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 pages/common/usql.md diff --git a/pages/common/usql.md b/pages/common/usql.md new file mode 100644 index 0000000000..48c3614ed5 --- /dev/null +++ b/pages/common/usql.md @@ -0,0 +1,36 @@ +# usql + +> Universal CLI interface for SQL databases. +> More information: . + +- Connect to a specific database: + +`usql {{sqlserver|mysql|postgres|sqlite3|...}}://{{username}}:{{password}}@{{host}}:{{port}}/{{database_name}}` + +- Execute commands from a file: + +`usql --file={{path/to/query.sql}}` + +- Execute a specific SQL command: + +`usql --command="{{sql_command}}"` + +- List databases available on the server: + +`usql --list-databases` + +- Run an SQL command in the `usql` prompt: + +`{{prompt}}=> {{command}}` + +- Display the database schema: + +`{{prompt}}=> \d` + +- Export query results to a specific file: + +`{{prompt}}=> \g {{/path/to/results.txt}}` + +- Import data from a CSV file into a specific table: + +`{{prompt}}=> \copy {{/path/to/data.csv}} {{table_name}}`