Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit 3dbb318e
authored
Apr 09, 2019
by
Sam Alexander
Committed by
Sushant
Apr 09, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(types): add regex operators to WhereOperators (#10738)
1 parent
f6dd9435
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
types/lib/model.d.ts
types/test/where.ts
types/lib/model.d.ts
View file @
3dbb318
...
@@ -236,6 +236,42 @@ export interface WhereOperators {
...
@@ -236,6 +236,42 @@ export interface WhereOperators {
* String contains value.
* String contains value.
*/
*/
[
Op
.
substring
]?:
string
;
[
Op
.
substring
]?:
string
;
/**
* MySQL/PG only
*
* Matches regular expression, case sensitive
*
* Example: `[Op.regexp]: '^[h|a|t]'` becomes `REGEXP/~ '^[h|a|t]'`
*/
[
Op
.
regexp
]?:
string
;
/**
* MySQL/PG only
*
* Does not match regular expression, case sensitive
*
* Example: `[Op.notRegexp]: '^[h|a|t]'` becomes `NOT REGEXP/!~ '^[h|a|t]'`
*/
[
Op
.
notRegexp
]?:
string
;
/**
* PG only
*
* Matches regular expression, case insensitive
*
* Example: `[Op.iRegexp]: '^[h|a|t]'` becomes `~* '^[h|a|t]'`
*/
[
Op
.
iRegexp
]?:
string
;
/**
* PG only
*
* Does not match regular expression, case insensitive
*
* Example: `[Op.notIRegexp]: '^[h|a|t]'` becomes `!~* '^[h|a|t]'`
*/
[
Op
.
notIRegexp
]?:
string
;
}
}
/** Example: `[Op.or]: [{a: 5}, {a: 6}]` becomes `(a = 5 OR a = 6)` */
/** Example: `[Op.or]: [{a: 5}, {a: 6}]` becomes `(a = 5 OR a = 6)` */
...
...
types/test/where.ts
View file @
3dbb318
...
@@ -41,6 +41,10 @@ let operators: WhereOperators = {
...
@@ -41,6 +41,10 @@ let operators: WhereOperators = {
[
Op
.
contains
]:
[
1
,
2
],
// @> [1, 2] (PG array contains operator)
[
Op
.
contains
]:
[
1
,
2
],
// @> [1, 2] (PG array contains operator)
[
Op
.
contained
]:
[
1
,
2
],
// <@ [1, 2] (PG array contained by operator)
[
Op
.
contained
]:
[
1
,
2
],
// <@ [1, 2] (PG array contained by operator)
[
Op
.
any
]:
[
2
,
3
],
// ANY ARRAY[2, 3]::INTEGER (PG only)
[
Op
.
any
]:
[
2
,
3
],
// ANY ARRAY[2, 3]::INTEGER (PG only)
[
Op
.
regexp
]:
'^[h|a|t]'
,
// REGEXP/~ '^[h|a|t]' (MySQL/PG only)
[
Op
.
notRegexp
]:
'^[h|a|t]'
,
// NOT REGEXP/!~ '^[h|a|t]' (MySQL/PG only)
[
Op
.
iRegexp
]:
'^[h|a|t]'
,
// ~* '^[h|a|t]' (PG only)
[
Op
.
notIRegexp
]:
'^[h|a|t]'
// !~* '^[h|a|t]' (PG only)
};
};
operators
=
{
operators
=
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment