-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Geolocation/Spatial types support #1798
Copy link
Copy link
Open
prisma/prisma-engines
#4208Labels
kind/featureA request for a new feature.A request for a new feature.topic: geotopic: native database types
Description
Currently prisma2 does not support spatial types. This is not exactly an edge case since according to google 9% of sql files on github carry out spatial queries.
I was thinking how that feature could work but it’s probably a bit naive given I don’t know the implementation details of prisma2 :
- Have a schema annotation @@spatial so that migrate would create a geometry type in postGIS, a geojson field in mongo etc.
- generate could type this to a geoJSON definition
- client would translate queries to St_FromGeoJSON in postGIS, leave the geoJSON as is in Mongo
The rationale behind this is that you basically want migrate to create the right spatial type in your db, currently schema/code-first does not work and introspect detects spatial as a string. Yuo also want client to perform CRUD on tables containing spatial types, currently CRUD fails if the spatial type is in the select so a .raw request is the only workaround.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
kind/featureA request for a new feature.A request for a new feature.topic: geotopic: native database types