Menu

WhatsNew

Scott Gray

What's New in 2.0

It's been a long long time since the last release. This is primarily because the process of doing builds for multiple platforms is such a pain (if anyone wants to help contribute builds, please contact me!). As a result of the long silence, the list of changes since 1.4 is quite extensive.

New Features

The following features have been added since the previous release.

  • The command terminator may now end a jsqsh command. For example, the following are now legal:
     1> \echo hello how are you;
     hello how are you
    
  • Added new SQL display style json
  • Added ${histid} variable that contains the current buffer number you are working on. Really useful for adding to your prompt.
  • Added support for ARRAY data type and hopefully better support for unrecognized data types.
  • Added \show command which can display almost all of the major database metadata information (tables, functions, columns, procedures, etc.). See "\help show" for details.
  • Added \prepare command. The command is mostly used for diagnosing JDBC driver issues/functionality and prepares a SQL statement against the server than displays metadata about the prepared statement, such as what the final result set will look like and the data types of any parameter markers.
  • Added ${fetchsize} variable to set the JDBC Statement.fetchSize() property.
  • Added ${editing_mode} to allow you to set the editing keymap. Currently this is only supported by JLine, so to switch to "vi" mode, do:
     \set editing_mode=vi
    
  • Added ${ex_detail} to adjust the level of detail in exceptions (e.g. whether or not stack traces are included in the output).
  • Added ${show_exclass} configuration variables that causes exception class names to be displayed.
  • Added --echo jsqsh flag and ${echo} variable to echo the input back out to stdout. This is useful when running scripts (non-interactive mode) see both the SQL and commands executed as well as the results.
  • Added --var (-v) command line flag which can be used to set the value of a variable like so
     jsqsh --var expand=true
    
  • Added a significant number of pre-defined JDBC drivers

Changed Behavior

  • The ${expand} variable now defaults to false, meaning that by default variables are no longer expanded in SQL statements. After some thought I decided this behavior was too dangerous to leave on by default as a "$" is meaningful on some platforms and could break/confuse things. Note that this does not impact variable expansion on jsqsh command line commands, that remains in effect.
  • Footer information (#rows processed and timing) is now displayed to stderr so that this information isn't written to the output file if the output is redirected. Use 2>&1 if you want to write this to your output file now.
  • The default display style for timestamp and date have changed to the ISO standard of yyyy-mm-dd hh:mm:ss.fff and yyy-mm-dd respectively.
  • The behavior of setting ${style} is slightly different now, and is documented in the help for style. The support styles vary based upon the session type e.g. a JDBC session vs. a Jaql session). Setting a SQL style with no session started, or a SQL session started sets it globally for all session. Jaql styles can only be applied during a jaql session, and only sets the value locally for the jaql session.
  • Upgraded to jline-2.10. JLine is an almost pure java line editing library, similar to readline. This version of jline adds support for most of the basic "vi" command set. It is important to note that this version of jline will recognize and try to honor settings in your ".inputrc" file if you have any set.
  • Removed support for ANTs DB2 SQL Skin for Sybase ASE driver. The company is all but dead except for the nails in the coffin. Too bad, I was extremely proud of what we built.
  • The --debug (-b) flag can now be specified multiple times to enable
    multiple debugging categories
  • The --input-file (-i) flag can now be specified multiple times, each
    input will be processed in order.
  • The \help command will automatically try to launch a pager to page through the help output.

Other Changes

  • Switched to Apache 2.0 License. This has the following side effects (mostly not visible to users)
    • Option processing switched from GNU getopt to my own implementation. I tried to follow getopt behavior, but it may not be exactly the same as it was.
    • JLine is made default line reader. Readline has to be enabled by the user, and the readline jar is not distributed with jsqsh. For those worried about this descision: java-readline hasn't been updated in over 7 years and JLine 2.x is approaching it pretty well in terms of functionality. Java-readline can be installed on most linux machines by your package manager, so it is easy to add on.
  • Added support for launching a Jaql interpreter from within jsqsh. Jaql is a programming language designed for working with Hadoop. JSqsh's support for jaql consists of:
    • The \jaql command starts a Jaql session
    • The flag --jaql when starting jsqsh, automatically starts a session
    • When in a jaql session, \go or the command terminator (";" by default) executes the current statement through the Jaql interpreter.
    • The variables ${jaql_prompt}, ${jaql_indent}, ${jaql_jars}, ${jaql_path}}, ${jaql_jobname}, and ${jaql_style} can be used to affect the behavior of the jaql shell (these are all documented under \help jaql**).
    • Jsqsh options --jaql-path and --jaql-jars have been added. Use of these options implies --jaql.
    • Tab completion will complete any global Jaql variable name.
    • There are display styles that apply to Jaql: json, csv, lines, and discard.
  • Added new build target called dist-bin. This produces a standalone zip package containing a jsqsh run-time, just like dist, but it also includes the jsqsh JNI interface.
  • The shell script included with dist and dist-bin is now wired to recognize if $JAQL_HOME is set and to launch jsqsh using the Jaql launcher so it will pick up all the necessary libraries.

Bug Fixes

  • Output performance for most output formats is dramatically improved (approx 2x)
  • Changed the way in which JDBC drivers are loaded via a custom class path (using the ${classpath} variable). Apparently some drivers don't like to be used directly to establish the connection, so this change will use the JDBC DriverManager to get connections.
  • Fixed a long standing irritation of empty entries appearing in the \history list. Now empty SQL buffers will be thrown away so no empty entries should appear in the history.
  • Fixed bug where connection names supplied on the command line are not recognized.

Previous Releases

Change history from previous releases can be found here


Related

Wiki: Navigation
Wiki: OldChanges

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.