Bug description
If the ID of a row is different in the database from the ID used to create that row, Query engine panics with:
Invalid response data: the query result was required, but an empty Object((Weak)) was returned instead
How to reproduce
- Use this SQL schema to reproduce
DROP TABLE IF EXISTS `User`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `User` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
- Use this
schema.prisma to generate the client.
model User {
id Int @id
name String
}
Note that the schema is missing the autoincrement that is present in the SQL
- Send the following query through the client
const data = await prisma.user.create({
data: {
id: 0,
name: 'Alice',
},
})
- Observe the error
Invalid response data: the query result was required, but an empty Object((Weak)) was returned instead
Here is a video that demonstrates this error: https://www.loom.com/share/40f6c9f4392a4f75a246d34319d710d8
Expected behavior
Possibly a known error?
Or a runtime failure that detects the client being out of sync with the schema.
Prisma information
@prisma/cli : 2.0.0-beta.8
Additional Information
Bug description
If the ID of a row is different in the database from the ID used to create that row, Query engine panics with:
How to reproduce
schema.prismato generate the client.Note that the schema is missing the
autoincrementthat is present in the SQLHere is a video that demonstrates this error: https://www.loom.com/share/40f6c9f4392a4f75a246d34319d710d8
Expected behavior
Possibly a known error?
Or a runtime failure that detects the client being out of sync with the schema.
Prisma information
Additional Information