cockroachdb / sequelize-cockroachdb

Use Sequelize and CockroachDB together
Apache License 2.0
53 stars 16 forks source link

Util is not defined on datatype validation #130

Closed Slaknoah closed 3 years ago

Slaknoah commented 3 years ago

Package returns this error when validating datatype ReferenceError: util is not defined at INTEGER.stringify (.../node_modules/sequelize-cockroachdb/source/index.js:89:9) at INTEGER.stringify (.../node_modules/sequelize/lib/data-types.js:24:19) at PostgresQueryGenerator.escape (.../node_modules/sequelize/lib/dialects/abstract/query-generator.js:985:30)

Looking at the index.js , it file turns out the util package that was used for formatting here if (!/^[-+]?[0-9]+$/.test(rep)) { throw new Sequelize.ValidationError( util.format('%j is not a valid integer', value) ); } was not imported. Please look into it.

rafiss commented 3 years ago

@Slaknoah Thanks for reporting this!

I've created https://github.com/cockroachdb/sequelize-cockroachdb/pull/131 to fix it