Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE]: Async Custom Types #2285

Open
DanielBaulig opened this issue May 9, 2024 · 0 comments
Open

[FEATURE]: Async Custom Types #2285

DanielBaulig opened this issue May 9, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@DanielBaulig
Copy link

Describe what you want

I was looking for a way to amend my database results with some additional data. Specifically I am storing a key in a database column and a corresponding value in a different service. I'd like to read the corresponding value from the other service and replace the key with the value in the query result. Currently this has to be done explicitly on every query, for every resulting row, which has really awkward ergonomics, is tedious and error prone.

It would be cool if custom data types could support async fromDriver and maybe even toDriver functions that would get awaited by Drizzle before returning the resulting rows. That would allow for transparent implementation of custom data types to handle functionality like outlined above. E.g. a column containing a cache key could transparently convert the key into the cached value upon read.

@DanielBaulig DanielBaulig added the enhancement New feature or request label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant