question about partial query for joins
I am running a query for 'table1', and have an inner join for the user related to 'table1' by userId, but I wanted to limit the columns for user, becuase as my query stands now, I am leaking password hashes and that's obv unsafe.
Can someone point me in the right direction? It's late and I have been digging in the docs for something to alleviate this but I am trying not to resolve to using raw sql template.
Here is my query as it stands:
2 Replies
I think I figured it our with object mapping in the select, crazy what a little rest will do 😅
Hey @Richard Prins. Happy to hear that you solved your issue. We have guide for including/excluding columns in query, so it might be useful in future.
https://orm.drizzle.team/learn/guides/include-or-exclude-columns
By the way, could you please tell what are you building with Drizzle?
Drizzle ORM - Include or Exclude Columns in Query
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.