Relica v0.13.0 was published on July 16, 2026. Its main change is SelectSub, a builder path for scalar subqueries in a SELECT list, including correlated subqueries that previously required raw SQL through SelectExpr. The release also adds column comparison helpers with dialect specific identifier quoting.
The full release notes and downloads are on the GitHub release page.
Scalar subqueries move into the builder ¶
SelectSub lets a query builder place another built query in the outer SELECT list. The release example counts orders for each user. It builds the inner query with db.Select("COUNT(*)").From("orders"), correlates it to the outer query, then passes sub.AsExpression() and the order_count alias to SelectSub.
That removes the need to assemble the entire correlated expression as one string passed to SelectExpr. For pipeline code that creates large projections, this keeps the subquery structure in the same builder flow as the outer query. Alias assignment is also explicit at the SelectSub call.
The boundary is worth noting. The example still supplies COUNT(*) as text to Select, so this release does not turn every SQL expression into a typed object. Its scope is the scalar subquery and its relationship to the outer query. That is a focused API addition, not a new query execution layer.
Column comparisons get dialect aware quoting ¶
The correlation uses EqCol("orders.user_id", "users.id") rather than treating the right side as a value. Relica quotes both identifiers for the active dialect. The published output uses double quotes for PostgreSQL and backticks for MySQL.
This distinction matters in generated joins and correlated predicates. A value comparison normally binds the right side as a parameter. A column comparison must render both sides as identifiers and preserve their qualified table names. EqCol makes that intent explicit while leaving the quoting decision to the dialect.
The same pattern now covers NotEqCol, GreaterThanCol, and LessThanCol. Data services can therefore express equality, inequality, and ordered column comparisons without dropping the predicate into raw SQL. The release notes do not describe additional operators beyond those four helpers.
Tests cover nesting and parameter order ¶
The release adds 21 test functions and 488 lines of test code. Coverage includes every supported dialect, correlated subqueries, parameter ordering, and the complete pattern reported in issue 31. Those cases target SQL generation, which is where nested builders tend to expose quoting and placeholder mistakes.
Parameter order is the operationally important part of that list. An outer query and a nested query can both contribute bound values. Generated SQL may still look valid when the placeholder sequence and argument sequence disagree, but the database then receives values in the wrong positions. The new coverage specifically includes that ordering path.
No breaking change or migration step appears in the notes, and the release is not marked as a prerelease. The notes also make no performance claim and provide no benchmark. Treat v0.13.0 as an additive query construction release, then run the existing dialect specific integration suite before replacing raw correlated expressions. The exact examples remain available on the v0.13.0 release page.
Where to get it ¶
- Release: Relica v0.13.0
- Repository: coregx/relica
- Tag:
v0.13.0