I am using Sequelize with Tedious to access SQL Server 2008.
When I do a sequelizeModel.findOne() I get this exception -
Unhandled
This is an issue in Sequelize -- it uses the OFFSET FETCH syntax, which is only supported in SQL Server 2012 and newer.
I submitted this as an issue on GitHub: https://github.com/sequelize/sequelize/issues/4404
The issue also affects the findById method. A workaround for that method is to use findAll with a where to specify the ID, and just only use the first element from the returned array:
Thing.findAll({
where: {id: id}
}).then( function(things) {
if (things.length == 0) {
// handle error
}
doSomething(things[0])
}).catch( function(err) {
// handle error
});