Skip to content

Releases: apstndb/spannerplan

v0.2.1

Choose a tag to compare

@apstndb apstndb released this 08 Jul 03:30
4e46764

v0.2.1

Documentation and internal dependency housekeeping. No behavior changes; all rendered output and error strings are unchanged.

Added

  • ECOSYSTEM.md (#50): defines the roles of spannerplan, spannerplan-rs, spannerplanviz, and rendertree-web, the "text in libraries, rasterize at the edge" principle, governance rules (Go-first semantics changes, release-train-pinned parity CI, v0 semver policy), and a compatibility matrix.

Changed

  • The input path (ExtractQueryPlan and friends) now uses the extracted github.com/apstndb/protoyaml module (#51). Semantics are identical by construction (goccy YAML → protojson with DiscardUnknown); all tests pass with zero golden changes.

Deprecated

  • The in-repo protoyaml package is frozen and marked Deprecated (#51). Its Marshal output format was never a designed artifact (an accident of reflection-based encoding). New code should use github.com/apstndb/protoyaml, which implements the canonical protojson-over-YAML mapping. The frozen package will be removed in v0.3.0 now that spanner-mycli has migrated (apstndb/spanner-mycli#784).

v0.2.0

Choose a tag to compare

@apstndb apstndb released this 06 Jul 03:31
f6fcb29

Breaking Changes

  • New now returns *ValidationError for plan validation failures, including empty plan input. Existing errors.Is(err, ErrEmptyPlanNodes) and other category sentinel checks continue to work, and existing error message text is preserved. Code that compared returned errors by direct equality, such as err == ErrEmptyPlanNodes, should switch to errors.Is.

New Features

  • Added ErrInvalidPlan, an umbrella sentinel that matches every validation failure returned by New.
  • Added ValidationError, a structured validation error with Kind, NodeIndex, and ChildIndex fields so callers can inspect invalid plan input without depending on message text.
  • New now wraps both ErrInvalidPlan and the specific category sentinel for each validation failure, so callers can choose either broad or specific errors.Is checks.
  • Added executable documentation through ExampleNew_invalidPlan, showing both errors.Is and errors.As usage.

Compatibility Notes

  • Existing validation error strings are intentionally preserved in this release.
  • Existing category sentinels still match through errors.Is.
  • There are no dependency, CLI, or rendering-output changes in this release.

Validation

  • go test -v ./...
  • go vet ./...
  • golangci-lint run --timeout=5m
  • git diff --check v0.1.11..HEAD

v0.1.11

Choose a tag to compare

@apstndb apstndb released this 17 May 20:16
f5e48aa

v0.1.11

Patch release after v0.1.10.

Added

  • Added intent-based scalar appendix print presets: basic, enhanced, full, and none (#45).
  • Added preset parsing for rendertree --print and plantree/reference.ParsePrintSections, while preserving comma-separated low-level section names (#45).
  • Added public plantree/reference.PrintPreset, ParsePrintPreset, PrintPreset.Sections, and NewPrintSections helpers so callers can preserve the nil default versus explicit-empty PrintSections distinction (#45).
  • Added regression coverage for preset parsing, explicit empty/blank appendix suppression, preset/list validation, CLI config behavior, and public reference helpers (#45).
  • Added repository-level Gemini Code Assist configuration with code_review.comment_severity_threshold: HIGH (#46).

Changed

  • Updated rendertree --print help and README documentation to describe the new preset values and explicit empty suppression behavior (#45).
  • Improved repository README navigation with a pkg.go.dev badge and clearer package, command, example, and helper directory overview (#42).
  • Reorganized cmd/rendertree README sections into a clearer hierarchy (#42).

Validation

  • git diff --check v0.1.10..origin/main
  • go test ./...
  • mise x -- golangci-lint run --timeout=5m

v0.1.11-alpha.1

v0.1.11-alpha.1 Pre-release
Pre-release

Choose a tag to compare

@apstndb apstndb released this 17 May 20:05
f5e48aa

v0.1.11-alpha.1

Alpha prerelease for the next patch release after v0.1.10.

Added

  • Added intent-based scalar appendix print presets: basic, enhanced, full, and none (#45).
  • Added preset parsing for rendertree --print and plantree/reference.ParsePrintSections, while preserving comma-separated low-level section names (#45).
  • Added public plantree/reference.PrintPreset, ParsePrintPreset, PrintPreset.Sections, and NewPrintSections helpers so callers can preserve the nil default versus explicit-empty PrintSections distinction (#45).
  • Added regression coverage for preset parsing, explicit empty/blank appendix suppression, preset/list validation, CLI config behavior, and public reference helpers (#45).
  • Added repository-level Gemini Code Assist configuration with code_review.comment_severity_threshold: HIGH (#46).

Changed

  • Updated rendertree --print help and README documentation to describe the new preset values and explicit empty suppression behavior (#45).
  • Improved repository README navigation with a pkg.go.dev badge and clearer package, command, example, and helper directory overview (#42).
  • Reorganized cmd/rendertree README sections into a clearer hierarchy (#42).

Validation

  • git diff --check v0.1.10..origin/main
  • go test ./...
  • mise x -- golangci-lint run --timeout=5m

v0.1.10

Choose a tag to compare

@apstndb apstndb released this 16 May 15:32
3b3bcc1

Patch release for the rendering-helper and scalar-appendix work merged after v0.1.9.

Added

  • Added the public treerender package for generic ASCII tree rendering.
    • Provides Render, RenderTree, and RenderTreeWithOptions.
    • Provides DefaultStyle and CompactStyle.
    • Supports wrapping through RenderOptions.WrapWidth.
    • Supports continuation indentation modes including fixed-prefix and anchor-based hanging indentation.
    • Exposes Row.Text, Row.TreePartLines, PrefixMetrics, and related helpers for callers that need stable tree-prefix handling.
  • Added the public asciitable package for aligned table and appendix rendering.
    • Provides RenderTable with typed TableSpec and Column definitions.
    • Provides RenderAppendix with typed AppendixSpec definitions.
    • Supports left, right, and center alignment.
    • Preserves multiline table cells without wrapping them unexpectedly.
  • Added examples/pgexplainjson, a dependency-free PostgreSQL EXPLAIN (ANALYZE, FORMAT JSON) renderer that demonstrates the generic treerender and asciitable helpers.
    • Supports compact tree output.
    • Supports total-width wrapping.
    • Generates preorder IDs for PostgreSQL plans, which do not provide stable plan-node IDs.
  • Added scalar child-link accessors and documentation in plantree.
    • RowWithPredicates.TreePartLines exposes tree prefixes as one line per rendered node-text line.
    • RowWithPredicates.ScalarChildLinks preserves scalar child links in original PlanNode.ChildLinks order.
    • ScalarChildLink carries child index, type, variable, description, and the scalar child node.
    • RowWithPredicates.Keys and RowWithPredicates.ChildLinks remain populated as compatibility mirrors.
  • Added scalar appendix controls to cmd/rendertree.
    • --print=predicates,ordering,aggregate selects semantic appendix sections.
    • --print=typed prints all typed scalar links as a raw debug dump.
    • --print=full prints all scalar links, including unnamed links, as a raw debug dump.
    • --print="" suppresses appendix output.
    • --show-vars shows scalar assignment variable names.
    • --resolve-vars resolves direct scalar variable aliases.
    • --resolve-vars-recursive recursively expands scalar variable aliases for investigation.
  • Added scalar appendix controls to plantree/reference.
    • Added PrintSection, PrintSections, ParsePrintSection, and ParsePrintSections.
    • Added WithPrintSections, WithShowScalarVars, WithResolveScalarVars, and WithResolveScalarVarsRecursive.
    • Extended RenderConfig with PrintSections, ShowScalarVars, ResolveScalarVars, and ResolveScalarVarsRecursive.
    • RenderConfig.PrintSections distinguishes omitted/null config from an explicit empty list, so JSON [] can intentionally suppress appendices.
  • Added the shared internal internal/scalarappendix package used by both cmd/rendertree and plantree/reference.
    • Centralizes scalar appendix parsing, validation, rendering, and scalar variable resolution.
    • Keeps public packages as facades rather than exposing internal symbols.
  • Added Gemini review style-guide guidance to avoid readability-reducing micro-optimizations and to treat JSON tags as API design choices.

Changed

  • cmd/rendertree now reuses the shared scalar appendix implementation instead of carrying its own separate section parsing and rendering logic.
  • plantree/reference now renders appendices through the shared scalar appendix implementation.
  • asciitable appendix rendering was generalized beyond predicates through AppendixSpec and RenderAppendix.
  • treerender is now public instead of only being available under an internal package.
  • The unreleased predicate-specific asciitable compatibility API from the development branch was replaced by the more general appendix API before release.
  • treerender hanging-indent validation now requires GetContinuationAnchor only when wrapping is active.
  • The golangci-lint GitHub Actions workflow is pinned to a concrete v2 release.
  • Local review scratch files are ignored by git.

Fixed

  • WithHangingIndent and RenderConfig{HangingIndent: true} no longer fail when no wrap width is configured; without wrapping, hanging indent is a no-op.
  • Empty print-section strings now parse as an explicit empty section list, allowing callers to suppress appendix output.
  • Scalar appendix JSON config preserves explicit empty printSections slices while still treating omitted/null as the default predicate appendix.

Merged PRs

  • #39: feat: expose generic render helpers
  • #40: feat: add scalar appendix sections
  • #41: refactor: share scalar appendix rendering

Validation

  • go test ./...
  • mise x -- golangci-lint run --timeout=5m
  • git diff --check v0.1.9..origin/main

v0.1.9

Choose a tag to compare

@apstndb apstndb released this 06 May 20:04
2059f91

Changes

Added

  • Added QueryPlan.ParentLinks(childIndex) to return every incoming parent child link for a plan node, preserving stable plan traversal order and each parent's ChildLinks order.
  • Added ResolvedParentLink, containing the parent PlanNode and the ChildLink that points to the child node.
  • Added support for treating scalar Full Text Search Search Predicate child links as predicates in QueryPlan.IsPredicate, so downstream renderers can surface Full Text Search predicates without custom plan-shape logic.
  • Added QueryPlan, plantree, and reference renderer tests for simple and compound Full Text Search predicate shapes.
  • Added tests covering duplicate incoming links from the same parent, incoming links from multiple parents, empty and out-of-range ParentLinks lookups, returned-slice isolation, and compatibility with existing single-parent lookup behavior.

Changed

  • Preserved existing GetParentNodeByChildIndex behavior while adding the all-parent-links API, keeping the existing single-parent map compatible for current callers.
  • Clarified QueryPlan.IsVisible documentation: it controls operator-tree child-link visibility, hides scalar plan nodes unless the child link type is Scalar, and treats nil links as the root node.

Full Changelog

v0.1.8

Choose a tag to compare

@apstndb apstndb released this 05 May 20:07
a1514e7

Changes

Added

  • Added plantree/reference.RenderConfig with JSON-friendly wrapWidth and hangingIndent fields for serialized and cross-language callers.
  • Added plantree/reference.RenderTreeTableWithConfig(...) as a high-level rendering entrypoint for JSON-like configuration flows, including browser and WASM integrations.
  • Added equivalence and validation coverage for the new config-based rendering API in plantree/reference/reference_test.go.
  • Added official browser and WebAssembly embedding guidance to the README and plantree/reference package docs.
  • Added a minimal examples/wasm/render syscall/js example that decodes Spanner QueryPlan JSON and returns explicit {output} / {error} results for downstream browser-facing integrations.

Changed

  • Removed the direct github.com/apstndb/lox dependency from this module by replacing the remaining helpers with github.com/samber/lo, standard-library code, and a local sorted-entry helper.
  • Hardened the WASM example to recover from unexpected panics, accept Uint8Array input, reject unknown config fields, and stay buildable under go test ./... on non-js/wasm platforms.

Full Changelog

v0.1.7

Choose a tag to compare

@apstndb apstndb released this 03 May 15:41
47ecd98

What's Changed

Fixed

  • Hanging-indent continuation lines now keep a child guide when the wrapped node has descendants, so vertical tree connections remain visible across wrapped lines.
  • Added regression coverage in internal/treerender and plantree for the connected child-guide behavior.
  • Updated hanging-indent renderer tests to use the stable TrimTrailingSpace wrapping behavior, avoiding expectations that depended on invisible trailing spaces.

Full Changelog

v0.1.6

Choose a tag to compare

@apstndb apstndb released this 28 Apr 20:10
46969be

What's Changed

Added

  • Added plantree.WithHangingIndent() as the preferred public API for enabling hanging indent in wrapped output.

Changed

  • plantree/reference and rendertree now use plantree.WithHangingIndent() as their public hanging-indent integration path.
  • Deprecated the enum-based public plantree.WithContinuationIndent(...) / ContinuationIndent* surface while keeping it as a compatibility path.
  • Added regression coverage to keep the deprecated continuation-indent behavior aligned with WithHangingIndent().

Full Changelog

v0.1.5

Choose a tag to compare

@apstndb apstndb released this 28 Apr 18:40
817a6f1

What's Changed

Added

  • Added opt-in hanging-indent wrapping in plantree via WithContinuationIndent(ContinuationIndentNodePrefix). (#22)
  • Added rendertree --hanging-indent and plantree/reference hanging-indent support via functional options. (#23)
  • Added repeatable rendertree --custom-column flags that accept the same YAML/JSON schema as --custom-file. (#24)

Changed

  • rendertree now rejects mixing --custom with --custom-file. (#21)
  • The delimiter-based --custom syntax is now deprecated in favor of --custom-column and --custom-file. (#24)
  • Added a repository .gemini/styleguide.md to bias Gemini reviews toward correctness and CLI behavior over micro-allocation noise. (#24)

Full Changelog