Skip to content

v1.2.3

Choose a tag to compare

@sim-wangyan sim-wangyan released this 09 Nov 14:42

release: v1.2.3 - CTE & UNION fluent builders
🎯 Core Theme: Composable SQL pipelines without leaving BuilderX

✨ New Capabilities:

  1. Common Table Expressions

    • With(name, fn) & WithRecursive(name, fn) for multi-stage query setup
    • Automatic alias normalization and parameter propagation
    • Regression coverage via with_cte_test.go
  2. UNION chaining

    • UNION(kind, fn) with ALL() helper (default = DISTINCT)
    • Stack multiple unions while preserving ORDER BY / LIMIT semantics
    • New tests ensure DISTINCT/ALL correctness
  3. Metadata injection

    • Meta(func(meta *interceptor.Metadata)) enables inline TraceID/Tenant setup
    • Interceptors receive enriched metadata prior to Build()

🔧 Internal Improvements:

  • Shared SQL core writer now feeds both base SELECT and UNION branches
  • DISTINCT constant renamed to DISTINCT_SCRIPT to avoid helper collision
  • Builder states cache CTE / UNION clauses to avoid duplicate builds

📖 Documentation:

  • README updated with v1.2.3 highlight section, CTE/UNION examples, metadata usage
  • CHANGELOG、Release Notes、Test Report 全面同步

🧪 Quality:

  • go test ./... ✅ (~240 cases including new suites)
  • No breaking changes; existing APIs continue to work unchanged

🚀 Summary:
v1.2.3 brings enterprise-grade analytics features—CTEs, recursive hierarchies, UNION composition, and observability—while keeping the fluent builder experience intact.