You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working with Dirzzle ORM for PostgreSQL in TypeScript, and I'm trying to improve the type safety of my code. Specifically, I'm wondering if there's a way to infer the type of the where clause in a query, so that I can avoid using any in my function signatures.
In this function, I'm using condition?: any to accept any type of condition for the where clause. However, I'd like to replace any with a more specific type that corresponds to the actual type of the where clause.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm working with Dirzzle ORM for PostgreSQL in TypeScript, and I'm trying to improve the type safety of my code. Specifically, I'm wondering if there's a way to infer the type of the
where
clause in a query, so that I can avoid usingany
in my function signatures.Here's an example of what I'm currently doing:
In this function, I'm using
condition?: any
to accept any type of condition for thewhere
clause. However, I'd like to replace any with a more specific type that corresponds to the actual type of the where clause.Beta Was this translation helpful? Give feedback.
All reactions