UNPKG

8.23 kBTypeScriptView Raw
1interface OpTypes {
2 /**
3 * Operator -|- (PG range is adjacent to operator)
4 *
5 * ```js
6 * [Op.adjacent]: [1, 2]
7 * ```
8 * In SQL
9 * ```sql
10 * -|- [1, 2)
11 * ```
12 */
13 readonly adjacent: unique symbol;
14 /**
15 * Operator ALL
16 *
17 * ```js
18 * [Op.gt]: {
19 * [Op.all]: literal('SELECT 1')
20 * }
21 * ```
22 * In SQL
23 * ```sql
24 * > ALL (SELECT 1)
25 * ```
26 */
27 readonly all: unique symbol;
28 /**
29 * Operator AND
30 *
31 * ```js
32 * [Op.and]: {a: 5}
33 * ```
34 * In SQL
35 * ```sql
36 * AND (a = 5)
37 * ```
38 */
39 readonly and: unique symbol;
40 /**
41 * Operator ANY ARRAY (PG only)
42 *
43 * ```js
44 * [Op.any]: [2,3]
45 * ```
46 * In SQL
47 * ```sql
48 * ANY ARRAY[2, 3]::INTEGER
49 * ```
50 *
51 * Operator LIKE ANY ARRAY (also works for iLike and notLike)
52 *
53 * ```js
54 * [Op.like]: { [Op.any]: ['cat', 'hat']}
55 * ```
56 * In SQL
57 * ```sql
58 * LIKE ANY ARRAY['cat', 'hat']
59 * ```
60 */
61 readonly any: unique symbol;
62 /**
63 * Operator BETWEEN
64 *
65 * ```js
66 * [Op.between]: [6, 10]
67 * ```
68 * In SQL
69 * ```sql
70 * BETWEEN 6 AND 10
71 * ```
72 */
73 readonly between: unique symbol;
74 /**
75 * With dialect specific column identifiers (PG in this example)
76 *
77 * ```js
78 * [Op.col]: 'user.organization_id'
79 * ```
80 * In SQL
81 * ```sql
82 * = "user"."organization_id"
83 * ```
84 */
85 readonly col: unique symbol;
86 /**
87 * Operator <@ (PG array contained by operator)
88 *
89 * ```js
90 * [Op.contained]: [1, 2]
91 * ```
92 * In SQL
93 * ```sql
94 * <@ [1, 2)
95 * ```
96 */
97 readonly contained: unique symbol;
98 /**
99 * Operator @> (PG array contains operator)
100 *
101 * ```js
102 * [Op.contains]: [1, 2]
103 * ```
104 * In SQL
105 * ```sql
106 * @> [1, 2)
107 * ```
108 */
109 readonly contains: unique symbol;
110 /**
111 * Operator LIKE
112 *
113 * ```js
114 * [Op.endsWith]: 'hat'
115 * ```
116 * In SQL
117 * ```sql
118 * LIKE '%hat'
119 * ```
120 */
121 readonly endsWith: unique symbol;
122 /**
123 * Operator =
124 *
125 * ```js
126 * [Op.eq]: 3
127 * ```
128 * In SQL
129 * ```sql
130 * = 3
131 * ```
132 */
133 readonly eq: unique symbol;
134 /**
135 * Operator >
136 *
137 * ```js
138 * [Op.gt]: 6
139 * ```
140 * In SQL
141 * ```sql
142 * > 6
143 * ```
144 */
145 readonly gt: unique symbol;
146 /**
147 * Operator >=
148 *
149 * ```js
150 * [Op.gte]: 6
151 * ```
152 * In SQL
153 * ```sql
154 * >= 6
155 * ```
156 */
157 readonly gte: unique symbol;
158 /**
159 * Operator ILIKE (case insensitive) (PG only)
160 *
161 * ```js
162 * [Op.iLike]: '%hat'
163 * ```
164 * In SQL
165 * ```sql
166 * ILIKE '%hat'
167 * ```
168 */
169 readonly iLike: unique symbol;
170 /**
171 * Operator IN
172 *
173 * ```js
174 * [Op.in]: [1, 2]
175 * ```
176 * In SQL
177 * ```sql
178 * IN [1, 2]
179 * ```
180 */
181 readonly in: unique symbol;
182 /**
183 * Operator ~* (PG only)
184 *
185 * ```js
186 * [Op.iRegexp]: '^[h|a|t]'
187 * ```
188 * In SQL
189 * ```sql
190 * ~* '^[h|a|t]'
191 * ```
192 */
193 readonly iRegexp: unique symbol;
194 /**
195 * Operator IS
196 *
197 * ```js
198 * [Op.is]: null
199 * ```
200 * In SQL
201 * ```sql
202 * IS null
203 * ```
204 */
205 readonly is: unique symbol;
206 /**
207 * Operator LIKE
208 *
209 * ```js
210 * [Op.like]: '%hat'
211 * ```
212 * In SQL
213 * ```sql
214 * LIKE '%hat'
215 * ```
216 */
217 readonly like: unique symbol;
218 /**
219 * Operator <
220 *
221 * ```js
222 * [Op.lt]: 10
223 * ```
224 * In SQL
225 * ```sql
226 * < 10
227 * ```
228 */
229 readonly lt: unique symbol;
230 /**
231 * Operator <=
232 *
233 * ```js
234 * [Op.lte]: 10
235 * ```
236 * In SQL
237 * ```sql
238 * <= 10
239 * ```
240 */
241 readonly lte: unique symbol;
242 /**
243 * Operator @@
244 *
245 * ```js
246 * [Op.match]: Sequelize.fn('to_tsquery', 'fat & rat')`
247 * ```
248 * In SQL
249 * ```sql
250 * @@ to_tsquery('fat & rat')
251 * ```
252 */
253 readonly match: unique symbol;
254 /**
255 * Operator !=
256 *
257 * ```js
258 * [Op.ne]: 20
259 * ```
260 * In SQL
261 * ```sql
262 * != 20
263 * ```
264 */
265 readonly ne: unique symbol;
266 /**
267 * Operator &> (PG range does not extend to the left of operator)
268 *
269 * ```js
270 * [Op.noExtendLeft]: [1, 2]
271 * ```
272 * In SQL
273 * ```sql
274 * &> [1, 2)
275 * ```
276 */
277 readonly noExtendLeft: unique symbol;
278 /**
279 * Operator &< (PG range does not extend to the right of operator)
280 *
281 * ```js
282 * [Op.noExtendRight]: [1, 2]
283 * ```
284 * In SQL
285 * ```sql
286 * &< [1, 2)
287 * ```
288 */
289 readonly noExtendRight: unique symbol;
290 /**
291 * Operator NOT
292 *
293 * ```js
294 * [Op.not]: true
295 * ```
296 * In SQL
297 * ```sql
298 * IS NOT TRUE
299 * ```
300 */
301 readonly not: unique symbol;
302 /**
303 * Operator NOT BETWEEN
304 *
305 * ```js
306 * [Op.notBetween]: [11, 15]
307 * ```
308 * In SQL
309 * ```sql
310 * NOT BETWEEN 11 AND 15
311 * ```
312 */
313 readonly notBetween: unique symbol;
314 /**
315 * Operator NOT ILIKE (case insensitive) (PG only)
316 *
317 * ```js
318 * [Op.notILike]: '%hat'
319 * ```
320 * In SQL
321 * ```sql
322 * NOT ILIKE '%hat'
323 * ```
324 */
325 readonly notILike: unique symbol;
326 /**
327 * Operator NOT IN
328 *
329 * ```js
330 * [Op.notIn]: [1, 2]
331 * ```
332 * In SQL
333 * ```sql
334 * NOT IN [1, 2]
335 * ```
336 */
337 readonly notIn: unique symbol;
338 /**
339 * Operator !~* (PG only)
340 *
341 * ```js
342 * [Op.notIRegexp]: '^[h|a|t]'
343 * ```
344 * In SQL
345 * ```sql
346 * !~* '^[h|a|t]'
347 * ```
348 */
349 readonly notIRegexp: unique symbol;
350 /**
351 * Operator NOT LIKE
352 *
353 * ```js
354 * [Op.notLike]: '%hat'
355 * ```
356 * In SQL
357 * ```sql
358 * NOT LIKE '%hat'
359 * ```
360 */
361 readonly notLike: unique symbol;
362 /**
363 * Operator NOT REGEXP (MySQL/PG only)
364 *
365 * ```js
366 * [Op.notRegexp]: '^[h|a|t]'
367 * ```
368 * In SQL
369 * ```sql
370 * NOT REGEXP/!~ '^[h|a|t]'
371 * ```
372 */
373 readonly notRegexp: unique symbol;
374 /**
375 * Operator OR
376 *
377 * ```js
378 * [Op.or]: [{a: 5}, {a: 6}]
379 * ```
380 * In SQL
381 * ```sql
382 * (a = 5 OR a = 6)
383 * ```
384 */
385 readonly or: unique symbol;
386 /**
387 * Operator && (PG array overlap operator)
388 *
389 * ```js
390 * [Op.overlap]: [1, 2]
391 * ```
392 * In SQL
393 * ```sql
394 * && [1, 2)
395 * ```
396 */
397 readonly overlap: unique symbol;
398 /**
399 * Internal placeholder
400 *
401 * ```js
402 * [Op.placeholder]: true
403 * ```
404 */
405 readonly placeholder: unique symbol;
406 /**
407 * Operator REGEXP (MySQL/PG only)
408 *
409 * ```js
410 * [Op.regexp]: '^[h|a|t]'
411 * ```
412 * In SQL
413 * ```sql
414 * REGEXP/~ '^[h|a|t]'
415 * ```
416 */
417 readonly regexp: unique symbol;
418 /**
419 * Operator LIKE
420 *
421 * ```js
422 * [Op.startsWith]: 'hat'
423 * ```
424 * In SQL
425 * ```sql
426 * LIKE 'hat%'
427 * ```
428 */
429 readonly startsWith: unique symbol;
430 /**
431 * Operator << (PG range strictly left of operator)
432 *
433 * ```js
434 * [Op.strictLeft]: [1, 2]
435 * ```
436 * In SQL
437 * ```sql
438 * << [1, 2)
439 * ```
440 */
441 readonly strictLeft: unique symbol;
442 /**
443 * Operator >> (PG range strictly right of operator)
444 *
445 * ```js
446 * [Op.strictRight]: [1, 2]
447 * ```
448 * In SQL
449 * ```sql
450 * >> [1, 2)
451 * ```
452 */
453 readonly strictRight: unique symbol;
454 /**
455 * Operator LIKE
456 *
457 * ```js
458 * [Op.substring]: 'hat'
459 * ```
460 * In SQL
461 * ```sql
462 * LIKE '%hat%'
463 * ```
464 */
465 readonly substring: unique symbol;
466 /**
467 * Operator VALUES
468 *
469 * ```js
470 * [Op.values]: [4, 5, 6]
471 * ```
472 * In SQL
473 * ```sql
474 * VALUES (4), (5), (6)
475 * ```
476 */
477 readonly values: unique symbol;
478}
479export declare const Op: OpTypes;
480export default Op;