Skip to content

::INET column type not supported when creating #24129

@davidgg

Description

@davidgg

Bug description

Related to #17929 (comment)

Inserting a inet column type triggers an error. Both for create and createMany

Error occurred during query execution:
ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(Error { kind: ToSql(0), cause: Some(AddrParseError(Ip)) }), transient: false })
    at In.handleRequestError (node_modules/@prisma/client/runtime/library.js:122:7044)
    at In.handleAndLogRequestError 
    at In.request 
    at async l
    at async retrieve 
    at async runJob{

How to reproduce

Create a table with the inet type

model Subnet {
  id      String @id @default(cuid())
  subnet  String @db.Inet
}

Insert into the table

 await prisma.subnet.create({ data: { subnet: "0.0.0.0/8" } });

An error is thrown

Expected behavior

Prisma inserts correctly

Prisma information

Schema

model Subnet {
  id      String @id @default(cuid())
  subnet  String @db.Inet
}

Query

 await prisma.subnet.create({ data: { subnet: "0.0.0.0/8" } });

Environment & setup

  • OS: macOS
  • Database: PostgreSQL 16.2
  • Node.js version: v21.6.2

Prisma Version

5.13.0

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