-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add filter
clause support at AggregateFunctionBuilder
.
#208
add filter
clause support at AggregateFunctionBuilder
.
#208
Conversation
filter
clause at AggregateFunctionBuilder
.filter
clause support at AggregateFunctionBuilder
.
🤔 Maybe. On the other hand, too many nested callbacks starts to look messy.
We could go towards more generic We already have these "semantic" parent nodes like I originally called the node tree AST but renamed it to "operation nodes" since they are not actually SQL AST, but kinda like "kysely query builder AST" or something 😄 |
Sounds good!
😆 KyselyAST™️ has a nice ring to it! |
Have slept on it, think this is more aligned with Kysely's API philosophy.
29edd74
to
6462c36
Compare
brought up by @thelinuxlich on discord.
Postgres [1] [2] & SQLite support
filter
clause when using aggregate functions, with syntax as follows:Its a simple alternative to using
case...when...then...end
inside the aggregate function.This PR adds
filterWhere
,filterWhereExists
,filterWhereNotExists
,filterWhereRef
,orFilterWhere
,orFilterWhereExists
,orFilterWhereNotExists
&orFiltereWhereRef
toAggregateFunctionBuilder
.Some things to consider..
where
is nested infilter
, maybe its more intuitive and future-proof to make aFilterBuilder
that implementsWhereInterface
, and makefilter
accept aFilterBuilderCallback
instead of acting as thewhere
itself?maybe we should renamewent with it, feels more aligned with Kysely's API philosophy.filter
tofilterWhere
to not hidewhere
from caller?filter
clause is a thing, maybe we should rename the existingFilterNode
, parsers, etc and introduce a newFilterNode
?