Unable to use dbgenerated uuid_to_bin for ID field: "Could not figure out an ID in create"
See original GitHub issueHi Team,
I am facing an issue where I am unable to use dbgenerated
for mysql8 function uuid_to_bin to associate with my default id . I am getting error as below. I have attached my schema and probably other related details that might be required. Let me know if i am doing this wrong , i did not find anything relevant in documentation that can help.
PANIC in query-engine/connectors/sql-query-connector/src/database/operations/write.rs:73:22
Could not figure out an ID in create
This is a non-recoverable error which probably happens when the Prisma Query Engine has a panic.
Versions
Name | Version |
---|---|
Node | v14.16.0 |
OS | rhel-openssl-1.1.x |
Prisma Client | 2.22.1 |
Query Engine | query-engine 60cc71d884972ab4e897f0277c4b84383dddaf6c |
Database | undefined |
Schema
model User {
id Bytes @id @db.Binary(16) @default(dbgenerated("(uuid_to_bin(uuid()))"))
email String @unique @db.VarChar(320)
name String?
contact String @db.VarChar(15)
}
Query
mutation {
createOneUser(data: {
name: "X"
email: "X"
contact: "X"
}) {
id
email
name
contact
}
}
Logs
prisma:tryLoadEnv Environment variables loaded from /home/xxx/xxx/prisma-test/.env
prisma:tryLoadEnv Environment variables loaded from /home/xxx/xxxt/.env
prisma:client clientVersion: 2.22.1
prisma:engine { cwd: '/home/xxx/xxx/prisma-test/prisma' }
prisma:engine Search for Query Engine in /home/xxx/xxx//prisma-test/node_modules/.prisma/client
prisma:engine Search for Query Engine in /home/xxx/xxx//prisma-test/node_modules/.prisma/client
plusX Execution permissions of /home/xxx/xxx/prisma-test/node_modules/.prisma/client/query-engine-rhel-openssl-1.1.x are fine
prisma:engine { flags: [ '--enable-raw-queries', '--port', '43487' ] }
plusX Execution permissions of /home/xxx/xxx//prisma-test/node_modules/.prisma/client/query-engine-rhel-openssl-1.1.x are fine
prisma:engin
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:15 (7 by maintainers)
Top Results From Across the Web
prisma PANIC:could not figure out an ID in create
Well, the problem was that i was using a dummy mysql table where ID column was not set to primary key and auto...
Read more >Supporting features without a PSL equivalent - Prisma
How to support database features that do not have an equivalent syntax in Prisma ... uses the Prisma-level uuid() function to set the...
Read more >Getting more with PostgreSQL purpose-built data types - AWS
CREATE TABLE leads ( id bigint PRIMARY KEY, source_id varchar(36), ... or creating a CONSTRAINT on the column checking the format, we can't...
Read more >typeorm function uuid_generate_v4() does not exist - You.com
I am trying to use node-pg-migrate and run migrations to create tables in my node ... from "typeorm"; import { Field, ID, ObjectType...
Read more >UUID Binary Representation For UUID_TO_BIN and EF Core ...
For example, if we insert an item using EF with ID ... There is no known workaround except to not use direct SQL...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@janpio can confirm it works using the dev packages:
Can you please open a new issue @plattenbrand? The previous posters here had their problem fixed, so if you are still having something like this we need a separate issue so we can properly investigate. Thanks!