Skip to content

Client not respecting schema types #25365

@zshannon

Description

@zshannon

Bug description

In my prisma schema, I have a type like:

model Property {
    key String
    value String 
}

If I store a value like "2024-10-04T01:23:56.900+00:00" in value, I subsequently get errors from the prisma client when I attempt to store other string values in value because the client has decided value is a DateTime.

How to reproduce

  1. Create a model with a String field.
  2. Store an ISO-8601 compatible string in it.
  3. Attempt to store a string that is not ISO-8601 compatible in it.

Expected behavior

The prisma client should respect the types defined in the prisma schema.

Prisma information

// Add your schema.prisma
// Add your code using Prisma Client

Environment & setup

  • OS: macOS
  • Database: SQLite
  • Node.js version: v20.11.0

Prisma Version

prisma                  : 5.20.0
@prisma/client          : 5.20.0
Computed binaryTarget   : darwin-arm64
Operating System        : darwin
Architecture            : arm64
Node.js                 : v20.11.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
Preview Features        : driverAdapters

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions