Better error message when Enum Error Due To "Connector"
See original GitHub issueSee https://github.com/prisma/prisma/issues/3449#issuecomment-690278707 for current issue content.
Bug description
I started a fresh Blitz.js project recently with Prisma as the DB ORM. In playing with setting up my schemas I tried to use an enum
and received the following error back when using enum
s with Postgres
and MySQL
:
error: Error validating: You defined the enum `ImageTypes`. But the current connector does not support enums.
Others report it as working, so I wonder if this is an issue with something in my specific setup or a deeper bug. @janpio mentioned to me on the Blitz.js Slack to drop an issue to go over this issue.
How to reproduce
Create a new Blitz.js project, add a new model using their generator which adds to the Prisma schema as expected. Then add an enum
definition and you can either try to use it or just have it there.
Expected behavior
An enum
is generated in the DB for use between it and the application.
Prisma information
...
model Image {
id Int @default(autoincrement()) @id
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
url String
type ImageTypes @default(STEP)
user User @relation(fields: [userId], references: [id])
userId Int
}
enum ImageTypes {
AVATAR
STEP
HEADER
}
Environment & setup
- OS: Pop_OS 20.04 (Ubuntu 20.04)
- Database: MySQL 8, Postgres 13 (via Docker)
- Node.js version: 14.8.0
- Prisma version: 2.5.1
@prisma/cli : 2.5.1
Current platform : debian-openssl-1.1.x
Query Engine : query-engine c88925ce44a9b89b4351aec85ba6a28979d2658e (at node_modules/@prisma/cli/query-engine-debian-openssl-1.1.x)
Migration Engine : migration-engine-cli c88925ce44a9b89b4351aec85ba6a28979d2658e (at node_modules/@prisma/cli/migration-engine-debian-openssl-1.1.x)
Introspection Engine : introspection-core c88925ce44a9b89b4351aec85ba6a28979d2658e (at node_modules/@prisma/cli/introspection-engine-debian-openssl-1.1.x)
Format Binary : prisma-fmt c88925ce44a9b89b4351aec85ba6a28979d2658e (at node_modules/@prisma/cli/prisma-fmt-debian-openssl-1.1.x)
Studio : 0.261.0
I will feel really dumb if this is a syntax thing, but I think I have it correct.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Let’s reopen this as a problem in the error message then:
This should probably better be something along the lines of
(Problem 1:
connector
is not a user level concept. Problem 2: It does not list the limiting provider/connector)Sorry for the delay in response. Work has been very hectic for me so I haven’t had a chance to try this again after you tested it. There was also an update to Blitz so maybe after updating the whole stack something will click into place. I will test this weekend and see if I can recreate it in a minimal example repo.