sqlc
sqlc is a terminal-based front-end to SQLite Cloud written in GO. It enables you to type in queries interactively, issue them to SQLite Cloud, and see the query results. Alternatively, input can be from a file or from command line arguments.
In addition, sqlc provides various shell-like features to facilitate writing scripts and automating a wide variety of tasks.
URL Connection String
An easy way to obtain a valid connection string is to click on the node address in the Dashboard Nodes section. A valid connection string will be copied in your clipboard.
Options
> ./sqlc --help
Usage:
sqlc [URL] [options] [<FILE>...]
sqlc -?|--help|--version
Arguments:
URL "sqlitecloud://user:pass@host.com:port/dbname?timeout=10&compress=NO"
FILE... Execute SQL commands from FILE(s) after connecting to the SQLite Cloud database
Examples:
sqlc "sqlitecloud://user:pass@host.com:8860/dbname?timeout=10&compress=lz4&tls=intern"
sqlc --host hostname -u user --password=pass -d dbname -c LZ4 --tls=no
sqlc --version
sqlc -?
General Options:
--cmd COMMAND Run "COMMAND" before executing FILE... or reading from stdin
-l, --list List available databases, then exit
-d, --dbname NAME Use database NAME
-b, --bail Stop after hitting an error
-?, --help Show this screen
--version Display version information
Output Format Options:
-o, --output FILE Switch to BATCH mode, execute SQL Commands and send output to FILE, then exit.
In BATCH mode, the default output format is switched to QUOTE.
--echo Disables --quiet, print command(s) before execution
--quiet Disables --echo, run command(s) quietly (no messages, only query output)
--noheader Turn headers off
--nullvalue TEXT Set text string for NULL values [default: "NULL"]
--newline SEP Set output row separator [default: "\r\n"]
--separator SEP Set output column separator [default: "|"]
--format (LIST|CSV|QUOTE|TABS|LINE|JSON|HTML|XML|MARKDOWN|TABLE|BOX)
Specify the Output mode [default: BOX]
Connection Options:
-h, --host HOSTNAME Connect to SQLite Cloud database server host name [default: localhost]
-p, --port PORT Use specified port to connect to SQLIte Cloud database server [default: 8860]
-u, --user USERNAME Use USERNAME for authentication
-w, --password PASSWORD Use PASSWORD for authentication
-t, --timeout SECS Set Timeout for network operations to SECS seconds [default: 10]
-c, --compress (NO|LZ4) Use line compression [default: NO]
--tls [YES|NO|INTERN|FILE] Encrypt the database connection using the host's root CA set (YES), a custom CA with a PEM from FILE (FILE), the internal SQLiteCloud CA (INTERN), or disable the encryption (NO) [default: YES]