Feat: custom select on customTypes#1423
Conversation
mauriciabad
left a comment
There was a problem hiding this comment.
1st of all, thanks for your work on this library!
After that said, check out the 2 comments, they may be worth solving before merge, but if you want you can merge and tackle them in a following PR.
Another suggestion I have is to add the pertinent explanations in the documentation, so this feature is discoverable and developers know it exists and how it works. I assume this will be done in a separate PR, but I mention it anyway.
I'm specially interested on this feature because I'm developing a project that will use geospatial data (
POINTand more).
And, I'm more than happy to help if needed, although I'm not familiar with Drizzle's codebase, I may still be useful. 😊
f518d9f to
91741c3
Compare
7afd907 to
fbda882
Compare
|
LGTM! |
|
Getting this merged would be amazing. Working on custom PostGIS types and not having this is a big blocker. Thanks for the work on this @Angelelz |
|
Same, here. I also use geospatial data and this is needed. |
|
Please merge this! This would be super useful, especially in spatial applications! |
|
@AlexBlokh @AndriiSherman @dankochetov @Angelelz please take a look |
|
@Angelelz any chance you can marge this? |
|
Only core team member can merge PRs. Just upvote and wait for when they have time to review. |
|
Is there any feedback from the drizzle team on this, at least? It seems there is pretty widespread support for this, and It's pretty disheartening from a library to see an issue you encounter has been pending for 6+ months. Will this get resolved? Are the devs uninterested in supporting this feature? Is there something wrong with the code? At least some background would be useful to understand next steps for builders. |
|
Unfortunately, we don't have enough capacity to look into this currently, but we agree that this is a useful feature and it will be eventually resolved. |
|
This feature would be super useful! |
|
Any news about this ? |
|
This would have been very helpfull in my current project. Any idea when progress might be made? |
This PR will close #554 and will close #1083.
I have added a new API for customTypes that allows wrapping the column name with custom sql. The syntax is the following:
You can then use the customType as follows:
Then, a select like this:
Will result in the following query:
Notice how as opposed to the suggestion in #1083 it's not necessary to define a
mapWithor an alias.By default, the column will be aliased to the column name, and the custom decoder can be defined the usual way with
fromDriver./claim #554
/claim #1083