Skip to content

createManyAndReturn fails with @ignore fields (field must be a known scalar or virtual) #25290

@benjamintd

Description

@benjamintd

Bug description

createManyAndReturn fails on models with @ignored columns.

The query engine panics with the following error: field must be a known scalar or virtual.

How to reproduce

A minimal reproduction example is available at https://github.com/benjamintd/prisma-panic-repro/tree/main.

  • Initialize a prisma schema with a model with at least one @ignore field.
  • Perform a createManyAndReturn operation on this model.

Expected behavior

  • The elements are successfully created and returned.

Prisma information

Included in the reproduction.

"prisma": "^5.20.0",
"@prisma/client": "^5.20.0"
generator client {
  provider = "prisma-client-js"
}

model User {
  id        String   @id @default(cuid())
  email     String   @unique
  ignored   String?   @ignore
  name      String?
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
}

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

Environment & setup

Tested both on MacOS and Linux machines.

Prisma Version

prisma                  : 5.20.0
@prisma/client          : 5.20.0
Computed binaryTarget   : darwin-arm64
Operating System        : darwin
Architecture            : arm64
Node.js                 : v22.8.0
Query Engine (Node-API) : libquery-engine 06fc58a368dc7be9fbbbe894adf8d445d208c284 (at node_modules/@prisma/engines/libquery_engine-darwin-arm64.dylib.node)
Schema Engine           : schema-engine-cli 06fc58a368dc7be9fbbbe894adf8d445d208c284 (at node_modules/@prisma/engines/schema-engine-darwin-arm64)
Schema Wasm             : @prisma/prisma-schema-wasm 5.20.0-12.06fc58a368dc7be9fbbbe894adf8d445d208c284
Default Engines Hash    : 06fc58a368dc7be9fbbbe894adf8d445d208c284
Studio                  : 0.502.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions