Prisma1: Other postgres column types

Created on 18 May 2018  路  14Comments  路  Source: prisma/prisma1

Feature Request

What feature are you missing?
The ability to use postgres column types other than the basic string, integer, date, etc. Personally, I need to use ltree to represent a hierarchy, but others may want to use a geometry type, etc.

How could this feature look like in detail? Tradeoffs?
Probably something like a custom scalar where we describe how to serialise and deserialise into PostgreSQL or something. Many of these types will require specific operators or functions to query them propery (e.g. SELECT path FROM test WHERE path ~ '*.Astronomy.*' or ST_AsGeoJSON(geometry)), so there would need to be a way to run raw SQL like most ORMs have.

Any chance this is already possible? I'm interested in how I'd accomplish this in the meantime because I need to use an ltree for my project, so otherwise I'd need to use something else to access my database :/

kinfeature rf0-needs-spec areconnectopostgres

Most helpful comment

We'd also love jsonb support. Happy to help out if we can get some kind of consensus on how to implement

All 14 comments

This would be very useful for my project as well. In my case I need to support Date, Time, DateTime, Timestamp, Interval, Duration PostgreSQL types. I have failed to find a way to add my own custom scalar types

Here's a extract of the unsupported types I got when I introspected one of my client's postgres DBs:

  • Type 'daterange' is not yet supported.
  • Type 'time without time zone' is not yet supported.
  • Type 'ARRAY' is not yet supported.
  • Type 'tstzrange' is not yet supported.
  • Type 'interval' is not yet supported.
  • Type 'ARRAY' is not yet supported.
  • Type 'jsonb' is not yet supported.
  • Type 'bytea' is not yet supported.

Note: this project isn't something that will use prisma (most probably not), so feel free to prioritise as much or as less as you see fit. This is just to add some documentation on what is missing right now I suppose :)

Any updates on this?

We'd also love jsonb support. Happy to help out if we can get some kind of consensus on how to implement

Hello,
Can we know if this issue is part of the roadmap? If not, how can we do to make it available faster? In my case, this is a must, and I wish it could be available so we could adopt prisma!
Thanks

Also wondering on support for these field types. At the very least ARRAY and JSONB are musts for many of my use cases.

Support for jsonb would be very nice.

Any news on jsonb type support?

Add another voice for jsonb support. Ideally int4range would also be supported

+1 jsonb

+1 ARRAY

ARRAY type is a critical part of our application. Would it be possible to get the visibility on the timeframe on type support?

I believe it helps people make an informed decision on adoption. Thanks.

+1 jsonb and array

Hi Any update on the support of following columns types
JSONB
TSVECTOR
CITEXT

+1 jsonb

Was this page helpful?
0 / 5 - 0 ratings