Replies: 2 comments 1 reply
-
i'd love something similar to this - i'm writing a single database, multi tenant app and i would like to paranoidly enforce that every query or update drizzle runs contains a where clause on |
Beta Was this translation helpful? Give feedback.
-
maybe this is similar to #1513 |
Beta Was this translation helpful? Give feedback.
-
I was sharing some use-cases/ideas for hooks on discord until I realized (& was suggested to me) to better bring the topic into github. I hope the format is okay, mostly just copy pasting my messages for now
[..] right now I'd love hooks/middleware when selecting to be able to sort certain fields in app after retrieving and adding virtual fields to each row based on app logic would be fantastic, the last could be done as part of the query, my current problem is more that I don't want to have to manually add this stuff on each query, don't want to have it as part of the schema, and would prefer not to have to wrap the query into it's own function, so would be amazing if I could add hooks when creating the schema like
I think Drizzle already being a "layer" on top of my queries makes it a great place to provide those functionalities, what do you think?
(from discord)
or soft-deletes, something like
just some pseudo-code to "visualize" the idea
(from discord)
also to prevent some data from leaking, maybe something like this
only if
id
was specifically set to be included will it be returned, or something like this, possibly even more specific based on other things(from discord)
or maybe something like the following even before the query's been run
(from discord)
Beta Was this translation helpful? Give feedback.
All reactions