Skip to content

createAndCount reports input length instead of executor affected rows #30210

Description

@JoeRoddy

Type: mutation result bug. Target: Prisma 8 SQL ORM client.

The standalone run.ts wraps the public RuntimeQueryable so execute() returns { affectedRows: 0 }, then calls:

const reported = await orm({ context, runtime }).public.Post
  .createAndCount([{ id: "absent", title: "absent" }]);

The public result is 1, while direct PostgreSQL verification confirms that zero rows were inserted. Prisma's writing-data documentation describes count mutation terminals as returning the number affected, and the runtime queryable supplies that exact statistic.

Expected behavior: the public affected-row count should agree with the executor result and durable database state, including when zero rows are affected.

Suggested regression: a public runtime queryable returning 0, a number below the input length, and the full input length; empty and multi-row inputs; count parity with durable database state.

Primary source: mutation executor, writing-data documentation source.

Environment

  • @prisma/orm-postgres: 8.0.0-rc.8 (the live latest tag when reverified September 6, 2026)
  • Prisma CLI: 8.0.0-rc.13
  • TypeScript: 5.9.3
  • Node: 26.5.0
  • npm: 11.17.0
  • OS: macOS 26.6.2 arm64
  • PostgreSQL: 14.23

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions