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

Commit b9338669 by Simon Schick

refactor(operators): use namespaced symbol names for operators (#10830)

BREAKING CHANGE:

If you have relied on accessing sequelize operators via `Symbol.for('gt')` etc. you must now prefix them with `sequelize.operator` eg.
`Symbol.for('sequelize.operator.gt')`
1 parent 14f72cdd
Showing with 44 additions and 39 deletions
......@@ -13,3 +13,8 @@ Sequelize v6 will only support Node 8 and up
Operator aliases were soft deprecated via the `opt-in` option `operatorAlises` in v5 they have been entirely removed.
Please refer to previous changelogs for the migration guide.
### Renamed operator symbols
If you have relied on accessing sequelize operators via `Symbol.for('gt')` etc. you must now prefix them with `sequelize.operator` eg.
`Symbol.for('sequelize.operator.gt')`
......@@ -46,45 +46,45 @@
* @property join
*/
const Op = {
eq: Symbol.for('eq'),
ne: Symbol.for('ne'),
gte: Symbol.for('gte'),
gt: Symbol.for('gt'),
lte: Symbol.for('lte'),
lt: Symbol.for('lt'),
not: Symbol.for('not'),
is: Symbol.for('is'),
in: Symbol.for('in'),
notIn: Symbol.for('notIn'),
like: Symbol.for('like'),
notLike: Symbol.for('notLike'),
iLike: Symbol.for('iLike'),
notILike: Symbol.for('notILike'),
startsWith: Symbol.for('startsWith'),
endsWith: Symbol.for('endsWith'),
substring: Symbol.for('substring'),
regexp: Symbol.for('regexp'),
notRegexp: Symbol.for('notRegexp'),
iRegexp: Symbol.for('iRegexp'),
notIRegexp: Symbol.for('notIRegexp'),
between: Symbol.for('between'),
notBetween: Symbol.for('notBetween'),
overlap: Symbol.for('overlap'),
contains: Symbol.for('contains'),
contained: Symbol.for('contained'),
adjacent: Symbol.for('adjacent'),
strictLeft: Symbol.for('strictLeft'),
strictRight: Symbol.for('strictRight'),
noExtendRight: Symbol.for('noExtendRight'),
noExtendLeft: Symbol.for('noExtendLeft'),
and: Symbol.for('and'),
or: Symbol.for('or'),
any: Symbol.for('any'),
all: Symbol.for('all'),
values: Symbol.for('values'),
col: Symbol.for('col'),
placeholder: Symbol.for('placeholder'),
join: Symbol.for('join')
eq: Symbol.for('sequelize.operator.eq'),
ne: Symbol.for('sequelize.operator.ne'),
gte: Symbol.for('sequelize.operator.gte'),
gt: Symbol.for('sequelize.operator.gt'),
lte: Symbol.for('sequelize.operator.lte'),
lt: Symbol.for('sequelize.operator.lt'),
not: Symbol.for('sequelize.operator.not'),
is: Symbol.for('sequelize.operator.is'),
in: Symbol.for('sequelize.operator.in'),
notIn: Symbol.for('sequelize.operator.notIn'),
like: Symbol.for('sequelize.operator.like'),
notLike: Symbol.for('sequelize.operator.notLike'),
iLike: Symbol.for('sequelize.operator.iLike'),
notILike: Symbol.for('sequelize.operator.notILike'),
startsWith: Symbol.for('sequelize.operator.startsWith'),
endsWith: Symbol.for('sequelize.operator.endsWith'),
substring: Symbol.for('sequelize.operator.substring'),
regexp: Symbol.for('sequelize.operator.regexp'),
notRegexp: Symbol.for('sequelize.operator.notRegexp'),
iRegexp: Symbol.for('sequelize.operator.iRegexp'),
notIRegexp: Symbol.for('sequelize.operator.notIRegexp'),
between: Symbol.for('sequelize.operator.between'),
notBetween: Symbol.for('sequelize.operator.notBetween'),
overlap: Symbol.for('sequelize.operator.overlap'),
contains: Symbol.for('sequelize.operator.contains'),
contained: Symbol.for('sequelize.operator.contained'),
adjacent: Symbol.for('sequelize.operator.adjacent'),
strictLeft: Symbol.for('sequelize.operator.strictLeft'),
strictRight: Symbol.for('sequelize.operator.strictRight'),
noExtendRight: Symbol.for('sequelize.operator.noExtendRight'),
noExtendLeft: Symbol.for('sequelize.operator.noExtendLeft'),
and: Symbol.for('sequelize.operator.and'),
or: Symbol.for('sequelize.operator.or'),
any: Symbol.for('sequelize.operator.any'),
all: Symbol.for('sequelize.operator.all'),
values: Symbol.for('sequelize.operator.values'),
col: Symbol.for('sequelize.operator.col'),
placeholder: Symbol.for('sequelize.operator.placeholder'),
join: Symbol.for('sequelize.operator.join')
};
module.exports = Op;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!