JethroClient

JethroClient is a SQL command-line interface (CLI) offered by (and for) JethroServer. To run it, use the following command:

JethroClient instance_name connection_string -p password {options}

Connection String

The connection string is a list of one or more JethroServer network addresses, specified as host:port pairs. When specifying multiple JethroServer network addresses, they need to be separated by a semi-colon - and the entire connection string needs to be quoted (Specifying multiple addresses automatically enables client-side load balancing).

For example:

JethroClient demo localhost:9111 -p jethro

Or, if connecting to more than one host:

JethroClient demo "10.0.0.77:9111;10.0.0.88:9111" -p jethro

Command options

OptionDescription
-i <file>Execute all SQL queries provided in an input file (SQL delimiter is ;)
-o <file>Stores all output results into a specified file
-q <query>Execute a provided text query and exit
-u <user>User name (if not provided, user 'jethro' is assumed)
-p <password>Password
-cSwitch to CSV output mode
-d <char>

For CSV mode, change the columns delimiter to a specified character (Default is <,>)

--quietSuppress all informational messages
--no_headerDon't print result set header

Examples

JethroClient myinstance 127.0.0.1:9111 -u myuser -p mypass --quiet --no_header -q "select now();"
JethroClient demo localhost:9112 -p jethro -i db_test.sql -c -d '|' > db_test.csv
JethroClient demo localhost:9112 -p jethro -i db_test.sql -c -d '|' -o db_test.csv