Class HavingSqlTranslator

Assembly: redb.Core.Pro.dll

Dialect-agnostic translator for HAVING JSON predicates produced by
redb.Core.Query.Grouping.HavingPredicateParser. Emits SQL fragments built around
a caller-supplied column resolver, so it can serve both Postgres (pvt."x") and
MSSql (pvt.[x$Descaped]) Pro builders.

public static class HavingSqlTranslator

Inheritance

Object→HavingSqlTranslator

Methods

CollectPropsFields(JsonElement, List<string>)

Walks the HAVING JSON node tree and accumulates every props-field reference

public static void CollectPropsFields(JsonElement node, List<string> sink)

ConditionFields(string?)

Every field path a condition reads ($field nodes), for the builder to join or pivot them.

public static List<string> ConditionFields(string? conditionJson)

RenderAggregate(AggregateRequest, SqlParameterCollector, Func<string, string>)

SQL of one aggregate of a grouping: COUNT(*), COUNT(CASE WHEN <condition> THEN 1 END) for a

public static string RenderAggregate(AggregateRequest aggregate, SqlParameterCollector collector, Func<string, string> resolveColumn)

Translate(JsonElement, SqlParameterCollector, Func<string, string>)

Translates a HAVING root node into a boolean SQL expression. Constants are added as

public static string Translate(JsonElement node, SqlParameterCollector collector, Func<string, string> resolveColumn)