marcbejar
Explore posts from serversDTDrizzle Team
•Created by buckwheat on 8/20/2024 in #help
Disable selection in table creation
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.
3 replies
DTDrizzle Team
•Created by Δάρκζυ on 8/19/2024 in #help
How can I handle ID collisions
I would also use UUID. Yes, it takes more space but the chances of getting collision are absurdly low. In this case as the collision probability is so low I would just send an error to the client and let the user repeat the action. If you are using multiple PUT, DELETE; POST operations in the same server/API call make sure to use Drizzle transactions so you don't need to undo anything manually in case of collision.
10 replies
DTDrizzle Team
•Created by marcbejar on 8/19/2024 in #help
Help with Join query
Makes sense, so I'm gonna make a query with two inner joins, so I have the tree tables information in the result. This results in something like:
Then what I understood is that i can use the map method to convert this array into an object with the common values and a new object "managers" that contains an array of the variable data. What I have done is the following:
And this results in:
That's the data that I need. Do you think this is the best approach or you think there is an optimal way doing this?
Thanks a lot for your time.
3 replies
DTDrizzle Team
•Created by marcbejar on 7/22/2024 in #help
Compostie primary key of a composite primary key
Thank you very much for the answer. I will keep coding like so. Thanks a lot!
3 replies