I am using Sequelize with Tedious to access SQL Server 2008.
When I do a sequelizeModel.findOne()
I get this exception -
Unhandled
Checking code node_modules/sequelize/lib/dialects/mssql/query-generator.js
saw that part
const dbVersion = this.sequelize.options.databaseVersion;
const isSQLServer2008 = semver.valid(dbVersion) && semver.lt(dbVersion, '11.0.0');
So I just added my connection configuration:
production: {
dialect: 'mssql',
databaseVersion: '10.50.6000',
host: process.env.DB_HOST,
username: process.env.DB_USER,
password: process.env.DB_PASS,
database: process.env.DB_NAME,
dialectOptions: {
options: {
useUTC: false,
dateFirst: 1,
enableArithAbort: true,
encrypt: false,
},
},
},