IssueRaiser

Geolocation/Spatial types support

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.

Posted by teebot on Mar 10, 2020, 9:26 AM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.3,500 issues0 comments

support (Software)

Geolocation/Spatial types support

teebotMar 10, 2020, 9:26 AM

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.

Comments (0)

No comments yet. Start the discussion.

Comment on this issue