不要怂,就是干,撸起袖子干!

Commit 93e64a9a by Sushant

docs: index hints

1 parent 720f7ec9
...@@ -16,7 +16,7 @@ const BelongsToMany = require('../../associations/belongs-to-many'); ...@@ -16,7 +16,7 @@ const BelongsToMany = require('../../associations/belongs-to-many');
const HasMany = require('../../associations/has-many'); const HasMany = require('../../associations/has-many');
const Op = require('../../operators'); const Op = require('../../operators');
const sequelizeError = require('../../errors'); const sequelizeError = require('../../errors');
const { IndexHints } = require('../../index-hints'); const IndexHints = require('../../index-hints');
const QuoteHelper = require('./query-generator/helpers/quote'); const QuoteHelper = require('./query-generator/helpers/quote');
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* @property FORCE * @property FORCE
* @property IGNORE * @property IGNORE
*/ */
exports.IndexHints = { // eslint-disable-line const IndexHints = module.exports = { // eslint-disable-line
USE: 'USE', USE: 'USE',
FORCE: 'FORCE', FORCE: 'FORCE',
IGNORE: 'IGNORE' IGNORE: 'IGNORE'
......
...@@ -15,6 +15,7 @@ const QueryInterface = require('./query-interface'); ...@@ -15,6 +15,7 @@ const QueryInterface = require('./query-interface');
const Transaction = require('./transaction'); const Transaction = require('./transaction');
const QueryTypes = require('./query-types'); const QueryTypes = require('./query-types');
const TableHints = require('./table-hints'); const TableHints = require('./table-hints');
const IndexHints = require('./index-hints');
const sequelizeErrors = require('./errors'); const sequelizeErrors = require('./errors');
const Promise = require('./promise'); const Promise = require('./promise');
const Hooks = require('./hooks'); const Hooks = require('./hooks');
...@@ -1228,6 +1229,12 @@ Sequelize.Promise = Promise; ...@@ -1228,6 +1229,12 @@ Sequelize.Promise = Promise;
Sequelize.TableHints = TableHints; Sequelize.TableHints = TableHints;
/** /**
* Available index hints to be used for querying data in mysql for index hints
* @see {@link IndexHints}
*/
Sequelize.IndexHints = IndexHints;
/**
* A reference to the sequelize transaction class. Use this to access isolationLevels and types when creating a transaction * A reference to the sequelize transaction class. Use this to access isolationLevels and types when creating a transaction
* @see {@link Transaction} * @see {@link Transaction}
* @see {@link Sequelize.transaction} * @see {@link Sequelize.transaction}
......
...@@ -6,7 +6,7 @@ const chai = require('chai'), ...@@ -6,7 +6,7 @@ const chai = require('chai'),
dialect = Support.getTestDialect(), dialect = Support.getTestDialect(),
_ = require('lodash'), _ = require('lodash'),
Op = require('../../../../lib/operators'), Op = require('../../../../lib/operators'),
{ IndexHints } = require('../../../../lib/index-hints'), IndexHints = require('../../../../lib/index-hints'),
QueryGenerator = require('../../../../lib/dialects/mysql/query-generator'); QueryGenerator = require('../../../../lib/dialects/mysql/query-generator');
if (dialect === 'mysql') { if (dialect === 'mysql') {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!