Thoughts on updating `ash_geo` to follow current ash extension patterns?
I'm considering using
ash_geo
, but noticed it doesn't use the same patterns extensions like ash_money
for installing postgres extensions and types. I know it's not owned by the ash-project
org, but wanted to see what people thing about giving it an overhaul to have a nicer installation experience and follow current extension patterns.14 Replies
If people think it would be helpful to update it as suggested, I can do it as I don't really want to pull it in with it's current implementation.
Mind you I completely understand it was made prior to Ash 3.0. So, not throwing shade on it at all. 🙂
The main thing I'd like to address is the runtime.exs config for adding types to postgrex which feels weird. I'll look into it
I use ashgeo in a handful of projects, but only to give me the ash types, everything else I just fallback to using fragments
That’s what I’m considering as well.
the macros do work, but I prefer fragments for the most part 🙂
@kernel did you have to do the Postgrex types module in the runtime.exs config per the docs? I noticed when my migrations generated, it was just
:geometry
type and not more specific to the actual type like point shown in the geo_postgis
docs.
For example
ok, looks like the best thing to do is to create new type and specify the storage typeyeah I think you still need to do the Postgrex things in general
like I had to tweak Postgrex types for the Duration type to work etc
I just do it in repo.ex
ala

I don't think any other Ash types use types that aren't already supported by Postgrex, that's why you generally don't need to do it
I remember needing to do it to add range support to postgrex like 10+ years ago, but it seems like they've added range support sometime between now and then 🤣
Cool. Thanks. I’ve been struggling through it since this packages set up is significantly more work than others.
Appreciate the help
whichever way you go about it, you will still need to add types to postgrex iirc 🙂
https://github.com/elixir-ecto/postgrex
as theres no geo stuff in postgrex
ash_money doesn't need it for example as it uses a composite type, which postgrex represents as a tuple
Finally got it working. Definitely needs an overhaul to the latest Ash Type patterns. But, at least it works now. 🙂
note that geography types don't work OOB
and you'd generally use it when you want to do distance measurements in meters etc (on a global scale)
Oh I ran into setting this up now and see what you mean 🙄
Could be worthwhile for someone to do an igniter installer even if we don’t upgrade it to the latest type patterns.