Skip to content

Releases: neilotoole/sq

v0.38.1

19 Jun 17:05
eedc11e
Compare
Choose a tag to compare

Fixed

  • #261: The JSON writer (--json) could get deadlocked when a record contained
    a large amount of data, triggering an internal Flush() (which is mutex-guarded)
    from within the mutex-guarded WriteRecords() method.

v0.38.0

18 Jun 13:30
Compare
Choose a tag to compare

This release has significant improvements (and breaking changes) to SLQ (sq's query language).

Changed

  • ☒️ #254: The formerly-implicit "WHERE" mechanism now requires an explicit where() function.
    This, alas, is a fairly big breaking change. But it's necessary to remove an ambiguity roadblock.
    See discussion in the issue.

    # Previously
    $ sq '.actor | .actor_id <= 2'
    
    # Now
    $ sq '.actor | where(.actor_id <= 2)'
  • #256: Column-only queries are now possible. This has the neat side effect
    that sq can now be used as a calculator.

    $ sq 1+2
    1+2
    3

    You may want to use --no-header (-H) when using sq as a calculator.

    $ sq -H 1+2
    3
    $ sq -H '(1+2)*3'
    9

Fixed

  • Literals can now be selected (docs).

    $ sq '.actor | .first_name, "X":middle_name, .last_name | .[0:2]'
    first_name  middle_name  last_name
    PENELOPE    X            GUINESS
    NICK        X            WAHLBERG
  • Lots of expressions that previously failed badly, now work.

    $ sq '.actor | .first_name, (1+2):addition | .[0:2]'
    first_name  addition
    PENELOPE    3
    NICK        3
  • #258: Column aliases can now be arbitrary strings, instead of only a
    valid identifier.

    # Previously only valid identifier allowed
    $ sq '.actor | .first_name:given_name | .[0:2]'
    given_name
    PENELOPE
    NICK
    
    # Now, any arbitrary string can be used
    $ sq '.actor | .first_name:"Given Name" | .[0:2]'
    Given Name
    PENELOPE
    NICK

v0.37.1

15 Jun 14:17
Compare
Choose a tag to compare

Fixed

  • #252: Handle *uint64 returned from DB.

v0.37.0

13 Jun 17:54
Compare
Choose a tag to compare

Added

  • #244: Shell completion for sq add LOCATION. See docs.

v0.36.2

27 May 03:23
24b5faf
Compare
Choose a tag to compare

Changed

 # mysql "date_format" func
 $ sq '@sakila/mysql | .payment | _date_format(.payment_date, "%m")'
 
 # Postgres "date_trunc" func
 $ sq '@sakila/postgres | .payment | _date_trunc("month", .payment_date)'

v0.36.1

26 May 20:55
debb282
Compare
Choose a tag to compare

Fixed

  • sq diff: Renamed --count flag to --counts as intended.

v0.36.0

26 May 06:17
Compare
Choose a tag to compare

The major feature is the long-gestating sq diff.

Added

  • #229: sq diff compares two sources, or tables.
  • sq inspect --dbprops is a new mode that returns only the DB properties.
    Relatedly, the properties mechanism is now implemented for all four supported
    DB types (previously, it was only implemented for Postgres and MySQL).
  • CSV format now colorizes output.

Changed

  • sq inspect -v previously returned DB properties in a field named db_variables.
    This field has been renamed to db_properties. The renaming reflects the fact
    that some of those properties aren't really variables in the sense that they
    can be modified (e.g. DB server version or such).
  • The structure of the former db_variables (now db_properties) field has
    changed. Previously it was an array of {"name": "XX", "value": "YY"} values,
    but now is a map, where the keys are strings, and the values can be either
    a scalar (bool, int, string, etc.), or a nested value such as an array
    or map. This change is made because some databases (e.g. SQLite) feature
    complex data in some property values.
  • CSV format now renders byte sequences as [777 bytes] instead of dumping
    the raw bytes.
  • ☒️ TSV format (--tsv) no longer has a shorthand form -T. Apparently that
    shorthand wasn't used much, and -T is needed elsewhere.
  • ☒️ Likewise, --xml no longer has shorthand -X. And --markdown has lost alias --md.
  • In addition to the format flags --text, --json, etc., there is now
    a --format=FORMAT flag, e.g. --format=json. This will allow sq to
    continue to expand the number of output formats, without needing to have
    a dedicated flag for each format.

v0.35.0

11 May 02:50
Compare
Choose a tag to compare

Added

  • #8: Results can now be output in YAML.

Fixed

  • sq config get OPT --text now prints only the value, not KEY VALUE.
    If you want to see key and value, consider using --yaml, or --text --verbose.

v0.34.2

08 May 14:01
Compare
Choose a tag to compare

Fixed

  • Both --markdown and the alias --md are now supported.

v0.34.1

07 May 08:28
Compare
Choose a tag to compare

Fixed

  • Fixed a minor issue where sq ls -jv and sq ls -yv produced no output
    if config contained no explicitly set options.