Command line interface for MSSQL that works in OSX and Linux. It also supports Azure SQL Data Warehouse. The package was heavily inspired by psql (PostgreSQL), sql-cli and sqlcmd (MSSQL).
The tool is under development, please use it with caution as it has no test coverage!
You have to install NodeJS (at least 5.6+) to use this package.
$ git clone https://github.com/wunderlist/cheetah.git $ cd cheetah $ npm install -gThe package is not available via npm at the moment.
It's quite simple.
Usage: cheetah [file] Options: -h, --help output usage information -V, --version output the version number -S, --server <server> server or hostname -p, --port <port> port -U, --username <user> login id -P, --password <password> password -d, --database <database> use database name -l, --login-timeout <logintimeout> login timeout -t, --query-timeout <querytimout> query timeout -I, --interactive interactive interface for query running --encrypt encrypt connection --timing print timing informations --verbose print statements for debugging You can also define a few environment variable if you don't want to specify these attributes everytime.
export MSSQL_HOST='host' export MSSQL_PORT='1433' export MSSQL_DATABASE='database' export MSSQL_USER='username' export MSSQL_PASSWORD='password' export MSSQL_ENCRYPT='true' # `true` for azureYou can execute files with the following commands:
$ cat query.sql | cheetah $ cheetah query.sqlDo not forget, you have to use the GO command to specify the batches!
Furthermore, you can specify the debugging settings within the file if you want.
-- cheetah/timing ON -- cheetah/verbose ONYou can start the interactive mode with the following command:
$ cheetah -IIt contains a few built-in commands inspired by psql.
Commands: \d Lists tables and views \dt Lists tables \dv Lists views \d TABLE Describes table schema \q Quit Other commands: \u Updates available suggestions You have to use the GO command when you want to execute your previous commands.
The package supports multi-line queries and copy-paste. Moreover it provides auto-complete like suggestions for tables and columns with the quoted form.
- Show affected rows' number.
Copyright © 2016, Microsoft
Distributed under the MIT License.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.