Disable selection in table creation

i have column in ai_model table named api_key , i do not want that in any response and want only when I actually select for it like in typeorm @CreateDateColumn({ select: false, type: 'timestamp' }) createdAt: Date; how can I handle this in drizzle
2 Replies
marcbejar
marcbejar5w ago
If you are running the query in the server I think it's quite safe to just "don't query" that column. Maybe you can take a look to getTableColums() function of Drizzle: https://orm.drizzle.team/learn/guides/include-or-exclude-columns If you are running the query in the client I think the best way to handle this is via permissions. But this depends on the DB architecture you are using. For example PostgreSQL have the Row Level Security RLS.
Drizzle ORM - Include or Exclude Columns in Query
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
buckwheat
buckwheat3w ago
thanks
Want results from more Discord servers?
Add your server