Is it really so that I cannot use CIDR column toge...
# prisma-client
r
Is it really so that I cannot use CIDR column together with PostgreSQL and Prisma?
Copy code
ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(Error { kind: FromSql(9), cause: Some(WrongType { postgres: Cidr, rust: "core::option::Option<std::net::ip::IpAddr>" }) }) })
I found this: https://github.com/prisma/specs/issues/273 but have no idea how to make use of it 😄
https://www.prisma.io/dataguide/postgresql/introduction-to-data-types the type is here as well, but this document does not tell me how do I use that in a schema file 🤦‍♂️
Finally found a section that states that you can use Unsupported() with these
However, now the create method doesn't exist anymore for that entity
Had to add ? to the end of that because it wasn't a required field
And off to the next one. We are using TypeScript and now there is no type mapping for that field so the insert fails for that reason:
Copy code
Unknown arg `ip` in data.ip for type IdentityEventCreateInput. Available args:
So the unsupported type is just completely missing from the type
Oh yeah. Should've read the fineprint
"*Note*: If a model has mandatory
Unsupported
fields
, the generated client will not include
create
or
update
methods for that model."
And before that: "`Unsupported` fields are not available in the generated Prisma Client API, but can still use
queryRaw
to query these fields."
Which basically is saying that I'm shit out of luck 😄
Changed the column to VarChar for now 🤷‍♂️
👍 1
a
Hi @Rintsi 👋🏾 We're sorry for the frustration you've gone through to resolve your issue. You are right, Prisma doesn't support CIDR native type yet. Could you create a GitHub issue this.
👋 1
r
For sure, just need to find some time to do that properly 🙂