sql-cli v0.4.0 Released

I just released the v0.4.0 of sql-cli on npm. It has following new features:

  • .run command: Execute the file as a sql script
  • .read command and cli now supports running multi-line commands by putting a backslash before pressing return.

Feel free to share feedback or fork and send pull requests.

Squiggle 3.4 Beta released

I’m glad to announce the Squiggle 3.4 release today. You can get it from codeplex release page. This is mainly a maintenance release as the main update in this release is fewer and updated dependencies.

Earlier version of Squiggle had 2 dependencies zeromq and SQL Server CE that caused installation problems for many people. It was also built using an older version of .NET Framework that many people had to download and install. With version 3.4 release of Squiggle, I’ve switched to a 100% managed implementation of zeromq protocol and SQLite as the database for tracking history. It is built using latest .NET Framework 4.5.1.

I’ve also updated the MSI setup to install Squiggle in AppData folder instead of ProgramFiles(x86) so hopefully it should also help in reducing permission related problems in running plugins and sharing files.

My initial testing shows that it works fine on Windows 8.1. You may try it out and report any bugs on our issues page.

sql-cli v0.3.0 Released

I just released the v0.3.0 of sql-cli on npm. It has following new features:

.analyze command: Lists all the missing indexes on a table. Works only on actively used databases.
.read command: Allows you to run a sql script file in the cli
-config argument: Allows you to specify a json config file to read connection information from

Feel free to share feedback or fork and send pull requests on github.

sql-cli v0.1.0 Released

I just released the v0.1.0 of sql-cli on npm. It has following new features:

  • .index command: Lists all the indexes on a table
  • .schema command: Now tells you whether column is indexed or not
  • New output format switch -f: Now you can export your query results as json, xml or csv

I also fixed a few formatting/output related issues and improved the .schema and .tables queries. Feel free to share feedback or fork and send pull requests.

Introducing sql-cli: a Nodejs Command-line Interface for Sql Server

SQL Server used to be a database that was only used by Windows users in the past and so not much effort has been put in to making tools like SQL Server Managed Studio and sqlcmd available for linux and mac users. However with advent of cloud and hosted databases, it doesn’t matter much what OS the database is hosted on; as long as you can connect to the database from variety of platforms. This is true for SQL Azure which is now used by many mac and linux users directly or indirectly (via Azure Mobile Services). However due to lack of good tools to manage the database, users have been forced to use browser based tools or using Windows tools from inside a virtual machine. However this is now going to change.

Today I’m pleased to announce sql-cli: A cross platform command line interface to SQL Server written in nodejs. Without further ado let’s see how you can use it.


You can install sql-cli simply by running the following command.

npm install -g sql-cli

Alternatively you can clone the git repository

git clone https://github.com/hasankhan/sql-cli.git
cd sql-cli
npm install -g

Get Started

Once installed you get a new ‘mssql’ command in your environment. Running it without arguments will give show you the following:

  Usage: mssql [options]


    -h, --help                     output usage information
    -V, --version                  output the version number
    -s, --server [server]          Server to conect to
    -u, --user [user]              User name to use for authentication
    -p, --pass [pass]              Password to use for authentication
    -o, --port [port]              Port to connect to
    -t, --timeout [timeout]        Connection timeout in ms
    -d, --database [database]      Database to connect to
    -v, --tdsVersion [tdsVersion]  Version of tds protocol to use
    -e, --encrypt                  Enable encryption

To connect to a sql server instance invoke mssql as follows

mssql -s localhost -u user -p pass -d dbname

For SQL Azure you have to enable encryption and add server name in username

mssql -s abcdef.database.windows.net -u username@abcdef -p thepassword -d mydatabase -e

Once connected you’re greeted with a prompt as follows:

Connecting to localhost...done

sql-cli version 0.0.6
Enter ".help" for usage hints.

To get help you can use the ‘.help’ command like so:

command        description
-------------  ---------------------------
.help          Shows this message
.tables        Lists all the tables
.schema TABLE  Shows the schema of a table
.databases     Lists all the databases
.quit          Exit the cli

Following is a sample session:

mssql> use test
mssql> .tables
-------------  ------------  ------------------  ----------
test           dbo           Customers           BASE TABLE
test           dbo           Orders              BASE TABLE
test           dbo           MyEntityDatas       BASE TABLE
test           dbo           __MigrationHistory  BASE TABLE

mssql> select * from Customers
CustomerId  Name
----------  --------
1           Henrik
2           Scott
3           Benjamin

Feel free to fork the git repo and contribute enhancements https://github.com/hasankhan/sql-cli

Squiggle 3.3 Declared Stable

After 20,000+ downloads, I’m declaring Squiggle 3.3 as stable. The code for Squiggle 3.3 is in 3.3 branch in git. If there is any critical bug fix, it will go in the same branch and will be merged back to master otherwise all bug fixes will now go to 3.4 branch.

For Squiggle 3.4 release I’m going to be once again changing the communication layer. I want to try .NET port of ZeroMQ called NetMQ. This means it will not be backwards compatible with older version. However this will help in reducing the amount of software people have to install to get Squiggle to work i.e. VC++ runtime. Other changes that I’m planning for v3.4 are as under:

  • Upgrade to .NET 4.5
  • Use async-await in code and get rid of dispatcher calls to switch threads
  • Switch to SQLite as local database to reduce installation payload and dependencies
  • Reduce memory footprint

I do not plan on doing any new features for 3.4 release as of now.

Squiggle 3.3 Beta Released

Version 3.3 of Squiggle has been released on CodePlex as Beta release.

New features include:

  • Allow using environment variables in configuration file (history db connection string, download folder location, display name, group and message)
  • Fix for history viewer to show the correct history entries
  • History saved with UTC timestamp
  • Added feature to send screenshots and paste image in message edit box.

This release will now only have revisions with bug fixes. It is feature complete and all new features will go in 3.4.

Squiggle 3.2 Declared Stable

Squiggle 3.2 has been in Beta for several months now. Issues that were reported are all fixed. There will be no more revisions of Squiggle 3.2. The next version of Squiggle will be 3.3

In case you missed the previous announcement, Squiggle now has git repository. You can fork it and issue pull requests for bug fixes, implementing any of the suggested features or to implement any cool idea you have. This is your chance to mark your name in commit history of Squiggle 3.3.

In case you’re running a revision earlier than 3.2.4, you can get the latest version from the downloads page.