Closed ggallovalle closed 1 year ago
Hey 👋
Kudos for digging into the codebase and figuring things out! 👏
There's actually a much easier way to achieve what you're looking for:
const rows = await kysely
.selectFrom("user")
.where(
({ cmpr, fn }) => cmpr(fn('lower', [fn('btrim', ['first_name'])]), '=', 'Johnny')
)
.selectAll()
.execute()
We won't change library internals due to external requirements. There has to be a very good reason for that - e.g. it's a serious blocker for some 3rd party dialect.
This has been fixed a while ago.
Hi I am loving this project and for a little bit of context I am writing type safe functions which are wrappers around sql functions without the use of expressed as a tree other than a Raw node.
sql``
string literal, but the restriction on parseFilter with just one argument are making it so that I can not use an ExpressionFor example I can do something like this with my wrapper
which produces the following Query
But even though that is a legitimate piece of code that could go into a
where
or anon
clause it throws an error when used as a one argument to functionswhere
andon
so I have to do some hacks to make it work.In am requesting that
parseFilter
to be more lax and not checkRawNode.is
, just let it be when is anisOperationNodeSource
. Or if is too much of a breaking change make it so that a node can inform is raw without actually beingkind === "RawNode
in the sense that a "RawNode" is a way of telling kyselyQueryCompiler
that "you know what you are doing" .Or any other suggestion that you all have.