New feature: Common Table Expression enhancement
Following discussions in issue #161, @arikkfir and I have tackled several key gaps in the Common Table Expression (CTE) related APIs:
- Implemented support for the
WITH RECURSIVE
clause; - Enabled the use of CTE tables in
JOIN
andWHERE
clauses, excludingFROM
; - Incorporated
WITH
support inUPDATE
andDELETE
statements.
To introduce these features, we've made substantial API updates designed to be backward compatible, ensuring no disruption to existing implementations. However, all users of the CTE APIs should be cognizant of these enhancements.
CTEQuery
vsCTETable
:- In prior versions, a quirk in the design automatically appended all table names defined in
CTEBuilder
to theFROM
clause of aSELECT
statement, which hindered the exclusive use of CTE tables inJOIN
orWHERE
clauses. - Based on the conversation in issue #163, we proposed two solutions and selected the most viable. To summarize, the new API
CTEQuery
constructs CTE queries without any unintended consequences; meanwhile,CTETable
retains its original functionality, effectively turning the previous side effect into a deliberate feature.
- In prior versions, a quirk in the design automatically appended all table names defined in
- Introduction of
CTEQueryBuilder
:CTEQueryBuilder
is now the sole builder for crafting CTE query expressions, replacing the previous approach.CTETableBuilder
has been repurposed as a type alias forCTEQueryBuilder
and is deprecated. It is advised that this alias may be phased out in upcoming releases.
What's New
- Recursive CTE support added by @arikkfir in #162
- Overhaul of the CTE API by @huandu in issue #163
- A new method
SelectMore
inSelectBuilder
allows for the addition of further columns to aSELECT
statement post theSelect()
method call.
New Contributors
Full Changelog: v1.28.0...v1.29.0