-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Description
What are you doing?
const User = this.sequelize.define('user', {
age: Sequelize.BIGINT
});
const age = BigInt(Number.MAX_SAFE_INTEGER).add(Number.MAX_SAFE_INTEGER);
return User.sync({force: true}).then(() => {
return User.create({age});
}).then(user => {
expect(BigInt(user.age).toString()).to.equal(age.toString());
return User.findAll({
where: {age}
});
}).then(users => {
expect(users).to.have.lengthOf(1);
expect(BigInt(users[0].age).toString()).to.equal(age.toString());
});What do you expect to happen?
Sequelize serializes the BigInt as a string and generates valid SQL.
What is actually happening?
SequelizeDatabaseError: invalid input syntax for integer: ""18014398509481982""
Dialect: any (but tested on PG)
Dialect version: any
Database version: any
Sequelize version: master
Tested with latest release: yes
Metadata
Metadata
Assignees
Labels
No labels