-
Notifications
You must be signed in to change notification settings - Fork 54
Description
I am using exqlite with the SpatiaLIte extension. This works so long as the inputs and outputs are textual, but this also leaves parsing geometry returned up to the user, which is unfortunate. It would be nice to be able to use the geo library to handle these en/decodings.
This works with PostGIS as libraries such as geo_postgis are able to register type extension modules with postgrex which allow the data being used in queries to be encoded and decoded into native Elixir types, in this case enabling the transparent use of the structs found in the geo library.
I initially thought it might make sense to having something similar in exqlite, whose encoding/decoding is not extensible. Considering that sqlite really only has a static set of types for storage, however, it may make more sense to do the en/decoding in the ecto adapter instead via loaders/dumpers.
While writing the loader and dumper for geometries should be straight-forward, a way to make those available to the adapter is still missing.
With this issue, I'm looking to start a dialogue as to what this can/should look like. With an acceptable design and approach defined, I can take a swing at it with a PR .. but I'd rather start with something that has a chance of being accepted :)