Skip to content

Geolocation/Spatial types support #1798

@teebot

Description

@teebot

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions