Is there a way to execute an ExpressionBuilder?
Using the expression hasDogNamed example from the docs
Is there a way I can provide an ExpressionBuilder an instance of Kysely<DB> so that it can execute the query?
5 Replies
Figured it out. The function createExpressionBuilder accepts an optional QueryExecutor
You can get a QueryExecutor from your Kysely<DB> instance.
Hey 👋
It's not really meant to be executed, I'd strongly advice you NOT to do this.
Hmmm. I'm trying to create reusable select queries so that the same shape can be returned in different circumstances. Do you have an alternative suggestion?
Here's an example.
This way I can get the same Job object when I select a job directly or include a Job in another query, like getting a JobApplication.
I'm looking for a way to define reusable shapes.
oh. That's pretty simple. Thanks!!