Referencing Column at runtime
This could be a Typescript question, but there may also be a better way to achieve my goal with Drizzle.
The resulting query is fine, but I get the following type error on the variable column in
conditions.add(like(column, filter.value))
see attached screenshot.
I created a simple project on GitHub to illustrate the issue: https://github.com/tgourgon/dynamic-filter-drizzleorm-experiment
The question is, in this scenario, how do I reference a column dynamically while keeping the TS compiler happy, Or is there a better way altogether?GitHub
GitHub - tgourgon/dynamic-filter-drizzleorm-experiment
Contribute to tgourgon/dynamic-filter-drizzleorm-experiment development by creating an account on GitHub.

1 Reply
Here's how I'd do it: