valentinpalkovic/prisma-json-schema-generator

@db.VarChar(14): maxlength info is lost

Opened this issue · 2 comments

for example

dwmc     String?   @default("") @db.VarChar(50)

only output as

        "dwmc": {
          "type": [
            "string",
            "null"
          ],
          "default": ""
        },

is this a feature or a bug?

It is a feature. Is @db.VarChar the only field scalar type we have to consider?

benvd commented

I found this issue when trying to get "format": "uuid" added to the JSON schema for columns with @db.Uuid. Turns out this information isn't part of the DMMF, so I don't think a type generator can solve this without engine support.

There's a pull request about this: prisma/prisma-engines#2660