Search code examples
sql-servernode.jssequelize.jstedious

Queries with NOLOCK using Sequelize


I'd like to know how can I tell Sequelize to make SELECT queries with NOLOCK.

I'm using Sequelize with tedious to connect on SQL Server 2008.

I found nothing on the docs.


Solution

  • As of Sequelize v4.37.0, TableHint is now supported.

    Example:

    Project.findAll({
        tableHint: TableHints.NOLOCK // only can specify one
    });