Skip to content

Commit

Permalink
fix(types): tableHint is missing for FindOptions (#15153)
Browse files Browse the repository at this point in the history
* fix(type): tableHint is missing for FindOptions

* fix(types): add table hint typing test
  • Loading branch information
lohart13 committed Oct 27, 2022
1 parent e051da5 commit b28ca6d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/model.d.ts
Expand Up @@ -36,7 +36,7 @@ import type {
Where,
} from './utils';
import type { SetRequired } from './utils/set-required';
import type { LOCK, Op, Optional, Transaction } from './index';
import type { LOCK, Op, Optional, Transaction, TableHints } from './index';

export interface Logging {
/**
Expand Down Expand Up @@ -926,6 +926,11 @@ export interface FindOptions<TAttributes = any>
* Throws an error if the query would return 0 results.
*/
rejectOnEmpty?: boolean | Error;

/**
* Use a table hint for the query, only supported in MSSQL.
*/
tableHint?: TableHints;
}

export interface NonNullFindOptions<TAttributes = any> extends FindOptions<TAttributes> {
Expand Down
6 changes: 6 additions & 0 deletions test/types/table-hint.ts
@@ -0,0 +1,6 @@
import { TableHints } from '@sequelize/core';
import { User } from './models/user';

User.findAll({
tableHint: TableHints.NOLOCK,
});

0 comments on commit b28ca6d

Please sign in to comment.