@abedmurrar/objection 4.0.0-alpha.0 → 4.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +103 -67
- package/lib/index.mjs +6 -0
- package/lib/initialize.js +6 -9
- package/lib/model/AjvValidator.js +235 -282
- package/lib/model/Model.js +653 -823
- package/lib/model/ModifierNotFoundError.js +5 -7
- package/lib/model/NotFoundError.js +14 -18
- package/lib/model/RelationDoesNotExistError.js +6 -9
- package/lib/model/ValidationError.js +33 -41
- package/lib/model/Validator.js +15 -21
- package/lib/model/getModel.js +1 -3
- package/lib/model/graph/ModelGraph.js +44 -64
- package/lib/model/graph/ModelGraphBuilder.js +164 -217
- package/lib/model/graph/ModelGraphEdge.js +31 -43
- package/lib/model/graph/ModelGraphNode.js +192 -231
- package/lib/model/inheritModel.js +9 -18
- package/lib/model/modelBindKnex.js +48 -62
- package/lib/model/modelClone.js +79 -98
- package/lib/model/modelColPropMap.js +16 -26
- package/lib/model/modelConcurrency.js +24 -0
- package/lib/model/modelId.js +44 -49
- package/lib/model/modelJsonAttributes.js +56 -76
- package/lib/model/modelParseRelations.js +68 -67
- package/lib/model/modelQueryProps.js +76 -107
- package/lib/model/modelSet.js +92 -112
- package/lib/model/modelTableMetadata.js +60 -72
- package/lib/model/modelToJson.js +120 -150
- package/lib/model/modelUtils.js +30 -37
- package/lib/model/modelValidate.js +34 -42
- package/lib/model/modelValues.js +78 -91
- package/lib/model/modelVisitor.js +22 -29
- package/lib/objection.js +42 -67
- package/lib/queryBuilder/FunctionBuilder.js +231 -279
- package/lib/queryBuilder/InternalOptions.js +19 -24
- package/lib/queryBuilder/JoinBuilder.js +116 -149
- package/lib/queryBuilder/QueryBuilder.js +1009 -1271
- package/lib/queryBuilder/QueryBuilderBase.js +647 -865
- package/lib/queryBuilder/QueryBuilderContext.js +14 -21
- package/lib/queryBuilder/QueryBuilderContextBase.js +20 -29
- package/lib/queryBuilder/QueryBuilderOperationSupport.js +462 -536
- package/lib/queryBuilder/QueryBuilderUserContext.js +19 -25
- package/lib/queryBuilder/RawBuilder.js +58 -73
- package/lib/queryBuilder/ReferenceBuilder.js +232 -270
- package/lib/queryBuilder/RelationExpression.js +322 -380
- package/lib/queryBuilder/StaticHookArguments.js +94 -106
- package/lib/queryBuilder/ValueBuilder.js +100 -112
- package/lib/queryBuilder/expressions.js +86 -116
- package/lib/queryBuilder/functions/mysql.js +642 -697
- package/lib/queryBuilder/graph/GraphAction.js +44 -59
- package/lib/queryBuilder/graph/GraphData.js +7 -9
- package/lib/queryBuilder/graph/GraphFetcher.js +115 -151
- package/lib/queryBuilder/graph/GraphNodeDbExistence.js +114 -152
- package/lib/queryBuilder/graph/GraphOperation.js +16 -22
- package/lib/queryBuilder/graph/GraphOptions.js +143 -185
- package/lib/queryBuilder/graph/GraphUpsert.js +167 -241
- package/lib/queryBuilder/graph/delete/GraphDelete.js +8 -13
- package/lib/queryBuilder/graph/delete/GraphDeleteAction.js +44 -62
- package/lib/queryBuilder/graph/insert/GraphInsert.js +99 -128
- package/lib/queryBuilder/graph/insert/GraphInsertAction.js +151 -193
- package/lib/queryBuilder/graph/insert/JoinRowGraphInsertAction.js +57 -79
- package/lib/queryBuilder/graph/patch/GraphPatch.js +8 -13
- package/lib/queryBuilder/graph/patch/GraphPatchAction.js +181 -234
- package/lib/queryBuilder/graph/recursiveUpsert/GraphRecursiveUpsert.js +16 -21
- package/lib/queryBuilder/graph/recursiveUpsert/GraphRecursiveUpsertAction.js +80 -110
- package/lib/queryBuilder/join/JoinResultColumn.js +14 -18
- package/lib/queryBuilder/join/JoinResultParser.js +88 -101
- package/lib/queryBuilder/join/RelationJoiner.js +205 -288
- package/lib/queryBuilder/join/TableNode.js +117 -144
- package/lib/queryBuilder/join/TableTree.js +60 -76
- package/lib/queryBuilder/join/utils.js +10 -16
- package/lib/queryBuilder/operations/DelegateOperation.js +93 -133
- package/lib/queryBuilder/operations/DeleteOperation.js +33 -37
- package/lib/queryBuilder/operations/FindByIdOperation.js +20 -28
- package/lib/queryBuilder/operations/FindByIdsOperation.js +17 -23
- package/lib/queryBuilder/operations/FindOperation.js +114 -131
- package/lib/queryBuilder/operations/FirstOperation.js +14 -19
- package/lib/queryBuilder/operations/FromOperation.js +69 -88
- package/lib/queryBuilder/operations/InsertAndFetchOperation.js +28 -39
- package/lib/queryBuilder/operations/InsertGraphAndFetchOperation.js +25 -35
- package/lib/queryBuilder/operations/InsertGraphOperation.js +77 -98
- package/lib/queryBuilder/operations/InsertOperation.js +132 -165
- package/lib/queryBuilder/operations/InstanceDeleteOperation.js +27 -36
- package/lib/queryBuilder/operations/InstanceFindOperation.js +9 -13
- package/lib/queryBuilder/operations/InstanceInsertOperation.js +13 -17
- package/lib/queryBuilder/operations/InstanceUpdateOperation.js +32 -46
- package/lib/queryBuilder/operations/JoinRelatedOperation.js +66 -86
- package/lib/queryBuilder/operations/KnexOperation.js +4 -7
- package/lib/queryBuilder/operations/MergeOperation.js +32 -45
- package/lib/queryBuilder/operations/ObjectionToKnexConvertingOperation.js +131 -150
- package/lib/queryBuilder/operations/OnBuildKnexOperation.js +17 -23
- package/lib/queryBuilder/operations/OnBuildOperation.js +17 -23
- package/lib/queryBuilder/operations/OnErrorOperation.js +17 -23
- package/lib/queryBuilder/operations/QueryBuilderOperation.js +231 -270
- package/lib/queryBuilder/operations/RangeOperation.js +30 -40
- package/lib/queryBuilder/operations/RelateOperation.js +14 -21
- package/lib/queryBuilder/operations/ReturningOperation.js +12 -18
- package/lib/queryBuilder/operations/RunAfterOperation.js +17 -23
- package/lib/queryBuilder/operations/RunBeforeOperation.js +17 -23
- package/lib/queryBuilder/operations/UnrelateOperation.js +12 -17
- package/lib/queryBuilder/operations/UpdateAndFetchOperation.js +48 -65
- package/lib/queryBuilder/operations/UpdateOperation.js +104 -129
- package/lib/queryBuilder/operations/UpsertGraphAndFetchOperation.js +25 -35
- package/lib/queryBuilder/operations/UpsertGraphOperation.js +36 -55
- package/lib/queryBuilder/operations/WhereCompositeOperation.js +30 -39
- package/lib/queryBuilder/operations/WhereInOperation.js +34 -36
- package/lib/queryBuilder/operations/eager/EagerOperation.js +37 -52
- package/lib/queryBuilder/operations/eager/JoinEagerOperation.js +34 -44
- package/lib/queryBuilder/operations/eager/NaiveEagerOperation.js +4 -7
- package/lib/queryBuilder/operations/eager/WhereInEagerOperation.js +193 -251
- package/lib/queryBuilder/operations/jsonApi/WhereJsonHasOperation.js +18 -25
- package/lib/queryBuilder/operations/jsonApi/WhereJsonNotObjectOperation.js +25 -41
- package/lib/queryBuilder/operations/jsonApi/WhereJsonOperation.js +19 -20
- package/lib/queryBuilder/operations/jsonApi/WhereJsonOverlapsOperation.js +23 -21
- package/lib/queryBuilder/operations/jsonApi/mysqlJsonApi.js +106 -118
- package/lib/queryBuilder/operations/jsonApi/postgresJsonApi.js +79 -108
- package/lib/queryBuilder/operations/select/SelectOperation.js +37 -53
- package/lib/queryBuilder/operations/select/Selection.js +94 -105
- package/lib/queryBuilder/operations/whereInComposite/WhereInCompositeMsSqlOperation.js +68 -101
- package/lib/queryBuilder/operations/whereInComposite/WhereInCompositeOperation.js +65 -75
- package/lib/queryBuilder/operations/whereInComposite/WhereInCompositeSqliteOperation.js +75 -84
- package/lib/queryBuilder/parsers/jsonFieldExpressionParser.js +760 -859
- package/lib/queryBuilder/parsers/relationExpressionParser.js +840 -952
- package/lib/queryBuilder/transformations/CompositeQueryTransformation.js +10 -15
- package/lib/queryBuilder/transformations/QueryTransformation.js +4 -6
- package/lib/queryBuilder/transformations/WrapMysqlModifySubqueryTransformation.js +35 -49
- package/lib/queryBuilder/transformations/index.js +3 -9
- package/lib/queryBuilder/whereScopes.js +158 -186
- package/lib/relations/Relation.js +279 -363
- package/lib/relations/RelationDeleteOperation.js +16 -22
- package/lib/relations/RelationFindOperation.js +100 -133
- package/lib/relations/RelationInsertOperation.js +19 -27
- package/lib/relations/RelationOwner.js +167 -204
- package/lib/relations/RelationProperty.js +177 -217
- package/lib/relations/RelationUpdateOperation.js +16 -23
- package/lib/relations/belongsToOne/BelongsToOneDeleteOperation.js +11 -16
- package/lib/relations/belongsToOne/BelongsToOneInsertOperation.js +24 -35
- package/lib/relations/belongsToOne/BelongsToOneRelateOperation.js +30 -41
- package/lib/relations/belongsToOne/BelongsToOneRelation.js +33 -41
- package/lib/relations/belongsToOne/BelongsToOneUnrelateOperation.js +38 -53
- package/lib/relations/hasMany/HasManyInsertOperation.js +35 -51
- package/lib/relations/hasMany/HasManyRelateOperation.js +38 -54
- package/lib/relations/hasMany/HasManyRelation.js +30 -38
- package/lib/relations/hasMany/HasManyUnrelateOperation.js +19 -26
- package/lib/relations/hasOne/HasOneRelation.js +4 -7
- package/lib/relations/hasOneThrough/HasOneThroughRelation.js +4 -7
- package/lib/relations/manyToMany/ManyToManyModifyMixin.js +67 -90
- package/lib/relations/manyToMany/ManyToManyRelation.js +349 -451
- package/lib/relations/manyToMany/ManyToManySqliteModifyMixin.js +19 -26
- package/lib/relations/manyToMany/delete/ManyToManyDeleteOperation.js +3 -5
- package/lib/relations/manyToMany/delete/ManyToManyDeleteOperationBase.js +14 -20
- package/lib/relations/manyToMany/delete/ManyToManyDeleteSqliteOperation.js +3 -7
- package/lib/relations/manyToMany/find/ManyToManyFindOperation.js +71 -94
- package/lib/relations/manyToMany/insert/ManyToManyInsertOperation.js +31 -43
- package/lib/relations/manyToMany/relate/ManyToManyRelateOperation.js +50 -67
- package/lib/relations/manyToMany/unrelate/ManyToManyUnrelateOperation.js +4 -7
- package/lib/relations/manyToMany/unrelate/ManyToManyUnrelateOperationBase.js +20 -27
- package/lib/relations/manyToMany/unrelate/ManyToManyUnrelateSqliteOperation.js +5 -10
- package/lib/relations/manyToMany/update/ManyToManyUpdateOperation.js +3 -5
- package/lib/relations/manyToMany/update/ManyToManyUpdateOperationBase.js +55 -72
- package/lib/relations/manyToMany/update/ManyToManyUpdateSqliteOperation.js +3 -7
- package/lib/transaction.js +53 -83
- package/lib/utils/assert.js +15 -21
- package/lib/utils/buildUtils.js +17 -19
- package/lib/utils/classUtils.js +7 -11
- package/lib/utils/cloneDeep.js +365 -0
- package/lib/utils/createModifier.js +36 -41
- package/lib/utils/deprecate.js +8 -12
- package/lib/utils/identifierMapping.js +153 -192
- package/lib/utils/internalPropUtils.js +4 -8
- package/lib/utils/knexUtils.js +61 -56
- package/lib/utils/mixin.js +16 -23
- package/lib/utils/mysqlJsonPath.js +55 -40
- package/lib/utils/normalizeIds.js +110 -127
- package/lib/utils/objectUtils.js +236 -338
- package/lib/utils/parseFieldExpression.js +66 -44
- package/lib/utils/postgresJsonPath.js +48 -62
- package/lib/utils/promiseUtils/after.js +10 -13
- package/lib/utils/promiseUtils/afterReturn.js +10 -13
- package/lib/utils/promiseUtils/index.js +15 -17
- package/lib/utils/promiseUtils/isPromise.js +6 -9
- package/lib/utils/promiseUtils/map.js +75 -89
- package/lib/utils/promiseUtils/mapAfterAllReturn.js +17 -23
- package/lib/utils/promiseUtils/try.js +15 -18
- package/lib/utils/resolveModel.js +91 -94
- package/lib/utils/tmpColumnUtils.js +4 -13
- package/package.json +50 -23
- package/typings/objection/index.d.mts +362 -0
- package/typings/objection/index.d.ts +36 -9
- package/lib/.eslintrc.json +0 -8
- package/lib/queryBuilder/parsers/jsonFieldExpressionParser.pegjs +0 -97
- package/lib/queryBuilder/parsers/relationExpressionParser.pegjs +0 -141
- package/lib/utils/clone.js +0 -2329
|
@@ -1,884 +1,666 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
|
|
3
2
|
const { QueryBuilderOperationSupport } = require('./QueryBuilderOperationSupport');
|
|
4
3
|
const { isSqlite, isMsSql } = require('../utils/knexUtils');
|
|
5
|
-
|
|
6
4
|
const { KnexOperation } = require('./operations/KnexOperation');
|
|
5
|
+
const HavingSelector = /^(having|orHaving|andHaving)/;
|
|
6
|
+
const GroupBySelector = /^groupBy/;
|
|
7
7
|
const { expression } = require('./expressions');
|
|
8
|
-
const { WhereInOperation } = require('./operations/WhereInOperation');
|
|
9
8
|
const { MergeOperation } = require('./operations/MergeOperation');
|
|
10
9
|
const { SelectOperation } = require('./operations/select/SelectOperation');
|
|
11
10
|
const { ReturningOperation } = require('./operations/ReturningOperation');
|
|
12
11
|
const { WhereCompositeOperation } = require('./operations/WhereCompositeOperation');
|
|
13
12
|
const { WhereJsonOperation } = require('./operations/jsonApi/WhereJsonOperation');
|
|
14
13
|
const { WhereJsonOverlapsOperation } = require('./operations/jsonApi/WhereJsonOverlapsOperation');
|
|
15
|
-
|
|
16
|
-
const {
|
|
17
|
-
|
|
18
|
-
} = require('./operations/whereInComposite/WhereInCompositeOperation');
|
|
19
|
-
const {
|
|
20
|
-
WhereInCompositeSqliteOperation,
|
|
21
|
-
} = require('./operations/whereInComposite/WhereInCompositeSqliteOperation');
|
|
22
|
-
const {
|
|
23
|
-
WhereInCompositeMsSqlOperation,
|
|
24
|
-
} = require('./operations/whereInComposite/WhereInCompositeMsSqlOperation');
|
|
14
|
+
const { WhereInCompositeOperation, } = require('./operations/whereInComposite/WhereInCompositeOperation');
|
|
15
|
+
const { WhereInCompositeSqliteOperation, } = require('./operations/whereInComposite/WhereInCompositeSqliteOperation');
|
|
16
|
+
const { WhereInCompositeMsSqlOperation, } = require('./operations/whereInComposite/WhereInCompositeMsSqlOperation');
|
|
25
17
|
const { WhereJsonHasOperation } = require('./operations/jsonApi/WhereJsonHasOperation');
|
|
26
18
|
const { WhereJsonNotObjectOperation } = require('./operations/jsonApi/WhereJsonNotObjectOperation');
|
|
27
|
-
|
|
28
19
|
class QueryBuilderBase extends QueryBuilderOperationSupport {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
)
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
operator: '@>',
|
|
666
|
-
bool: 'or',
|
|
667
|
-
prefix: 'not',
|
|
668
|
-
}),
|
|
669
|
-
args,
|
|
670
|
-
);
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
whereJsonSubsetOf(...args) {
|
|
674
|
-
return this.addOperation(
|
|
675
|
-
new WhereJsonOperation('whereJsonSubsetOf', { operator: '<@', bool: 'and' }),
|
|
676
|
-
args,
|
|
677
|
-
);
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
andWhereJsonSubsetOf(...args) {
|
|
681
|
-
return this.whereJsonSubsetOf(...args);
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
orWhereJsonSubsetOf(...args) {
|
|
685
|
-
return this.addOperation(
|
|
686
|
-
new WhereJsonOperation('orWhereJsonSubsetOf', { operator: '<@', bool: 'or' }),
|
|
687
|
-
args,
|
|
688
|
-
);
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
whereJsonNotSubsetOf(...args) {
|
|
692
|
-
return this.addOperation(
|
|
693
|
-
new WhereJsonOperation('whereJsonNotSubsetOf', {
|
|
694
|
-
operator: '<@',
|
|
695
|
-
bool: 'and',
|
|
696
|
-
prefix: 'not',
|
|
697
|
-
}),
|
|
698
|
-
args,
|
|
699
|
-
);
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
andWhereJsonNotSubsetOf(...args) {
|
|
703
|
-
return this.whereJsonNotSubsetOf(...args);
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
orWhereJsonNotSubsetOf(...args) {
|
|
707
|
-
return this.addOperation(
|
|
708
|
-
new WhereJsonOperation('orWhereJsonNotSubsetOf', {
|
|
709
|
-
operator: '<@',
|
|
710
|
-
bool: 'or',
|
|
711
|
-
prefix: 'not',
|
|
712
|
-
}),
|
|
713
|
-
args,
|
|
714
|
-
);
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
whereJsonNotArray(...args) {
|
|
718
|
-
return this.addOperation(
|
|
719
|
-
new WhereJsonNotObjectOperation('whereJsonNotArray', {
|
|
720
|
-
bool: 'and',
|
|
721
|
-
compareValue: [],
|
|
722
|
-
}),
|
|
723
|
-
args,
|
|
724
|
-
);
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
orWhereJsonNotArray(...args) {
|
|
728
|
-
return this.addOperation(
|
|
729
|
-
new WhereJsonNotObjectOperation('orWhereJsonNotArray', {
|
|
730
|
-
bool: 'or',
|
|
731
|
-
compareValue: [],
|
|
732
|
-
}),
|
|
733
|
-
args,
|
|
734
|
-
);
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
whereJsonNotObject(...args) {
|
|
738
|
-
return this.addOperation(
|
|
739
|
-
new WhereJsonNotObjectOperation('whereJsonNotObject', {
|
|
740
|
-
bool: 'and',
|
|
741
|
-
compareValue: {},
|
|
742
|
-
}),
|
|
743
|
-
args,
|
|
744
|
-
);
|
|
745
|
-
}
|
|
746
|
-
|
|
747
|
-
orWhereJsonNotObject(...args) {
|
|
748
|
-
return this.addOperation(
|
|
749
|
-
new WhereJsonNotObjectOperation('orWhereJsonNotObject', {
|
|
750
|
-
bool: 'or',
|
|
751
|
-
compareValue: {},
|
|
752
|
-
}),
|
|
753
|
-
args,
|
|
754
|
-
);
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
whereJsonHasAny(...args) {
|
|
758
|
-
return this.addOperation(
|
|
759
|
-
new WhereJsonHasOperation('whereJsonHasAny', { bool: 'and', operator: '?|' }),
|
|
760
|
-
args,
|
|
761
|
-
);
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
orWhereJsonHasAny(...args) {
|
|
765
|
-
return this.addOperation(
|
|
766
|
-
new WhereJsonHasOperation('orWhereJsonHasAny', { bool: 'or', operator: '?|' }),
|
|
767
|
-
args,
|
|
768
|
-
);
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
whereJsonHasAll(...args) {
|
|
772
|
-
return this.addOperation(
|
|
773
|
-
new WhereJsonHasOperation('whereJsonHasAll', { bool: 'and', operator: '?&' }),
|
|
774
|
-
args,
|
|
775
|
-
);
|
|
776
|
-
}
|
|
777
|
-
|
|
778
|
-
orWhereJsonHasAll(...args) {
|
|
779
|
-
return this.addOperation(
|
|
780
|
-
new WhereJsonHasOperation('orWhereJsonHasAll', { bool: 'or', operator: '?&' }),
|
|
781
|
-
args,
|
|
782
|
-
);
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
whereJsonOverlaps(...args) {
|
|
786
|
-
return this.addOperation(
|
|
787
|
-
new WhereJsonOverlapsOperation('whereJsonOverlaps', { bool: 'and' }),
|
|
788
|
-
args,
|
|
789
|
-
);
|
|
790
|
-
}
|
|
791
|
-
|
|
792
|
-
andWhereJsonOverlaps(...args) {
|
|
793
|
-
return this.whereJsonOverlaps(...args);
|
|
794
|
-
}
|
|
795
|
-
|
|
796
|
-
orWhereJsonOverlaps(...args) {
|
|
797
|
-
return this.addOperation(
|
|
798
|
-
new WhereJsonOverlapsOperation('orWhereJsonOverlaps', { bool: 'or' }),
|
|
799
|
-
args,
|
|
800
|
-
);
|
|
801
|
-
}
|
|
802
|
-
|
|
803
|
-
whereJsonNotOverlaps(...args) {
|
|
804
|
-
return this.addOperation(
|
|
805
|
-
new WhereJsonOverlapsOperation('whereJsonNotOverlaps', { bool: 'and', prefix: 'not' }),
|
|
806
|
-
args,
|
|
807
|
-
);
|
|
808
|
-
}
|
|
809
|
-
|
|
810
|
-
andWhereJsonNotOverlaps(...args) {
|
|
811
|
-
return this.whereJsonNotOverlaps(...args);
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
orWhereJsonNotOverlaps(...args) {
|
|
815
|
-
return this.addOperation(
|
|
816
|
-
new WhereJsonOverlapsOperation('orWhereJsonNotOverlaps', { bool: 'or', prefix: 'not' }),
|
|
817
|
-
args,
|
|
818
|
-
);
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
whereJsonIsArray(fieldExpression) {
|
|
822
|
-
return this.whereJsonSupersetOf(fieldExpression, []);
|
|
823
|
-
}
|
|
824
|
-
|
|
825
|
-
orWhereJsonIsArray(fieldExpression) {
|
|
826
|
-
return this.orWhereJsonSupersetOf(fieldExpression, []);
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
whereJsonIsObject(fieldExpression) {
|
|
830
|
-
return this.whereJsonSupersetOf(fieldExpression, {});
|
|
831
|
-
}
|
|
832
|
-
|
|
833
|
-
orWhereJsonIsObject(fieldExpression) {
|
|
834
|
-
return this.orWhereJsonSupersetOf(fieldExpression, {});
|
|
835
|
-
}
|
|
836
|
-
|
|
837
|
-
whereColumn(...args) {
|
|
838
|
-
return this.addOperation(new KnexOperation('whereColumn'), args);
|
|
839
|
-
}
|
|
840
|
-
|
|
841
|
-
andWhereColumn(...args) {
|
|
842
|
-
return this.addOperation(new KnexOperation('andWhereColumn'), args);
|
|
843
|
-
}
|
|
844
|
-
|
|
845
|
-
orWhereColumn(...args) {
|
|
846
|
-
return this.addOperation(new KnexOperation('orWhereColumn'), args);
|
|
847
|
-
}
|
|
848
|
-
|
|
849
|
-
whereNotColumn(...args) {
|
|
850
|
-
return this.addOperation(new KnexOperation('whereNotColumn'), args);
|
|
851
|
-
}
|
|
852
|
-
|
|
853
|
-
andWhereNotColumn(...args) {
|
|
854
|
-
return this.addOperation(new KnexOperation('andWhereNotColumn'), args);
|
|
855
|
-
}
|
|
856
|
-
|
|
857
|
-
orWhereNotColumn(...args) {
|
|
858
|
-
return this.addOperation(new KnexOperation('orWhereNotColumn'), args);
|
|
859
|
-
}
|
|
860
|
-
|
|
861
|
-
onConflict(...args) {
|
|
862
|
-
return this.addOperation(new KnexOperation('onConflict'), args);
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
ignore(...args) {
|
|
866
|
-
return this.addOperation(new KnexOperation('ignore'), args);
|
|
867
|
-
}
|
|
868
|
-
|
|
869
|
-
merge(...args) {
|
|
870
|
-
return this.addOperation(new MergeOperation('merge'), args);
|
|
871
|
-
}
|
|
20
|
+
modify(...args) {
|
|
21
|
+
const func = args[0];
|
|
22
|
+
if (!func) {
|
|
23
|
+
return this;
|
|
24
|
+
}
|
|
25
|
+
if (args.length === 1) {
|
|
26
|
+
func.call(this, this);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
args[0] = this;
|
|
30
|
+
func(...args);
|
|
31
|
+
}
|
|
32
|
+
return this;
|
|
33
|
+
}
|
|
34
|
+
transacting(trx) {
|
|
35
|
+
this._context.knex = trx || null;
|
|
36
|
+
return this;
|
|
37
|
+
}
|
|
38
|
+
select(...args) {
|
|
39
|
+
return this.addOperation(new SelectOperation('select'), args);
|
|
40
|
+
}
|
|
41
|
+
insert(...args) {
|
|
42
|
+
return this.addOperation(new KnexOperation('insert'), args);
|
|
43
|
+
}
|
|
44
|
+
update(...args) {
|
|
45
|
+
return this.addOperation(new KnexOperation('update'), args);
|
|
46
|
+
}
|
|
47
|
+
delete(...args) {
|
|
48
|
+
return this.addOperation(new KnexOperation('delete'), args);
|
|
49
|
+
}
|
|
50
|
+
del(...args) {
|
|
51
|
+
return this.delete(...args);
|
|
52
|
+
}
|
|
53
|
+
forUpdate(...args) {
|
|
54
|
+
return this.addOperation(new KnexOperation('forUpdate'), args);
|
|
55
|
+
}
|
|
56
|
+
forShare(...args) {
|
|
57
|
+
return this.addOperation(new KnexOperation('forShare'), args);
|
|
58
|
+
}
|
|
59
|
+
forNoKeyUpdate(...args) {
|
|
60
|
+
return this.addOperation(new KnexOperation('forNoKeyUpdate'), args);
|
|
61
|
+
}
|
|
62
|
+
forKeyShare(...args) {
|
|
63
|
+
return this.addOperation(new KnexOperation('forKeyShare'), args);
|
|
64
|
+
}
|
|
65
|
+
skipLocked(...args) {
|
|
66
|
+
return this.addOperation(new KnexOperation('skipLocked'), args);
|
|
67
|
+
}
|
|
68
|
+
noWait(...args) {
|
|
69
|
+
return this.addOperation(new KnexOperation('noWait'), args);
|
|
70
|
+
}
|
|
71
|
+
as(...args) {
|
|
72
|
+
return this.addOperation(new KnexOperation('as'), args);
|
|
73
|
+
}
|
|
74
|
+
columns(...args) {
|
|
75
|
+
return this.addOperation(new SelectOperation('columns'), args);
|
|
76
|
+
}
|
|
77
|
+
column(...args) {
|
|
78
|
+
return this.addOperation(new SelectOperation('column'), args);
|
|
79
|
+
}
|
|
80
|
+
from(...args) {
|
|
81
|
+
return this.addOperation(new KnexOperation('from'), args);
|
|
82
|
+
}
|
|
83
|
+
fromJS(...args) {
|
|
84
|
+
return this.addOperation(new KnexOperation('fromJS'), args);
|
|
85
|
+
}
|
|
86
|
+
fromRaw(...args) {
|
|
87
|
+
return this.addOperation(new KnexOperation('fromRaw'), args);
|
|
88
|
+
}
|
|
89
|
+
into(...args) {
|
|
90
|
+
return this.addOperation(new KnexOperation('into'), args);
|
|
91
|
+
}
|
|
92
|
+
withSchema(...args) {
|
|
93
|
+
return this.addOperation(new KnexOperation('withSchema'), args);
|
|
94
|
+
}
|
|
95
|
+
table(...args) {
|
|
96
|
+
return this.addOperation(new KnexOperation('table'), args);
|
|
97
|
+
}
|
|
98
|
+
distinct(...args) {
|
|
99
|
+
return this.addOperation(new SelectOperation('distinct'), args);
|
|
100
|
+
}
|
|
101
|
+
distinctOn(...args) {
|
|
102
|
+
return this.addOperation(new SelectOperation('distinctOn'), args);
|
|
103
|
+
}
|
|
104
|
+
join(...args) {
|
|
105
|
+
return this.addOperation(new KnexOperation('join'), args);
|
|
106
|
+
}
|
|
107
|
+
joinRaw(...args) {
|
|
108
|
+
return this.addOperation(new KnexOperation('joinRaw'), args);
|
|
109
|
+
}
|
|
110
|
+
innerJoin(...args) {
|
|
111
|
+
return this.addOperation(new KnexOperation('innerJoin'), args);
|
|
112
|
+
}
|
|
113
|
+
leftJoin(...args) {
|
|
114
|
+
return this.addOperation(new KnexOperation('leftJoin'), args);
|
|
115
|
+
}
|
|
116
|
+
leftOuterJoin(...args) {
|
|
117
|
+
return this.addOperation(new KnexOperation('leftOuterJoin'), args);
|
|
118
|
+
}
|
|
119
|
+
rightJoin(...args) {
|
|
120
|
+
return this.addOperation(new KnexOperation('rightJoin'), args);
|
|
121
|
+
}
|
|
122
|
+
rightOuterJoin(...args) {
|
|
123
|
+
return this.addOperation(new KnexOperation('rightOuterJoin'), args);
|
|
124
|
+
}
|
|
125
|
+
outerJoin(...args) {
|
|
126
|
+
return this.addOperation(new KnexOperation('outerJoin'), args);
|
|
127
|
+
}
|
|
128
|
+
fullOuterJoin(...args) {
|
|
129
|
+
return this.addOperation(new KnexOperation('fullOuterJoin'), args);
|
|
130
|
+
}
|
|
131
|
+
crossJoin(...args) {
|
|
132
|
+
return this.addOperation(new KnexOperation('crossJoin'), args);
|
|
133
|
+
}
|
|
134
|
+
where(...args) {
|
|
135
|
+
return this.addOperation(new KnexOperation('where'), args);
|
|
136
|
+
}
|
|
137
|
+
andWhere(...args) {
|
|
138
|
+
return this.addOperation(new KnexOperation('andWhere'), args);
|
|
139
|
+
}
|
|
140
|
+
orWhere(...args) {
|
|
141
|
+
return this.addOperation(new KnexOperation('orWhere'), args);
|
|
142
|
+
}
|
|
143
|
+
whereNot(...args) {
|
|
144
|
+
return this.addOperation(new KnexOperation('whereNot'), args);
|
|
145
|
+
}
|
|
146
|
+
andWhereNot(...args) {
|
|
147
|
+
return this.addOperation(new KnexOperation('andWhereNot'), args);
|
|
148
|
+
}
|
|
149
|
+
orWhereNot(...args) {
|
|
150
|
+
return this.addOperation(new KnexOperation('orWhereNot'), args);
|
|
151
|
+
}
|
|
152
|
+
// Makes the query match no rows.
|
|
153
|
+
none() {
|
|
154
|
+
return this.where(expression('(1 = 0)', []));
|
|
155
|
+
}
|
|
156
|
+
whereRaw(...args) {
|
|
157
|
+
return this.addOperation(new KnexOperation('whereRaw'), args);
|
|
158
|
+
}
|
|
159
|
+
andWhereRaw(...args) {
|
|
160
|
+
return this.addOperation(new KnexOperation('andWhereRaw'), args);
|
|
161
|
+
}
|
|
162
|
+
orWhereRaw(...args) {
|
|
163
|
+
return this.addOperation(new KnexOperation('orWhereRaw'), args);
|
|
164
|
+
}
|
|
165
|
+
whereWrapped(...args) {
|
|
166
|
+
return this.addOperation(new KnexOperation('whereWrapped'), args);
|
|
167
|
+
}
|
|
168
|
+
havingWrapped(...args) {
|
|
169
|
+
return this.addOperation(new KnexOperation('havingWrapped'), args);
|
|
170
|
+
}
|
|
171
|
+
whereExists(...args) {
|
|
172
|
+
return this.addOperation(new KnexOperation('whereExists'), args);
|
|
173
|
+
}
|
|
174
|
+
orWhereExists(...args) {
|
|
175
|
+
return this.addOperation(new KnexOperation('orWhereExists'), args);
|
|
176
|
+
}
|
|
177
|
+
whereNotExists(...args) {
|
|
178
|
+
return this.addOperation(new KnexOperation('whereNotExists'), args);
|
|
179
|
+
}
|
|
180
|
+
orWhereNotExists(...args) {
|
|
181
|
+
return this.addOperation(new KnexOperation('orWhereNotExists'), args);
|
|
182
|
+
}
|
|
183
|
+
whereIn(...args) {
|
|
184
|
+
return this.addOperation(new KnexOperation('whereIn'), args);
|
|
185
|
+
}
|
|
186
|
+
orWhereIn(...args) {
|
|
187
|
+
return this.addOperation(new KnexOperation('orWhereIn'), args);
|
|
188
|
+
}
|
|
189
|
+
whereNotIn(...args) {
|
|
190
|
+
return this.addOperation(new KnexOperation('whereNotIn'), args);
|
|
191
|
+
}
|
|
192
|
+
orWhereNotIn(...args) {
|
|
193
|
+
return this.addOperation(new KnexOperation('orWhereNotIn'), args);
|
|
194
|
+
}
|
|
195
|
+
whereNull(...args) {
|
|
196
|
+
return this.addOperation(new KnexOperation('whereNull'), args);
|
|
197
|
+
}
|
|
198
|
+
orWhereNull(...args) {
|
|
199
|
+
return this.addOperation(new KnexOperation('orWhereNull'), args);
|
|
200
|
+
}
|
|
201
|
+
whereNotNull(...args) {
|
|
202
|
+
return this.addOperation(new KnexOperation('whereNotNull'), args);
|
|
203
|
+
}
|
|
204
|
+
orWhereNotNull(...args) {
|
|
205
|
+
return this.addOperation(new KnexOperation('orWhereNotNull'), args);
|
|
206
|
+
}
|
|
207
|
+
whereBetween(...args) {
|
|
208
|
+
return this.addOperation(new KnexOperation('whereBetween'), args);
|
|
209
|
+
}
|
|
210
|
+
andWhereBetween(...args) {
|
|
211
|
+
return this.addOperation(new KnexOperation('andWhereBetween'), args);
|
|
212
|
+
}
|
|
213
|
+
whereNotBetween(...args) {
|
|
214
|
+
return this.addOperation(new KnexOperation('whereNotBetween'), args);
|
|
215
|
+
}
|
|
216
|
+
andWhereNotBetween(...args) {
|
|
217
|
+
return this.addOperation(new KnexOperation('andWhereNotBetween'), args);
|
|
218
|
+
}
|
|
219
|
+
orWhereBetween(...args) {
|
|
220
|
+
return this.addOperation(new KnexOperation('orWhereBetween'), args);
|
|
221
|
+
}
|
|
222
|
+
orWhereNotBetween(...args) {
|
|
223
|
+
return this.addOperation(new KnexOperation('orWhereNotBetween'), args);
|
|
224
|
+
}
|
|
225
|
+
whereLike(...args) {
|
|
226
|
+
return this.addOperation(new KnexOperation('whereLike'), args);
|
|
227
|
+
}
|
|
228
|
+
andWhereLike(...args) {
|
|
229
|
+
return this.addOperation(new KnexOperation('andWhereLike'), args);
|
|
230
|
+
}
|
|
231
|
+
orWhereLike(...args) {
|
|
232
|
+
return this.addOperation(new KnexOperation('orWhereLike'), args);
|
|
233
|
+
}
|
|
234
|
+
whereILike(...args) {
|
|
235
|
+
return this.addOperation(new KnexOperation('whereILike'), args);
|
|
236
|
+
}
|
|
237
|
+
andWhereILike(...args) {
|
|
238
|
+
return this.addOperation(new KnexOperation('andWhereILike'), args);
|
|
239
|
+
}
|
|
240
|
+
orWhereILike(...args) {
|
|
241
|
+
return this.addOperation(new KnexOperation('orWhereILike'), args);
|
|
242
|
+
}
|
|
243
|
+
groupBy(...args) {
|
|
244
|
+
return this.addOperation(new KnexOperation('groupBy'), args);
|
|
245
|
+
}
|
|
246
|
+
groupByRaw(...args) {
|
|
247
|
+
return this.addOperation(new KnexOperation('groupByRaw'), args);
|
|
248
|
+
}
|
|
249
|
+
orderBy(...args) {
|
|
250
|
+
return this.addOperation(new KnexOperation('orderBy'), args);
|
|
251
|
+
}
|
|
252
|
+
orderByRaw(...args) {
|
|
253
|
+
return this.addOperation(new KnexOperation('orderByRaw'), args);
|
|
254
|
+
}
|
|
255
|
+
union(...args) {
|
|
256
|
+
return this.addOperation(new KnexOperation('union'), args);
|
|
257
|
+
}
|
|
258
|
+
unionAll(...args) {
|
|
259
|
+
return this.addOperation(new KnexOperation('unionAll'), args);
|
|
260
|
+
}
|
|
261
|
+
intersect(...args) {
|
|
262
|
+
return this.addOperation(new KnexOperation('intersect'), args);
|
|
263
|
+
}
|
|
264
|
+
except(...args) {
|
|
265
|
+
return this.addOperation(new KnexOperation('except'), args);
|
|
266
|
+
}
|
|
267
|
+
having(...args) {
|
|
268
|
+
return this.addOperation(new KnexOperation('having'), args);
|
|
269
|
+
}
|
|
270
|
+
// Like clearSelect() and clearWhere(), these remove the operations, so that
|
|
271
|
+
// has() and copyFrom() see the query as it is.
|
|
272
|
+
clearHaving() {
|
|
273
|
+
return this.clear(HavingSelector);
|
|
274
|
+
}
|
|
275
|
+
clearGroup() {
|
|
276
|
+
return this.clear(GroupBySelector);
|
|
277
|
+
}
|
|
278
|
+
orHaving(...args) {
|
|
279
|
+
return this.addOperation(new KnexOperation('orHaving'), args);
|
|
280
|
+
}
|
|
281
|
+
havingIn(...args) {
|
|
282
|
+
return this.addOperation(new KnexOperation('havingIn'), args);
|
|
283
|
+
}
|
|
284
|
+
orHavingIn(...args) {
|
|
285
|
+
return this.addOperation(new KnexOperation('orHavingIn'), args);
|
|
286
|
+
}
|
|
287
|
+
havingNotIn(...args) {
|
|
288
|
+
return this.addOperation(new KnexOperation('havingNotIn'), args);
|
|
289
|
+
}
|
|
290
|
+
orHavingNotIn(...args) {
|
|
291
|
+
return this.addOperation(new KnexOperation('orHavingNotIn'), args);
|
|
292
|
+
}
|
|
293
|
+
havingNull(...args) {
|
|
294
|
+
return this.addOperation(new KnexOperation('havingNull'), args);
|
|
295
|
+
}
|
|
296
|
+
orHavingNull(...args) {
|
|
297
|
+
return this.addOperation(new KnexOperation('orHavingNull'), args);
|
|
298
|
+
}
|
|
299
|
+
havingNotNull(...args) {
|
|
300
|
+
return this.addOperation(new KnexOperation('havingNotNull'), args);
|
|
301
|
+
}
|
|
302
|
+
orHavingNotNull(...args) {
|
|
303
|
+
return this.addOperation(new KnexOperation('orHavingNotNull'), args);
|
|
304
|
+
}
|
|
305
|
+
havingExists(...args) {
|
|
306
|
+
return this.addOperation(new KnexOperation('havingExists'), args);
|
|
307
|
+
}
|
|
308
|
+
orHavingExists(...args) {
|
|
309
|
+
return this.addOperation(new KnexOperation('orHavingExists'), args);
|
|
310
|
+
}
|
|
311
|
+
havingNotExists(...args) {
|
|
312
|
+
return this.addOperation(new KnexOperation('havingNotExists'), args);
|
|
313
|
+
}
|
|
314
|
+
orHavingNotExists(...args) {
|
|
315
|
+
return this.addOperation(new KnexOperation('orHavingNotExists'), args);
|
|
316
|
+
}
|
|
317
|
+
havingBetween(...args) {
|
|
318
|
+
return this.addOperation(new KnexOperation('havingBetween'), args);
|
|
319
|
+
}
|
|
320
|
+
orHavingBetween(...args) {
|
|
321
|
+
return this.addOperation(new KnexOperation('orHavingBetween'), args);
|
|
322
|
+
}
|
|
323
|
+
havingNotBetween(...args) {
|
|
324
|
+
return this.addOperation(new KnexOperation('havingNotBetween'), args);
|
|
325
|
+
}
|
|
326
|
+
orHavingNotBetween(...args) {
|
|
327
|
+
return this.addOperation(new KnexOperation('orHavingNotBetween'), args);
|
|
328
|
+
}
|
|
329
|
+
andHaving(...args) {
|
|
330
|
+
return this.addOperation(new KnexOperation('andHaving'), args);
|
|
331
|
+
}
|
|
332
|
+
andHavingIn(...args) {
|
|
333
|
+
return this.addOperation(new KnexOperation('andHavingIn'), args);
|
|
334
|
+
}
|
|
335
|
+
andHavingNotIn(...args) {
|
|
336
|
+
return this.addOperation(new KnexOperation('andHavingNotIn'), args);
|
|
337
|
+
}
|
|
338
|
+
andHavingNull(...args) {
|
|
339
|
+
return this.addOperation(new KnexOperation('andHavingNull'), args);
|
|
340
|
+
}
|
|
341
|
+
andHavingNotNull(...args) {
|
|
342
|
+
return this.addOperation(new KnexOperation('andHavingNotNull'), args);
|
|
343
|
+
}
|
|
344
|
+
andHavingExists(...args) {
|
|
345
|
+
return this.addOperation(new KnexOperation('andHavingExists'), args);
|
|
346
|
+
}
|
|
347
|
+
andHavingNotExists(...args) {
|
|
348
|
+
return this.addOperation(new KnexOperation('andHavingNotExists'), args);
|
|
349
|
+
}
|
|
350
|
+
andHavingBetween(...args) {
|
|
351
|
+
return this.addOperation(new KnexOperation('andHavingBetween'), args);
|
|
352
|
+
}
|
|
353
|
+
andHavingNotBetween(...args) {
|
|
354
|
+
return this.addOperation(new KnexOperation('andHavingNotBetween'), args);
|
|
355
|
+
}
|
|
356
|
+
comment(...args) {
|
|
357
|
+
return this.addOperation(new KnexOperation('comment'), args);
|
|
358
|
+
}
|
|
359
|
+
hintComment(...args) {
|
|
360
|
+
return this.addOperation(new KnexOperation('hintComment'), args);
|
|
361
|
+
}
|
|
362
|
+
using(...args) {
|
|
363
|
+
return this.addOperation(new KnexOperation('using'), args);
|
|
364
|
+
}
|
|
365
|
+
havingRaw(...args) {
|
|
366
|
+
return this.addOperation(new KnexOperation('havingRaw'), args);
|
|
367
|
+
}
|
|
368
|
+
orHavingRaw(...args) {
|
|
369
|
+
return this.addOperation(new KnexOperation('orHavingRaw'), args);
|
|
370
|
+
}
|
|
371
|
+
offset(...args) {
|
|
372
|
+
return this.addOperation(new KnexOperation('offset'), args);
|
|
373
|
+
}
|
|
374
|
+
limit(...args) {
|
|
375
|
+
return this.addOperation(new KnexOperation('limit'), args);
|
|
376
|
+
}
|
|
377
|
+
count(...args) {
|
|
378
|
+
return this.addOperation(new SelectOperation('count'), args);
|
|
379
|
+
}
|
|
380
|
+
countDistinct(...args) {
|
|
381
|
+
return this.addOperation(new SelectOperation('countDistinct'), args);
|
|
382
|
+
}
|
|
383
|
+
min(...args) {
|
|
384
|
+
return this.addOperation(new SelectOperation('min'), args);
|
|
385
|
+
}
|
|
386
|
+
max(...args) {
|
|
387
|
+
return this.addOperation(new SelectOperation('max'), args);
|
|
388
|
+
}
|
|
389
|
+
sum(...args) {
|
|
390
|
+
return this.addOperation(new SelectOperation('sum'), args);
|
|
391
|
+
}
|
|
392
|
+
sumDistinct(...args) {
|
|
393
|
+
return this.addOperation(new SelectOperation('sumDistinct'), args);
|
|
394
|
+
}
|
|
395
|
+
avg(...args) {
|
|
396
|
+
return this.addOperation(new SelectOperation('avg'), args);
|
|
397
|
+
}
|
|
398
|
+
avgDistinct(...args) {
|
|
399
|
+
return this.addOperation(new SelectOperation('avgDistinct'), args);
|
|
400
|
+
}
|
|
401
|
+
debug(...args) {
|
|
402
|
+
return this.addOperation(new KnexOperation('debug'), args);
|
|
403
|
+
}
|
|
404
|
+
returning(...args) {
|
|
405
|
+
return this.addOperation(new ReturningOperation('returning'), args);
|
|
406
|
+
}
|
|
407
|
+
truncate(...args) {
|
|
408
|
+
return this.addOperation(new KnexOperation('truncate'), args);
|
|
409
|
+
}
|
|
410
|
+
connection(...args) {
|
|
411
|
+
return this.addOperation(new KnexOperation('connection'), args);
|
|
412
|
+
}
|
|
413
|
+
options(...args) {
|
|
414
|
+
return this.addOperation(new KnexOperation('options'), args);
|
|
415
|
+
}
|
|
416
|
+
columnInfo(...args) {
|
|
417
|
+
return this.addOperation(new KnexOperation('columnInfo'), args);
|
|
418
|
+
}
|
|
419
|
+
off(...args) {
|
|
420
|
+
return this.addOperation(new KnexOperation('off'), args);
|
|
421
|
+
}
|
|
422
|
+
timeout(...args) {
|
|
423
|
+
return this.addOperation(new KnexOperation('timeout'), args);
|
|
424
|
+
}
|
|
425
|
+
with(...args) {
|
|
426
|
+
return this.addOperation(new KnexOperation('with'), args);
|
|
427
|
+
}
|
|
428
|
+
withWrapped(...args) {
|
|
429
|
+
return this.addOperation(new KnexOperation('withWrapped'), args);
|
|
430
|
+
}
|
|
431
|
+
withRecursive(...args) {
|
|
432
|
+
return this.addOperation(new KnexOperation('withRecursive'), args);
|
|
433
|
+
}
|
|
434
|
+
withMaterialized(...args) {
|
|
435
|
+
return this.addOperation(new KnexOperation('withMaterialized'), args);
|
|
436
|
+
}
|
|
437
|
+
withNotMaterialized(...args) {
|
|
438
|
+
return this.addOperation(new KnexOperation('withNotMaterialized'), args);
|
|
439
|
+
}
|
|
440
|
+
whereComposite(...args) {
|
|
441
|
+
return this.addOperation(new WhereCompositeOperation('whereComposite'), args);
|
|
442
|
+
}
|
|
443
|
+
whereInComposite(...args) {
|
|
444
|
+
let operation = null;
|
|
445
|
+
if (isSqlite(this.knex())) {
|
|
446
|
+
operation = new WhereInCompositeSqliteOperation('whereInComposite');
|
|
447
|
+
}
|
|
448
|
+
else if (isMsSql(this.knex())) {
|
|
449
|
+
operation = new WhereInCompositeMsSqlOperation('whereInComposite');
|
|
450
|
+
}
|
|
451
|
+
else {
|
|
452
|
+
operation = new WhereInCompositeOperation('whereInComposite');
|
|
453
|
+
}
|
|
454
|
+
return this.addOperation(operation, args);
|
|
455
|
+
}
|
|
456
|
+
whereNotInComposite(...args) {
|
|
457
|
+
let operation = null;
|
|
458
|
+
if (isSqlite(this.knex())) {
|
|
459
|
+
operation = new WhereInCompositeSqliteOperation('whereNotInComposite', { prefix: 'not' });
|
|
460
|
+
}
|
|
461
|
+
else if (isMsSql(this.knex())) {
|
|
462
|
+
operation = new WhereInCompositeMsSqlOperation('whereNotInComposite', { prefix: 'not' });
|
|
463
|
+
}
|
|
464
|
+
else {
|
|
465
|
+
operation = new WhereInCompositeOperation('whereNotInComposite', { prefix: 'not' });
|
|
466
|
+
}
|
|
467
|
+
return this.addOperation(operation, args);
|
|
468
|
+
}
|
|
469
|
+
jsonExtract(...args) {
|
|
470
|
+
return this.addOperation(new KnexOperation('jsonExtract'), args);
|
|
471
|
+
}
|
|
472
|
+
jsonSet(...args) {
|
|
473
|
+
return this.addOperation(new KnexOperation('jsonSet'), args);
|
|
474
|
+
}
|
|
475
|
+
jsonInsert(...args) {
|
|
476
|
+
return this.addOperation(new KnexOperation('jsonInsert'), args);
|
|
477
|
+
}
|
|
478
|
+
jsonRemove(...args) {
|
|
479
|
+
return this.addOperation(new KnexOperation('jsonRemove'), args);
|
|
480
|
+
}
|
|
481
|
+
whereJsonObject(...args) {
|
|
482
|
+
return this.addOperation(new KnexOperation('whereJsonObject'), args);
|
|
483
|
+
}
|
|
484
|
+
orWhereJsonObject(...args) {
|
|
485
|
+
return this.addOperation(new KnexOperation('orWhereJsonObject'), args);
|
|
486
|
+
}
|
|
487
|
+
andWhereJsonObject(...args) {
|
|
488
|
+
return this.addOperation(new KnexOperation('andWhereJsonObject'), args);
|
|
489
|
+
}
|
|
490
|
+
whereNotJsonObject(...args) {
|
|
491
|
+
return this.addOperation(new KnexOperation('whereNotJsonObject'), args);
|
|
492
|
+
}
|
|
493
|
+
orWhereNotJsonObject(...args) {
|
|
494
|
+
return this.addOperation(new KnexOperation('orWhereNotJsonObject'), args);
|
|
495
|
+
}
|
|
496
|
+
andWhereNotJsonObject(...args) {
|
|
497
|
+
return this.addOperation(new KnexOperation('andWhereNotJsonObject'), args);
|
|
498
|
+
}
|
|
499
|
+
whereJsonPath(...args) {
|
|
500
|
+
return this.addOperation(new KnexOperation('whereJsonPath'), args);
|
|
501
|
+
}
|
|
502
|
+
orWhereJsonPath(...args) {
|
|
503
|
+
return this.addOperation(new KnexOperation('orWhereJsonPath'), args);
|
|
504
|
+
}
|
|
505
|
+
andWhereJsonPath(...args) {
|
|
506
|
+
return this.addOperation(new KnexOperation('andWhereJsonPath'), args);
|
|
507
|
+
}
|
|
508
|
+
// whereJson(Not)SupersetOf / whereJson(Not)SubsetOf are now supported by knex >= 1.0, but for now
|
|
509
|
+
// objection handles them differently and only for postgres.
|
|
510
|
+
// Changing them to utilize knex methods directly may require a major version bump and upgrade guide.
|
|
511
|
+
whereJsonSupersetOf(...args) {
|
|
512
|
+
return this.addOperation(new WhereJsonOperation('whereJsonSupersetOf', { operator: '@>', bool: 'and' }), args);
|
|
513
|
+
}
|
|
514
|
+
andWhereJsonSupersetOf(...args) {
|
|
515
|
+
return this.whereJsonSupersetOf(...args);
|
|
516
|
+
}
|
|
517
|
+
orWhereJsonSupersetOf(...args) {
|
|
518
|
+
return this.addOperation(new WhereJsonOperation('orWhereJsonSupersetOf', { operator: '@>', bool: 'or' }), args);
|
|
519
|
+
}
|
|
520
|
+
whereJsonNotSupersetOf(...args) {
|
|
521
|
+
return this.addOperation(new WhereJsonOperation('whereJsonNotSupersetOf', {
|
|
522
|
+
operator: '@>',
|
|
523
|
+
bool: 'and',
|
|
524
|
+
prefix: 'not',
|
|
525
|
+
}), args);
|
|
526
|
+
}
|
|
527
|
+
andWhereJsonNotSupersetOf(...args) {
|
|
528
|
+
return this.whereJsonNotSupersetOf(...args);
|
|
529
|
+
}
|
|
530
|
+
orWhereJsonNotSupersetOf(...args) {
|
|
531
|
+
return this.addOperation(new WhereJsonOperation('orWhereJsonNotSupersetOf', {
|
|
532
|
+
operator: '@>',
|
|
533
|
+
bool: 'or',
|
|
534
|
+
prefix: 'not',
|
|
535
|
+
}), args);
|
|
536
|
+
}
|
|
537
|
+
whereJsonSubsetOf(...args) {
|
|
538
|
+
return this.addOperation(new WhereJsonOperation('whereJsonSubsetOf', { operator: '<@', bool: 'and' }), args);
|
|
539
|
+
}
|
|
540
|
+
andWhereJsonSubsetOf(...args) {
|
|
541
|
+
return this.whereJsonSubsetOf(...args);
|
|
542
|
+
}
|
|
543
|
+
orWhereJsonSubsetOf(...args) {
|
|
544
|
+
return this.addOperation(new WhereJsonOperation('orWhereJsonSubsetOf', { operator: '<@', bool: 'or' }), args);
|
|
545
|
+
}
|
|
546
|
+
whereJsonNotSubsetOf(...args) {
|
|
547
|
+
return this.addOperation(new WhereJsonOperation('whereJsonNotSubsetOf', {
|
|
548
|
+
operator: '<@',
|
|
549
|
+
bool: 'and',
|
|
550
|
+
prefix: 'not',
|
|
551
|
+
}), args);
|
|
552
|
+
}
|
|
553
|
+
andWhereJsonNotSubsetOf(...args) {
|
|
554
|
+
return this.whereJsonNotSubsetOf(...args);
|
|
555
|
+
}
|
|
556
|
+
orWhereJsonNotSubsetOf(...args) {
|
|
557
|
+
return this.addOperation(new WhereJsonOperation('orWhereJsonNotSubsetOf', {
|
|
558
|
+
operator: '<@',
|
|
559
|
+
bool: 'or',
|
|
560
|
+
prefix: 'not',
|
|
561
|
+
}), args);
|
|
562
|
+
}
|
|
563
|
+
whereJsonNotArray(...args) {
|
|
564
|
+
return this.addOperation(new WhereJsonNotObjectOperation('whereJsonNotArray', {
|
|
565
|
+
bool: 'and',
|
|
566
|
+
compareValue: [],
|
|
567
|
+
}), args);
|
|
568
|
+
}
|
|
569
|
+
orWhereJsonNotArray(...args) {
|
|
570
|
+
return this.addOperation(new WhereJsonNotObjectOperation('orWhereJsonNotArray', {
|
|
571
|
+
bool: 'or',
|
|
572
|
+
compareValue: [],
|
|
573
|
+
}), args);
|
|
574
|
+
}
|
|
575
|
+
whereJsonNotObject(...args) {
|
|
576
|
+
return this.addOperation(new WhereJsonNotObjectOperation('whereJsonNotObject', {
|
|
577
|
+
bool: 'and',
|
|
578
|
+
compareValue: {},
|
|
579
|
+
}), args);
|
|
580
|
+
}
|
|
581
|
+
orWhereJsonNotObject(...args) {
|
|
582
|
+
return this.addOperation(new WhereJsonNotObjectOperation('orWhereJsonNotObject', {
|
|
583
|
+
bool: 'or',
|
|
584
|
+
compareValue: {},
|
|
585
|
+
}), args);
|
|
586
|
+
}
|
|
587
|
+
whereJsonHasAny(...args) {
|
|
588
|
+
return this.addOperation(new WhereJsonHasOperation('whereJsonHasAny', { bool: 'and', operator: '?|' }), args);
|
|
589
|
+
}
|
|
590
|
+
orWhereJsonHasAny(...args) {
|
|
591
|
+
return this.addOperation(new WhereJsonHasOperation('orWhereJsonHasAny', { bool: 'or', operator: '?|' }), args);
|
|
592
|
+
}
|
|
593
|
+
whereJsonHasAll(...args) {
|
|
594
|
+
return this.addOperation(new WhereJsonHasOperation('whereJsonHasAll', { bool: 'and', operator: '?&' }), args);
|
|
595
|
+
}
|
|
596
|
+
orWhereJsonHasAll(...args) {
|
|
597
|
+
return this.addOperation(new WhereJsonHasOperation('orWhereJsonHasAll', { bool: 'or', operator: '?&' }), args);
|
|
598
|
+
}
|
|
599
|
+
whereJsonOverlaps(...args) {
|
|
600
|
+
return this.addOperation(new WhereJsonOverlapsOperation('whereJsonOverlaps', { bool: 'and' }), args);
|
|
601
|
+
}
|
|
602
|
+
andWhereJsonOverlaps(...args) {
|
|
603
|
+
return this.whereJsonOverlaps(...args);
|
|
604
|
+
}
|
|
605
|
+
orWhereJsonOverlaps(...args) {
|
|
606
|
+
return this.addOperation(new WhereJsonOverlapsOperation('orWhereJsonOverlaps', { bool: 'or' }), args);
|
|
607
|
+
}
|
|
608
|
+
whereJsonNotOverlaps(...args) {
|
|
609
|
+
return this.addOperation(new WhereJsonOverlapsOperation('whereJsonNotOverlaps', { bool: 'and', prefix: 'not' }), args);
|
|
610
|
+
}
|
|
611
|
+
andWhereJsonNotOverlaps(...args) {
|
|
612
|
+
return this.whereJsonNotOverlaps(...args);
|
|
613
|
+
}
|
|
614
|
+
orWhereJsonNotOverlaps(...args) {
|
|
615
|
+
return this.addOperation(new WhereJsonOverlapsOperation('orWhereJsonNotOverlaps', { bool: 'or', prefix: 'not' }), args);
|
|
616
|
+
}
|
|
617
|
+
whereJsonIsArray(fieldExpression) {
|
|
618
|
+
return this.whereJsonSupersetOf(fieldExpression, []);
|
|
619
|
+
}
|
|
620
|
+
orWhereJsonIsArray(fieldExpression) {
|
|
621
|
+
return this.orWhereJsonSupersetOf(fieldExpression, []);
|
|
622
|
+
}
|
|
623
|
+
whereJsonIsObject(fieldExpression) {
|
|
624
|
+
return this.whereJsonSupersetOf(fieldExpression, {});
|
|
625
|
+
}
|
|
626
|
+
orWhereJsonIsObject(fieldExpression) {
|
|
627
|
+
return this.orWhereJsonSupersetOf(fieldExpression, {});
|
|
628
|
+
}
|
|
629
|
+
whereColumn(...args) {
|
|
630
|
+
return this.addOperation(new KnexOperation('whereColumn'), args);
|
|
631
|
+
}
|
|
632
|
+
andWhereColumn(...args) {
|
|
633
|
+
return this.addOperation(new KnexOperation('andWhereColumn'), args);
|
|
634
|
+
}
|
|
635
|
+
orWhereColumn(...args) {
|
|
636
|
+
return this.addOperation(new KnexOperation('orWhereColumn'), args);
|
|
637
|
+
}
|
|
638
|
+
whereNotColumn(...args) {
|
|
639
|
+
return this.addOperation(new KnexOperation('whereNotColumn'), args);
|
|
640
|
+
}
|
|
641
|
+
andWhereNotColumn(...args) {
|
|
642
|
+
return this.addOperation(new KnexOperation('andWhereNotColumn'), args);
|
|
643
|
+
}
|
|
644
|
+
orWhereNotColumn(...args) {
|
|
645
|
+
return this.addOperation(new KnexOperation('orWhereNotColumn'), args);
|
|
646
|
+
}
|
|
647
|
+
onConflict(...args) {
|
|
648
|
+
return this.addOperation(new KnexOperation('onConflict'), args);
|
|
649
|
+
}
|
|
650
|
+
ignore(...args) {
|
|
651
|
+
return this.addOperation(new KnexOperation('ignore'), args);
|
|
652
|
+
}
|
|
653
|
+
merge(...args) {
|
|
654
|
+
return this.addOperation(new MergeOperation('merge'), args);
|
|
655
|
+
}
|
|
872
656
|
}
|
|
873
|
-
|
|
874
657
|
Object.defineProperties(QueryBuilderBase.prototype, {
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
658
|
+
isObjectionQueryBuilderBase: {
|
|
659
|
+
enumerable: false,
|
|
660
|
+
writable: false,
|
|
661
|
+
value: true,
|
|
662
|
+
},
|
|
880
663
|
});
|
|
881
|
-
|
|
882
664
|
module.exports = {
|
|
883
|
-
|
|
665
|
+
QueryBuilderBase,
|
|
884
666
|
};
|