Releases: apstndb/spanner-mycli
v0.28.0
Summary
v0.28.0 brings type-based ANSI styling for query results, fuzzy completion improvements, and a large internal architecture overhaul that simplifies the codebase significantly.
Highlights
CLI_TYPE_STYLESsystem variable: Configure per-type ANSI colors for query results using a colon-separatedTYPE=STYLEformat (e.g.,SET CLI_TYPE_STYLES = 'STRING=green:INT64=cyan:NULL=dim'). Supports named colors, attributes, raw SGR numbers, 256-color, and truecolor. See docs/system_variables.md for full reference.- SQL statement skeletons in fuzzy finder: Fuzzy completion now includes SQL statement templates for faster query authoring.
- Format system rewrite: New
Cellinterface withPlainCell/StyledCell, format registry, and unified table rendering. Migrated from go-runewidth to go-tabwrap. - Architecture simplifications: Extracted
TransactionManager, restructured system variables into nested groups, migrated to named capture groups, simplified SQL execution pipeline. Net reduction in code complexity. - spanemuboost v0.3.4: Adopted
LazyEmulatorfor deferred emulator startup in tests andTestMainhelper for cleaner test infrastructure.
What's Changed
New Features
- feat(fuzzy): add SQL statement skeletons to fuzzy completion by @apstndb in #552
- refactor: migrate to spanemuboost v0.3.x new API by @apstndb in #553
- feat(format): add CLI_TYPE_STYLES system variable for type-based ANSI styling by @apstndb in #559
Misc
- refactor: restructure systemVariables into nested struct groups by @apstndb in #543
- refactor: extract TransactionManager from Session by @apstndb in #544
- refactor: migrate statement definitions to named capture groups by @apstndb in #545
- refactor: simplify execute_sql.go pipeline by extracting DDL/DML/partitioned/row-iter by @apstndb in #546
- refactor: simplify initializeSystemVariables with table-driven mappings by @apstndb in #547
- refactor: replace CurrentSession *Session with inTransaction callback by @apstndb in #549
- refactor: quick-win architecture improvements (#5, #7, #8) by @apstndb in #548
- test: add unit tests for format/ package by @apstndb in #550
- test: add unit tests for metrics/ package by @apstndb in #551
- refactor(format): add Cell interface, format registry, and unified table rendering by @apstndb in #556
- refactor(format): migrate from go-runewidth/go-runewidthex to go-tabwrap and add StyledCell by @apstndb in #557
- chore(deps): migrate to spanemuboost v0.3.3 with LazyEmulator by @apstndb in #560
- chore(deps): update spanemuboost v0.3.3 → v0.3.4, use TestMain helper by @apstndb in #561
Full Changelog: v0.27.0...v0.28.0
v0.27.0
Summary
Fuzzy finder powered by fzf — Press Ctrl+T to launch an interactive fuzzy finder for databases, tables, views, indexes, change streams, sequences, models, schemas, system variables, variable values, database roles, DDL operations, query parameters, and statement names. Candidates are cached with TTL for fast repeated access.
Customize fzf behavior via SET CLI_FUZZY_FINDER_OPTIONS = '--color=dark --no-select-1'. Built-in defaults (--select-1, --exit-0, --highlight-line, --cycle) can be overridden with last-wins semantics.
Other highlights:
READ_LOCK_MODEsystem variable for controlling read lock behavior in read/write transactionsUNSET PARAMstatement for removing query parameters- Internal restructuring into sub-packages (
format,streamio,decoder,metrics,filesafety)
What's Changed
New Features
- feat: add READ_LOCK_MODE system variable by @apstndb in #492
- feat(interactive): add fzf-style fuzzy finder for USE statement by @apstndb in #506
- feat(fuzzy-finder): statement name + argument completion framework by @apstndb in #507
- feat(fuzzy-finder): add variable value completion for SET statements by @apstndb in #510
- feat(fuzzy-finder): add table completion for MUTATE statement by @apstndb in #515
- feat(fuzzy-finder): add role completion for USE ROLE statement by @apstndb in #516
- feat(fuzzy-finder): add TTL-based candidate caching for database and table completion by @apstndb in #517
- feat(fuzzy-finder): add operation completion and Value/Label fzf support by @apstndb in #527
- feat(fuzzy-finder): add per-type fuzzy completion for SHOW CREATE by @apstndb in #528
- feat(fuzzy-finder): add table completion for DUMP TABLES and SHOW CREATE TABLE by @apstndb in #529
- feat(fuzzy-finder): add schema completion for SHOW TABLES and SHOW CREATE SCHEMA by @apstndb in #531
- feat(fuzzy-finder): add UNSET PARAM statement and param name completion by @apstndb in #533
- feat(fuzzy-finder): add UX defaults and CLI_FUZZY_FINDER_OPTIONS passthrough by @apstndb in #534
Misc
- refactor(core): unify duplication and simplify logic across execution files by @apstndb in #494
- refactor(core): extract metrics and filesafety sub-packages by @apstndb in #502
- refactor(core): extract format sub-package from internal/mycli by @apstndb in #503
- refactor(core): extract streamio and decoder sub-packages, eliminate util.go by @apstndb in #504
Full Changelog: v0.26.0...v0.27.0
v0.26.0
What's Changed
New Features
-
feat: display query advisor index recommendations after EXPLAIN/EXPLAIN ANALYZE by @apstndb in #490
After running
EXPLAIN ANALYZE, index recommendations from Spanner Query Advisor are displayed with estimated improvement:Query Advisor Recommendations: CREATE INDEX VenuesIdx1 ON Venues(OutdoorVenue, Capacity) STORING (VenueName); -- Est. improvement: 95.55%
Misc
- Bump spanemuboost to v0.2.15 by @apstndb in #477
- Updates default Cloud Spanner Emulator to 1.5.45
- Bump spanner client library v1.87.0 by @apstndb in #478
- Bump spanemuboost to v0.2.17 by @apstndb in #479
- Updates default Cloud Spanner Emulator to 1.5.50
Full Changelog: v0.25.0...v0.26.0
v0.25.0
What's Changed
New Features
Misc
- fix: use official SQL syntax from Spanner documentation for singers sample by @apstndb in #475
- build(deps): bump github.com/apstndb/spanemuboost from v0.2.12 to v0.2.13 by @apstndb in #476
Full Changelog: v0.24.0...v0.25.0
v0.24.0
What's Changed
Since this version, Go 1.25 is required to build spanner-mycli. If you want to use it without installing new Go compiler, you can use pre-built binary of spanner-mycli.
Initialize emulator with the sample database
spanner-mycli now supports the official sample databases.
$ spanner-mycli --list-samples
Available sample databases:
banking GoogleSQL Banking application with accounts and transactions
finance GoogleSQL Finance application schema (GoogleSQL)
finance-graph GoogleSQL Finance application with graph features
finance-pg PostgreSQL Finance application (PostgreSQL dialect)
gaming GoogleSQL Gaming application with players and scores
Usage: spanner-mycli --embedded-emulator --sample-database=<name>
$ spanner-mycli --embedded-emulator --sample-database=banking -v
Connected.
spanner> SHOW TABLES;
+-----------------------------+
| Tables_in_emulator-database |
+-----------------------------+
| Customers |
| Accounts |
| TransactionLedger |
+-----------------------------+
3 rows in set (0.03 sec)
Bug Fixes
- fix: clear environment variables in TestMain for test isolation by @apstndb in #462
- fix: exclude generated columns from DUMP INSERT statements by @apstndb in #469
New Features
- feat: adopt native UUID and INTERVAL support from spanvalue v0.1.8 by @apstndb in #463
- feat: relax SELECT constraint to allow simple column names in auto-detection by @apstndb in #468
- feat: add --sample-database flag for initializing embedded emulator with official samples by @apstndb in #472
Misc
- build: Update Go version from 1.24 to 1.25 by @apstndb in #452
- feat: adopt Go 1.25 specific features by @apstndb in #453
- refactor: reorganize integration_test.go into logical test groups by @apstndb in #457
- refactor: reorganize system_variables_test.go for better maintainability by @apstndb in #458
- refactor: reorganize main_flags_test.go for better maintainability (#455) by @apstndb in #459
- test: improve test quality with focused helper functions and better readability by @apstndb in #460
- feat: update modelcontextprotocol/go-sdk from v0.2.0 to v0.3.0 by @apstndb in #464
- build: update dependencies following Go 1.25 and MCP SDK v0.3.0 migration by @apstndb in #465
- test: refactor TestParameterStatements to use data-driven approach by @apstndb in #466
Full Changelog: v0.23.0...v0.24.0
v0.23.0
What's Changed
New Features
- feat: add SQL export formats for database migration by @apstndb in #430
- feat: add --quiet flag to suppress result lines by @apstndb in #433
- feat: implement DUMP statements for database export by @apstndb in #434
- feat: add output redirect command (\o) and --output flag for file-only output by @apstndb in #437
- feat: implement table dependency resolver for INTERLEAVE and FK relationships by @apstndb in #439
- feat: implement automatic table name detection for SQL export formats by @apstndb in #440
Misc
- refactor: implement withTransactionContextLocked pattern for improved transaction management by @apstndb in #442
- Remove panic calls and implement proper error handling by @apstndb in #447
- refactor: precompile frequently used regex patterns by @apstndb in #449
- refactor: unify 11 formatters under common pattern with minimal abstraction by @apstndb in #448
- Optimize test suite by sharing emulator with instance-level isolation by @apstndb in #450
- test: complete test parallelization for improved performance by @apstndb in #451
Full Changelog: v0.22.1...v0.23.0
v0.22.1
v0.22.0
What's Changed
This release introduces significant performance improvements, including streaming output support that reduces memory usage when handling large datasets.
Streaming Output Support:
Streaming output is now enabled by default for all formats except TABLE. If you wish to enable streaming output in all modes—including TABLE format—you can set it explicitly with:
spanner-mycli --streaming=TRUE
or by adding CLI_STREAMING=TRUE to your config file (.spanner_mycli.cnf).
Default Table Format:
Table format is now the default for both interactive and batch modes. You no longer need to specify --table or -t for each invocation.
Note:
If your scripts rely on the TAB-formatted output in batch mode, you will need to update them accordingly. To retain the previous TAB format behavior, you can either:
- Set the format explicitly:
spanner-mycli --set CLI_FORMAT=TAB - Add the following to your config file (
.spanner_mycli.cnf):CLI_FORMAT=TAB
Breaking Changes
Bug Fixes
- fix: add mutex protection for transaction context access by @apstndb in #396
- fix: use TableHeader presence instead of IsMutation for output formatting by @apstndb in #416
- fix: update enumer calls to use Go 1.24 tool management by @apstndb in #423
New Features
- feat: add generics-based validation and parsing framework for system variables by @apstndb in #409
- feat: implement streaming output to reduce memory usage and improve TTFB by @apstndb in #413
Full Changelog: v0.21.0...v0.22.0
v0.21.0
This release includes many meta-commands and command-line options to improve compatibility with the Official Spanner CLI.
What's Changed
New Features
- feat: add --source as an alias for --file flag by @apstndb in #376
- feat: add --deployment_endpoint as alias for --endpoint by @apstndb in #377
- feat: implement \! meta-command for shell command execution by @apstndb in #375
- feat: implement --host and --port flags as first-class options by @apstndb in #379
- feat: implement \. meta-command for executing SQL from file by @apstndb in #378
- feat: implement \u meta-command for database switching by @apstndb in #381
- feat: implement --skip-column-names option by @apstndb in #382
- feat: implement \R meta-command for prompt change by @apstndb in #383
- feat: implement --tee option for output logging (#352) by @apstndb in #384
- feat: implement --system-command option for controlling system commands by @apstndb in #386
- feat: implement --html and --xml output format options (#350) by @apstndb in #387
- feat: implement \T and \t meta-commands for output file control by @apstndb in #385
- feat: add session-init-only variables validation mechanism by @apstndb in #389
- feat: apply go fmt to entire codebase and add CI enforcement by @apstndb in #391
- feat: add CSV output format support with multiple CLI options by @apstndb in #393
Full Changelog: v0.20.0...v0.21.0
v0.20.0
What's Changed
Bug Fixes
- fix: handle non-TTY stdin correctly to avoid permission denied error by @apstndb in #327
- fix: resolve flag inconsistencies discovered during flag testing by @apstndb in #372
New Features
- feat: implement RETURN_COMMIT_STATS setter (SET variable) by @apstndb in #313
- feat: implement --try-partition-query flag for standard GoogleSQL partition testing by @apstndb in #317
- Implement async DDL execution functionality (#277) by @apstndb in #316
- feat: migrate from mcp-go to official modelcontextprotocol/go-sdk by @apstndb in #361
- Add --emulator-platform flag and CLI_EMULATOR_PLATFORM variable by @apstndb in #374
Misc
- fix: replace context.TODO() with t.Context() in integration tests by @apstndb in #315
- feat: add comprehensive tests for parseTimestampBound function by @apstndb in #325
- test: add comprehensive error handling tests for system_variables by @apstndb in #340
- test: add tests for readline highlight functions by @apstndb in #365
- [Test Coverage] Complete tests for proto descriptor file handling by @apstndb in #363
- refactor: improve readline history testability by @apstndb in #366
- feat: improve test coverage infrastructure by @apstndb in #368
- [Test Coverage] Refactor readline input validation for testability by @apstndb in #367
- test: add comprehensive flag validation tests by @apstndb in #369
Full Changelog: v0.19.0...v0.20.0