We are pleased to announce version 0.7.0 of SQL Runner. This release adds many new features including the printing out of query output, templated playbooks, the ability to view evaluated SQL file templates, and more:
Version 0.7.0 introduces the ability to view output from queries. Using the -showQueryOutput flag will print all query results to the console formatted in a table, following each step.
2. Templated playbooks
The -var will now pass variables into playbooks, as it does with SQL files. This should be useful for treatment of secrets and credentials that you don’t want to embed directly in playbooks.
Along with this, the -var flag also now permits multiple key-value pairs; the pairs must be comma separated (e.g. key=value,key2=value2), like so:
Many thanks to community member dannymc129 for contributing these features!
3. Check SQL queries
The new -fillTemplates flag will evaluate a SQL file, and print the query in the console, exactly how it would be run against the database. This can assist in debugging templated files, where it’s useful to see the transformations around how variables are inserted into templates.
Note that with the -fillTemplates flag, no SQL will actually be executed.
4. Other changes
This release brings a whole host of other updates:
The new -consulOnlyForLock flag lets you run local playbooks, while using Consul for locking.
A random number templating function has been added - use randomInt in your SQL templates. Thanks to community member Tobi for contributing this feature!
SQL Runner now returns a dedicated exit code (8) if no queries are found to be run.
During dry run, SQL Runner will now attempt to connect to targets, printing corresponding SUCCESS and ERROR messages to the terminal.
Our Snowflake target configuration now lets you specify us-west as the region variable for the default Snowflake region (previously this would error).
Use of godep has been replaced with dep.
SQL Runner 0.7.0 is available as a standalone binary for 64-bit Linux, Windows and macOS on Bintray. Download them as follows:
Once downloaded, unzip it, for example with Linux: