Postgres features + extensibility: RETURNING, ON CONFLICT variants, CTEs, lateral joins, expression rendering, infix-operator registry#130
Merged
JordanMarr merged 2 commits intoJun 9, 2026
Conversation
…CONFLICT, CTEs, lateral joins, expression rendering Adds: returning/fromSelect/setRaw/whereExists/whereNotExists/havingRaw, orderByRaw/orderByAlias(Desc), nullsFirst/nullsLast, distinctOn, lateralJoin, composable ON CONFLICT (onConflict/doNothing/doUpdate/doUpdateCoalesce, raw targets, partial-index WHERE); caseWhen/caseWhenMulti, castAs, countDistinct, cte/cteFrom, rawExpr, lateralCol, inlineValue, greatest/least, interval; expression rendering for arithmetic/method-call projections with parameter binding; anonymous-record AS aliases (incl. ExpressionNormalizer fix for renamed fields); aggregates over Option-wrapped (leftJoin') columns; scalar function names emitted uppercase. 42 new unit tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…l packages (e.g. pgvector) Adds SqlHydraInfixOperatorAttribute + an InfixOperators registry (assembly scan on first query compile, AssemblyLoad subscription for lazy plugins, manual register for tests) and recognizes registered 2-arg functions as infix operators in select/orderBy/where expression rendering. InternalsVisibleTo for the SqlHydra.Query.Pgvector package. Tests cover both the manual-register and the assembly-attribute auto-discovery paths. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
be9eb97 to
565f2de
Compare
Owner
|
Merged to beta-4.1 branch and published as 4.1.0-beta.1! |
JordanMarr
added a commit
that referenced
this pull request
Jun 10, 2026
…y sites Forward-ports the issue #134 parameter-collision fix from main. Kept beta's 4.1.0-beta.1 version (discarded main's 4.0.2 bump) and extended the shared EmitSelectInto fix to the subquery sites PR #130 added on this branch, which carried the identical fresh-collector-then-merge bug: - Exists / NotExists - WITH / CTEs - JOIN / lateral-join subqueries - INSERT ... FROM SELECT All 260 unit tests pass (incl. #130's 43 new tests). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Owner
|
@michaelglass FYI, there was a bug #134 that affected the main branch (released as v4.0.2) which has also been merged into beta-4.1 branch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Second (and final) PR from #125, following #129. All additive; two commits: features, then the extensibility seam that builds on them.
New CE operations:
returning(insert/update/delete),fromSelect,setRaw,whereExists/whereNotExists,havingRaw,orderByRaw/orderByAlias(/Desc),nullsFirst/nullsLast,distinctOn,lateralJoin, and ON CONFLICT variants (composableonConflict→doNothing/doUpdate/doUpdateCoalesce, raw targets, partial-index WHERE).New functions:
caseWhen/caseWhenMulti,castAs<'T>,countDistinct,cte/cteFrom,rawExpr,lateralCol,inlineValue,greatest/least,interval.Expression rendering: arithmetic + method calls in
select/orderByprojections (withparameter binding), anonymous-record
ASaliases (incl. anExpressionNormalizerfix forrenamed fields), aggregates over Option-wrapped (
leftJoin') columns, scalar function namesemitted uppercase.
IR:
LeftJoinLateral,NullsOrdering, parameterizedOrderByRaw/RawColumn,Exists/NotExists,DistinctOn,Returning, conflict variants.Extensibility (2nd commit):
SqlHydraInfixOperatorAttribute+ anInfixOperatorsregistry —external packages register SQL infix operators via an assembly attribute, auto-discovered on
first query compile. Registered 2-arg functions render as infix in select/orderBy/where. Plus a
public
tryGetOrderByColumnhelper so extension packages can resolve orderBy column selectorswithout internals access.
16 files, +2028/−194 — 43 new unit tests (every new op asserts its emitted SQL), validated
against ~1,100 real queries in a private project.
Together these unblock https://github.com/michaelglass/SqlHydra.Query.Pgvector.
Developed with AI assistance.