Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Releases: neilotoole/sq

v0.48.11

18 Jan 20:52

Choose a tag to compare

Fixed

  • #502: sq sql now properly executes single SQL statements (INSERT, UPDATE,
    DROP, etc.) instead of incorrectly running them as queries.

    • This fixes broken behavior with strict database drivers and ensures affected
      row counts are correctly reported. Note that sq sql is designed to accept
      only a single SQL statement/query in the SQL input string; behavior is
      undefined for multiple statements in the input.
    • Thanks to @drluckyspin for the fix.
  • #520: sq add and sq ls erroneously printed source password for SQL Server URLs
    in some circumstances.

  • #469: Column widths were too wide when using --no-header flag. Header text
    is now excluded from column width calculation when headers are disabled.
    Thanks to @majiayu000 for the fix.

v0.48.10

28 Dec 10:47

Choose a tag to compare

Fixed

  • #506: Fixed two XLSX-related issues (sadly, both are regression fixes):
    • Stdin detection: Fixed type detection failing for XLSX files created by
      various tools (e.g., the excelize library). These files have varying internal
      ZIP structures that the previous detection couldn't handle. Detection now
      scans ZIP local file headers instead of relying on fragile magic number
      heuristics.
    • Output colorization: Fixed XLSX binary output (--xlsx) being corrupted
      when written to stdout. The colorization decorator was modifying the binary
      data. XLSX format now bypasses colorization, like --raw output already does.

Changed

  • #504: Updated golangci-lint to v2.7.2, along with Go dependencies
    and GitHub Actions workflow versions. Other tool versions have been updated too.

    Note that Go tool dependencies are now located in the tools/ directory, each
    with its own go.mod. Tools are invoked viago tool -modfile, e.g.
    go tool -modfile=tools/golangci-lint/go.mod golangci-lint.

    See the Makefile and tools/README.md for more detail.

v0.48.9

28 Dec 10:20

Choose a tag to compare

Use v0.48.10 instead of this release. This release partially failed in the CI pipeline phase.

v0.48.5

20 Jan 01:40

Choose a tag to compare

Fixed

  • #446: A bufio.ErrTooLong was being returned by bufio.Scanner, when splitting lines from input that was too long (larger than bufio.MaxScanTokenSize, i.e. 64KB). This meant that sq wasn't able to parse large JSON files, amongst other problems. The maximum buffer size is now configurable via the new tuning.scan-buffer-limit option. Note that the buffer will start small and grow as needed, up to the limit.

    $ sq config set tuning.scan-buffer-limit 64MB   # or 1024B, 64KB, 1GB, etc.
    

    A more useful error message is also now returned when the buffer limit is exceeded (the error suggests adjusting tuning.scan-buffer-limit).

Changed

  • Renamed config option tuning.buffer-mem-limit to tuning.buffer-spill-limit. The new name better reflects the purpose of the option.

v0.48.4

24 Nov 19:16

Choose a tag to compare

Changed

  • Updated Go dependencies (was failing some security vulnerability scans).

v0.48.3

12 Mar 03:02

Choose a tag to compare

Small bugfix release.

Fixed

  • #415: The JSON ingester could fail due to a bug when a JSON blob landed on the edge of a buffer.
  • The JSON ingester wasn't able to handle the case where a post-sampling JSON field had a different kind from the kind determined by the sampling process. For example, let's say the sample size was 1000, and the field zip was determined to be of kind int, because values 0-1000 were all parseable as integers. But then the 1001st value was BX123, which obviously is not an integer. sq will now see the non-integer value, and alter the ingest DB schema to a compatible kind, e.g. text. This flexibility is powerful, but it does come at the cost of slower ingest speed. But that's a topic for another release.

v0.48.1

08 Mar 00:58

Choose a tag to compare

This release features significant improvements to sq diff.

Added

  • Previously sq diff --data diffed every row, which could get crazy with a large table. Now the command stops after N differences, where N is controlled by the --stop (-n) flag, or the new config option diff.stop. The default stop-after value is 3; set to 0 to show all differences.

    # Stop on first difference
    $ sq diff @prod.actor @staging.actor --data --stop 1
    
    # Stop after 5 differences, using the -n shorthand flag
    $ sq diff @prod.actor @staging.actor --data -n5
  • #353: The performance of sq diff has been significantly improved. There's still more to do.

  • Previously, sq diff --data compared the rendered (text) representation of each value. This could lead to inaccurate results, for example with two timestamp values in different time zones, but the text rendering omitted the time zone. Now, sq diff --data compares the raw values, not the rendered text. Note in particular with time values that both time and location components are compared.

  • sq can now handle a SQLite DB on stdin. This is useful for testing, or for working with SQLite DBs in a pipeline.

    $ cat sakila.db | sq '.actor | .first_name, .last_name'

    It's also surprisingly handy in daily life, because there are sneaky SQLite DBs all around us. Let's see how many text messages I've sent and received over the years:

    $ cat ~/Library/Messages/chat.db | sq '.message | count'
    count
    215439

    I'm sure that number makes me an amateur with these millenials 👴🏻.

    Note that you'll need to enable macOS Full Disk Access to read the chat.db file.

  • sq now allows you to use true and false literals in queries. Which, in hindsight, does seem like a bit of an oversight 😳. (Although previously you could usually get away with using 1 and 0).

    $ sq '.people | where(.is_alive == false)'
    name        is_alive
    Kubla Khan  false
    
    $ sq '.people | where(.is_alive == true)'
    name         is_alive
    Kaiser Soze  true

Changed

  • ☢️ Previously, sq diff only exited non-zero on an error. Now, sq diff exits 0 when no differences, exits 1 if differences are found, and exits 2 on any error. This aligns with the behavior of GNU diff:

    Exit status is 0 if inputs are the same, 1 if different, 2 if trouble.
    
  • Minor fiddling with the color scheme for some command output.

v0.47.4

10 Feb 05:58
9bb4185

Choose a tag to compare

Patch release with changes to flags. See the earlier v0.47.0 release for recent headline features.

Added

  • By default, sq prints source locations with the password redacted. This is a sensible default, but there are legitimate reasons to access the unredacted connection string. Thus a new global flag --no-redact (and a corresponding redact config option).

    # Default behavior: password is redacted
    $ sq src -v
    @sakila/pg12  postgres  postgres://sakila:[email protected]/sakila
    
    # Unredacted
    $ sq src -v --no-redact
    @sakila/pg12  postgres  postgres://sakila:[email protected]/sakila
  • Previously, if an error occurred when verbose was true, and error.format was text, sq would print a stack trace to stderr. This was poor default behavior, flooding the user terminal, so the default is now no stack trace. To restore the previous behavior, use the new -E (--error.stack) flag, or set the error.stack config option.

Changed

  • The --src.schema flag (as used in sq inspect, sq sql, and the root sq cmd) now accepts --src.schema=CATALOG.. Note the . suffix on CATALOG.. This is in addition to the existing allowed forms SCHEMA and CATALOG.SCHEMA. This new CATALOG. form is effectively equivalent to CATALOG.CURRENT_SCHEMA.

    # Inspect using the default schema in the "sales" catalog
    $ sq inspect --src.schema=sales. 
  • The --src.schema flag is now validated. Previously, if you provided a non-existing catalog or schema value, sq would silently ignore it and use the defaults. This could mislead the user into thinking that they were getting valid results from the non-existent catalog or schema. Now an error is returned.

v0.47.3

03 Feb 12:45

Choose a tag to compare

Minor bug fix release. See the earlier v0.47.0 release for recent headline features.

Fixed

  • Shell completion for bash only worked for top-level commands, not for subcommands, flags, args, etc. This bug was due to an unnoticed behavior change in an imported library 🤦‍♂️. It's now fixed, and tests have been added.

Changed

  • Shell completion now initially suggests only sources within the active group. Previously, all sources were suggested, potentially flooding the user with irrelevant suggestions. However, if the user continues to input a source handle that is outside the active group, completion will suggest all matching sources. This behavior is controlled via the new config option shell-completion.group-filter.

v0.47.2

30 Jan 05:21
135318f

Choose a tag to compare

See the earlier v0.47.0 release for recent headline features.

Fixed

  • sq was failing to write config when there was no pre-existing config file. This was due to a bug in the newly-introduced (as of v0.47.0) config locking mechanism. Fixed.