-
-
Notifications
You must be signed in to change notification settings - Fork 12
Closed
Description
Reproduction: Attempt to update any model with a BigInt primary key:
model Account {
accountId BigInt @id @default(autoincrement()) @map("account_id")
email String
@@map("account")
}zenstack.Account.update({
data: {
email: 'foo@bar.org',
},
where: {
accountId: 1n
}
});Error:
SyntaxError: Failed to parse String to BigInt
at addBigIntValidation (/node_modules/@zenstackhq/orm/dist/index.js:3701:23)
at <anonymous> (/node_modules/@zenstackhq/orm/dist/index.js:4095:40)
at with (/node_modules/ts-pattern/dist/index.js:1:7550)
at makePrimitiveSchema (/node_modules/@zenstackhq/orm/dist/index.js:4093:408)
at <anonymous> (/node_modules/@zenstackhq/orm/dist/index.js:4826:32)
at forEach (1:11)
at makeUpdateDataSchema (/node_modules/@zenstackhq/orm/dist/index.js:4799:34)
at makeUpdateSchema (/node_modules/@zenstackhq/orm/dist/index.js:4756:18)
at validate (/node_modules/@zenstackhq/orm/dist/index.js:4045:16)
at <anonymous> (/node_modules/@zenstackhq/orm/dist/index.js:3476:87)
at with (/node_modules/ts-pattern/dist/index.js:1:7550)
at handle (/node_modules/@zenstackhq/orm/dist/index.js:3476:31)
at handle (/node_modules/@zenstackhq/orm/dist/index.js:3474:16)
at <anonymous> (/node_modules/@zenstackhq/orm/dist/index.js:6866:34)
at proceed (/node_modules/@zenstackhq/orm/dist/index.js:6864:51)
at <anonymous> (/node_modules/@zenstackhq/orm/dist/index.js:6863:41)
at cb (/node_modules/@zenstackhq/orm/dist/index.js:6467:41)
at then (/node_modules/@zenstackhq/orm/dist/index.js:6474:14)
This appears to be due to what is being passed to the addBigIntValidation function:
{
attr: {
name: "@map",
args: [
[Object ...]
],
},
val: "account_id",
}
Metadata
Metadata
Assignees
Labels
No labels