@abedmurrar/objection 4.0.0-beta.1 → 4.0.0-beta.10
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 +1 -1
- package/lib/initialize.js +4 -5
- package/lib/model/AjvValidator.js +24 -21
- package/lib/model/Model.js +116 -114
- package/lib/model/ModifierNotFoundError.js +4 -4
- package/lib/model/NotFoundError.js +4 -4
- package/lib/model/RelationDoesNotExistError.js +4 -4
- package/lib/model/ValidationError.js +8 -8
- package/lib/model/Validator.js +7 -6
- package/lib/model/getModel.js +4 -4
- package/lib/model/graph/ModelGraph.js +9 -7
- package/lib/model/graph/ModelGraphBuilder.js +24 -24
- package/lib/model/graph/ModelGraphEdge.js +4 -4
- package/lib/model/graph/ModelGraphNode.js +17 -11
- package/lib/model/inheritModel.js +3 -4
- package/lib/model/modelBindKnex.js +12 -13
- package/lib/model/modelClone.js +15 -16
- package/lib/model/modelColPropMap.js +7 -8
- package/lib/model/modelConcurrency.js +6 -7
- package/lib/model/modelId.js +4 -5
- package/lib/model/modelJsonAttributes.js +10 -11
- package/lib/model/modelParseRelations.js +5 -6
- package/lib/model/modelQueryProps.js +12 -13
- package/lib/model/modelSet.js +17 -18
- package/lib/model/modelTableMetadata.js +9 -10
- package/lib/model/modelToJson.js +13 -14
- package/lib/model/modelUtils.js +7 -7
- package/lib/model/modelValidate.js +5 -6
- package/lib/model/modelValues.js +10 -10
- package/lib/model/modelVisitor.js +3 -4
- package/lib/objection.js +4 -26
- package/lib/queryBuilder/FunctionBuilder.js +35 -31
- package/lib/queryBuilder/InternalOptions.js +4 -4
- package/lib/queryBuilder/JoinBuilder.js +46 -45
- package/lib/queryBuilder/QueryBuilder.js +161 -135
- package/lib/queryBuilder/QueryBuilderBase.js +203 -203
- package/lib/queryBuilder/QueryBuilderContext.js +6 -6
- package/lib/queryBuilder/QueryBuilderContextBase.js +12 -8
- package/lib/queryBuilder/QueryBuilderOperationSupport.js +30 -25
- package/lib/queryBuilder/QueryBuilderUserContext.js +4 -4
- package/lib/queryBuilder/RawBuilder.js +15 -13
- package/lib/queryBuilder/ReferenceBuilder.js +25 -23
- package/lib/queryBuilder/RelationExpression.js +29 -20
- package/lib/queryBuilder/StaticHookArguments.js +11 -11
- package/lib/queryBuilder/ValueBuilder.js +20 -19
- package/lib/queryBuilder/expressions.js +8 -18
- package/lib/queryBuilder/functions/mysql.js +18 -42
- package/lib/queryBuilder/graph/GraphAction.js +7 -7
- package/lib/queryBuilder/graph/GraphData.js +4 -4
- package/lib/queryBuilder/graph/GraphFetcher.js +18 -17
- package/lib/queryBuilder/graph/GraphNodeDbExistence.js +45 -12
- package/lib/queryBuilder/graph/GraphOperation.js +4 -4
- package/lib/queryBuilder/graph/GraphOptions.js +5 -5
- package/lib/queryBuilder/graph/GraphUpsert.js +36 -36
- package/lib/queryBuilder/graph/delete/GraphDelete.js +8 -8
- package/lib/queryBuilder/graph/delete/GraphDeleteAction.js +46 -11
- package/lib/queryBuilder/graph/insert/GraphInsert.js +12 -12
- package/lib/queryBuilder/graph/insert/GraphInsertAction.js +59 -21
- package/lib/queryBuilder/graph/insert/JoinRowGraphInsertAction.js +49 -11
- package/lib/queryBuilder/graph/patch/GraphPatch.js +8 -8
- package/lib/queryBuilder/graph/patch/GraphPatchAction.js +52 -19
- package/lib/queryBuilder/graph/recursiveUpsert/GraphRecursiveUpsert.js +8 -8
- package/lib/queryBuilder/graph/recursiveUpsert/GraphRecursiveUpsertAction.js +54 -18
- package/lib/queryBuilder/join/JoinResultColumn.js +6 -4
- package/lib/queryBuilder/join/JoinResultParser.js +10 -8
- package/lib/queryBuilder/join/RelationJoiner.js +40 -35
- package/lib/queryBuilder/join/TableNode.js +7 -5
- package/lib/queryBuilder/join/TableTree.js +13 -9
- package/lib/queryBuilder/join/utils.js +8 -8
- package/lib/queryBuilder/operations/DelegateOperation.js +6 -6
- package/lib/queryBuilder/operations/DeleteOperation.js +11 -11
- package/lib/queryBuilder/operations/FindByIdOperation.js +8 -8
- package/lib/queryBuilder/operations/FindByIdsOperation.js +6 -6
- package/lib/queryBuilder/operations/FindOperation.js +23 -23
- package/lib/queryBuilder/operations/FirstOperation.js +6 -6
- package/lib/queryBuilder/operations/FromOperation.js +13 -13
- package/lib/queryBuilder/operations/InsertAndFetchOperation.js +12 -12
- package/lib/queryBuilder/operations/InsertGraphAndFetchOperation.js +10 -10
- package/lib/queryBuilder/operations/InsertGraphOperation.js +11 -11
- package/lib/queryBuilder/operations/InsertOperation.js +23 -22
- package/lib/queryBuilder/operations/InstanceDeleteOperation.js +12 -12
- package/lib/queryBuilder/operations/InstanceFindOperation.js +10 -10
- package/lib/queryBuilder/operations/InstanceInsertOperation.js +6 -6
- package/lib/queryBuilder/operations/InstanceUpdateOperation.js +14 -14
- package/lib/queryBuilder/operations/JoinRelatedOperation.js +13 -13
- package/lib/queryBuilder/operations/KnexOperation.js +6 -6
- package/lib/queryBuilder/operations/MergeOperation.js +11 -11
- package/lib/queryBuilder/operations/ObjectionToKnexConvertingOperation.js +26 -22
- package/lib/queryBuilder/operations/OnBuildKnexOperation.js +6 -6
- package/lib/queryBuilder/operations/OnBuildOperation.js +6 -6
- package/lib/queryBuilder/operations/OnErrorOperation.js +6 -6
- package/lib/queryBuilder/operations/QueryBuilderOperation.js +6 -4
- package/lib/queryBuilder/operations/RangeOperation.js +7 -6
- package/lib/queryBuilder/operations/RelateOperation.js +6 -6
- package/lib/queryBuilder/operations/ReturningOperation.js +8 -8
- package/lib/queryBuilder/operations/RunAfterOperation.js +6 -6
- package/lib/queryBuilder/operations/RunBeforeOperation.js +6 -6
- package/lib/queryBuilder/operations/UnrelateOperation.js +6 -6
- package/lib/queryBuilder/operations/UpdateAndFetchOperation.js +12 -12
- package/lib/queryBuilder/operations/UpdateOperation.js +24 -24
- package/lib/queryBuilder/operations/UpsertGraphAndFetchOperation.js +10 -10
- package/lib/queryBuilder/operations/UpsertGraphOperation.js +10 -10
- package/lib/queryBuilder/operations/WhereCompositeOperation.js +8 -8
- package/lib/queryBuilder/operations/WhereInOperation.js +11 -9
- package/lib/queryBuilder/operations/eager/EagerOperation.js +11 -9
- package/lib/queryBuilder/operations/eager/JoinEagerOperation.js +10 -12
- package/lib/queryBuilder/operations/eager/NaiveEagerOperation.js +6 -6
- package/lib/queryBuilder/operations/eager/WhereInEagerOperation.js +64 -28
- package/lib/queryBuilder/operations/jsonApi/WhereJsonHasOperation.js +45 -12
- package/lib/queryBuilder/operations/jsonApi/WhereJsonNotObjectOperation.js +45 -12
- package/lib/queryBuilder/operations/jsonApi/WhereJsonOperation.js +45 -12
- package/lib/queryBuilder/operations/jsonApi/WhereJsonOverlapsOperation.js +46 -13
- package/lib/queryBuilder/operations/jsonApi/mysqlJsonApi.js +22 -27
- package/lib/queryBuilder/operations/jsonApi/postgresJsonApi.js +51 -17
- package/lib/queryBuilder/operations/select/SelectOperation.js +12 -12
- package/lib/queryBuilder/operations/select/Selection.js +23 -19
- package/lib/queryBuilder/operations/types.js +8 -0
- package/lib/queryBuilder/operations/whereInComposite/WhereInCompositeMsSqlOperation.js +13 -12
- package/lib/queryBuilder/operations/whereInComposite/WhereInCompositeOperation.js +11 -11
- package/lib/queryBuilder/operations/whereInComposite/WhereInCompositeSqliteOperation.js +10 -10
- package/lib/queryBuilder/transformations/CompositeQueryTransformation.js +6 -6
- package/lib/queryBuilder/transformations/QueryTransformation.js +4 -4
- package/lib/queryBuilder/transformations/WrapMysqlModifySubqueryTransformation.js +11 -8
- package/lib/queryBuilder/transformations/index.js +8 -8
- package/lib/queryBuilder/whereScopes.js +15 -21
- package/lib/relations/RelationDeleteOperation.js +0 -2
- package/lib/relations/RelationFindOperation.js +0 -1
- package/lib/relations/RelationUpdateOperation.js +0 -1
- package/lib/relations/manyToMany/delete/ManyToManyDeleteOperationBase.js +0 -1
- package/lib/transaction.js +44 -12
- package/lib/utils/objectUtils.js +6 -1
- package/lib/utils/parseFieldExpression.js +4 -35
- package/lib/utils/promiseUtils/index.js +19 -9
- package/package.json +1 -1
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QueryBuilderBase = void 0;
|
|
4
|
+
const QueryBuilderOperationSupport_1 = require("./QueryBuilderOperationSupport");
|
|
5
|
+
const knexUtils_1 = require("../utils/knexUtils");
|
|
6
|
+
const KnexOperation_1 = require("./operations/KnexOperation");
|
|
7
|
+
const expressions_1 = require("./expressions");
|
|
8
|
+
const MergeOperation_1 = require("./operations/MergeOperation");
|
|
9
|
+
const SelectOperation_1 = require("./operations/select/SelectOperation");
|
|
10
|
+
const ReturningOperation_1 = require("./operations/ReturningOperation");
|
|
11
|
+
const WhereCompositeOperation_1 = require("./operations/WhereCompositeOperation");
|
|
12
|
+
const WhereJsonOperation_1 = require("./operations/jsonApi/WhereJsonOperation");
|
|
13
|
+
const WhereJsonOverlapsOperation_1 = require("./operations/jsonApi/WhereJsonOverlapsOperation");
|
|
14
|
+
const WhereInCompositeOperation_1 = require("./operations/whereInComposite/WhereInCompositeOperation");
|
|
15
|
+
const WhereInCompositeSqliteOperation_1 = require("./operations/whereInComposite/WhereInCompositeSqliteOperation");
|
|
16
|
+
const WhereInCompositeMsSqlOperation_1 = require("./operations/whereInComposite/WhereInCompositeMsSqlOperation");
|
|
17
|
+
const WhereJsonHasOperation_1 = require("./operations/jsonApi/WhereJsonHasOperation");
|
|
18
|
+
const WhereJsonNotObjectOperation_1 = require("./operations/jsonApi/WhereJsonNotObjectOperation");
|
|
5
19
|
const HavingSelector = /^(having|orHaving|andHaving)/;
|
|
6
20
|
const GroupBySelector = /^groupBy/;
|
|
7
|
-
|
|
8
|
-
const { MergeOperation } = require('./operations/MergeOperation');
|
|
9
|
-
const { SelectOperation } = require('./operations/select/SelectOperation');
|
|
10
|
-
const { ReturningOperation } = require('./operations/ReturningOperation');
|
|
11
|
-
const { WhereCompositeOperation } = require('./operations/WhereCompositeOperation');
|
|
12
|
-
const { WhereJsonOperation } = require('./operations/jsonApi/WhereJsonOperation');
|
|
13
|
-
const { WhereJsonOverlapsOperation } = require('./operations/jsonApi/WhereJsonOverlapsOperation');
|
|
14
|
-
const { WhereInCompositeOperation, } = require('./operations/whereInComposite/WhereInCompositeOperation');
|
|
15
|
-
const { WhereInCompositeSqliteOperation, } = require('./operations/whereInComposite/WhereInCompositeSqliteOperation');
|
|
16
|
-
const { WhereInCompositeMsSqlOperation, } = require('./operations/whereInComposite/WhereInCompositeMsSqlOperation');
|
|
17
|
-
const { WhereJsonHasOperation } = require('./operations/jsonApi/WhereJsonHasOperation');
|
|
18
|
-
const { WhereJsonNotObjectOperation } = require('./operations/jsonApi/WhereJsonNotObjectOperation');
|
|
19
|
-
class QueryBuilderBase extends QueryBuilderOperationSupport {
|
|
21
|
+
class QueryBuilderBase extends QueryBuilderOperationSupport_1.QueryBuilderOperationSupport {
|
|
20
22
|
modify(...args) {
|
|
21
23
|
const func = args[0];
|
|
22
24
|
if (!func) {
|
|
@@ -36,236 +38,236 @@ class QueryBuilderBase extends QueryBuilderOperationSupport {
|
|
|
36
38
|
return this;
|
|
37
39
|
}
|
|
38
40
|
select(...args) {
|
|
39
|
-
return this.addOperation(new SelectOperation('select'), args);
|
|
41
|
+
return this.addOperation(new SelectOperation_1.SelectOperation('select'), args);
|
|
40
42
|
}
|
|
41
43
|
insert(...args) {
|
|
42
|
-
return this.addOperation(new KnexOperation('insert'), args);
|
|
44
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('insert'), args);
|
|
43
45
|
}
|
|
44
46
|
update(...args) {
|
|
45
|
-
return this.addOperation(new KnexOperation('update'), args);
|
|
47
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('update'), args);
|
|
46
48
|
}
|
|
47
49
|
delete(...args) {
|
|
48
|
-
return this.addOperation(new KnexOperation('delete'), args);
|
|
50
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('delete'), args);
|
|
49
51
|
}
|
|
50
52
|
del(...args) {
|
|
51
53
|
return this.delete(...args);
|
|
52
54
|
}
|
|
53
55
|
forUpdate(...args) {
|
|
54
|
-
return this.addOperation(new KnexOperation('forUpdate'), args);
|
|
56
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('forUpdate'), args);
|
|
55
57
|
}
|
|
56
58
|
forShare(...args) {
|
|
57
|
-
return this.addOperation(new KnexOperation('forShare'), args);
|
|
59
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('forShare'), args);
|
|
58
60
|
}
|
|
59
61
|
forNoKeyUpdate(...args) {
|
|
60
|
-
return this.addOperation(new KnexOperation('forNoKeyUpdate'), args);
|
|
62
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('forNoKeyUpdate'), args);
|
|
61
63
|
}
|
|
62
64
|
forKeyShare(...args) {
|
|
63
|
-
return this.addOperation(new KnexOperation('forKeyShare'), args);
|
|
65
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('forKeyShare'), args);
|
|
64
66
|
}
|
|
65
67
|
skipLocked(...args) {
|
|
66
|
-
return this.addOperation(new KnexOperation('skipLocked'), args);
|
|
68
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('skipLocked'), args);
|
|
67
69
|
}
|
|
68
70
|
noWait(...args) {
|
|
69
|
-
return this.addOperation(new KnexOperation('noWait'), args);
|
|
71
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('noWait'), args);
|
|
70
72
|
}
|
|
71
73
|
as(...args) {
|
|
72
|
-
return this.addOperation(new KnexOperation('as'), args);
|
|
74
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('as'), args);
|
|
73
75
|
}
|
|
74
76
|
columns(...args) {
|
|
75
|
-
return this.addOperation(new SelectOperation('columns'), args);
|
|
77
|
+
return this.addOperation(new SelectOperation_1.SelectOperation('columns'), args);
|
|
76
78
|
}
|
|
77
79
|
column(...args) {
|
|
78
|
-
return this.addOperation(new SelectOperation('column'), args);
|
|
80
|
+
return this.addOperation(new SelectOperation_1.SelectOperation('column'), args);
|
|
79
81
|
}
|
|
80
82
|
from(...args) {
|
|
81
|
-
return this.addOperation(new KnexOperation('from'), args);
|
|
83
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('from'), args);
|
|
82
84
|
}
|
|
83
85
|
fromJS(...args) {
|
|
84
|
-
return this.addOperation(new KnexOperation('fromJS'), args);
|
|
86
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('fromJS'), args);
|
|
85
87
|
}
|
|
86
88
|
fromRaw(...args) {
|
|
87
|
-
return this.addOperation(new KnexOperation('fromRaw'), args);
|
|
89
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('fromRaw'), args);
|
|
88
90
|
}
|
|
89
91
|
into(...args) {
|
|
90
|
-
return this.addOperation(new KnexOperation('into'), args);
|
|
92
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('into'), args);
|
|
91
93
|
}
|
|
92
94
|
withSchema(...args) {
|
|
93
|
-
return this.addOperation(new KnexOperation('withSchema'), args);
|
|
95
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('withSchema'), args);
|
|
94
96
|
}
|
|
95
97
|
table(...args) {
|
|
96
|
-
return this.addOperation(new KnexOperation('table'), args);
|
|
98
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('table'), args);
|
|
97
99
|
}
|
|
98
100
|
distinct(...args) {
|
|
99
|
-
return this.addOperation(new SelectOperation('distinct'), args);
|
|
101
|
+
return this.addOperation(new SelectOperation_1.SelectOperation('distinct'), args);
|
|
100
102
|
}
|
|
101
103
|
distinctOn(...args) {
|
|
102
|
-
return this.addOperation(new SelectOperation('distinctOn'), args);
|
|
104
|
+
return this.addOperation(new SelectOperation_1.SelectOperation('distinctOn'), args);
|
|
103
105
|
}
|
|
104
106
|
join(...args) {
|
|
105
|
-
return this.addOperation(new KnexOperation('join'), args);
|
|
107
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('join'), args);
|
|
106
108
|
}
|
|
107
109
|
joinRaw(...args) {
|
|
108
|
-
return this.addOperation(new KnexOperation('joinRaw'), args);
|
|
110
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('joinRaw'), args);
|
|
109
111
|
}
|
|
110
112
|
innerJoin(...args) {
|
|
111
|
-
return this.addOperation(new KnexOperation('innerJoin'), args);
|
|
113
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('innerJoin'), args);
|
|
112
114
|
}
|
|
113
115
|
leftJoin(...args) {
|
|
114
|
-
return this.addOperation(new KnexOperation('leftJoin'), args);
|
|
116
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('leftJoin'), args);
|
|
115
117
|
}
|
|
116
118
|
leftOuterJoin(...args) {
|
|
117
|
-
return this.addOperation(new KnexOperation('leftOuterJoin'), args);
|
|
119
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('leftOuterJoin'), args);
|
|
118
120
|
}
|
|
119
121
|
rightJoin(...args) {
|
|
120
|
-
return this.addOperation(new KnexOperation('rightJoin'), args);
|
|
122
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('rightJoin'), args);
|
|
121
123
|
}
|
|
122
124
|
rightOuterJoin(...args) {
|
|
123
|
-
return this.addOperation(new KnexOperation('rightOuterJoin'), args);
|
|
125
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('rightOuterJoin'), args);
|
|
124
126
|
}
|
|
125
127
|
outerJoin(...args) {
|
|
126
|
-
return this.addOperation(new KnexOperation('outerJoin'), args);
|
|
128
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('outerJoin'), args);
|
|
127
129
|
}
|
|
128
130
|
fullOuterJoin(...args) {
|
|
129
|
-
return this.addOperation(new KnexOperation('fullOuterJoin'), args);
|
|
131
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('fullOuterJoin'), args);
|
|
130
132
|
}
|
|
131
133
|
crossJoin(...args) {
|
|
132
|
-
return this.addOperation(new KnexOperation('crossJoin'), args);
|
|
134
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('crossJoin'), args);
|
|
133
135
|
}
|
|
134
136
|
where(...args) {
|
|
135
|
-
return this.addOperation(new KnexOperation('where'), args);
|
|
137
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('where'), args);
|
|
136
138
|
}
|
|
137
139
|
andWhere(...args) {
|
|
138
|
-
return this.addOperation(new KnexOperation('andWhere'), args);
|
|
140
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('andWhere'), args);
|
|
139
141
|
}
|
|
140
142
|
orWhere(...args) {
|
|
141
|
-
return this.addOperation(new KnexOperation('orWhere'), args);
|
|
143
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('orWhere'), args);
|
|
142
144
|
}
|
|
143
145
|
whereNot(...args) {
|
|
144
|
-
return this.addOperation(new KnexOperation('whereNot'), args);
|
|
146
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('whereNot'), args);
|
|
145
147
|
}
|
|
146
148
|
andWhereNot(...args) {
|
|
147
|
-
return this.addOperation(new KnexOperation('andWhereNot'), args);
|
|
149
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('andWhereNot'), args);
|
|
148
150
|
}
|
|
149
151
|
orWhereNot(...args) {
|
|
150
|
-
return this.addOperation(new KnexOperation('orWhereNot'), args);
|
|
152
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('orWhereNot'), args);
|
|
151
153
|
}
|
|
152
154
|
// Makes the query match no rows.
|
|
153
155
|
none() {
|
|
154
|
-
return this.where(expression('(1 = 0)', []));
|
|
156
|
+
return this.where((0, expressions_1.expression)('(1 = 0)', []));
|
|
155
157
|
}
|
|
156
158
|
whereRaw(...args) {
|
|
157
|
-
return this.addOperation(new KnexOperation('whereRaw'), args);
|
|
159
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('whereRaw'), args);
|
|
158
160
|
}
|
|
159
161
|
andWhereRaw(...args) {
|
|
160
|
-
return this.addOperation(new KnexOperation('andWhereRaw'), args);
|
|
162
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('andWhereRaw'), args);
|
|
161
163
|
}
|
|
162
164
|
orWhereRaw(...args) {
|
|
163
|
-
return this.addOperation(new KnexOperation('orWhereRaw'), args);
|
|
165
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('orWhereRaw'), args);
|
|
164
166
|
}
|
|
165
167
|
whereWrapped(...args) {
|
|
166
|
-
return this.addOperation(new KnexOperation('whereWrapped'), args);
|
|
168
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('whereWrapped'), args);
|
|
167
169
|
}
|
|
168
170
|
havingWrapped(...args) {
|
|
169
|
-
return this.addOperation(new KnexOperation('havingWrapped'), args);
|
|
171
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('havingWrapped'), args);
|
|
170
172
|
}
|
|
171
173
|
whereExists(...args) {
|
|
172
|
-
return this.addOperation(new KnexOperation('whereExists'), args);
|
|
174
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('whereExists'), args);
|
|
173
175
|
}
|
|
174
176
|
orWhereExists(...args) {
|
|
175
|
-
return this.addOperation(new KnexOperation('orWhereExists'), args);
|
|
177
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('orWhereExists'), args);
|
|
176
178
|
}
|
|
177
179
|
whereNotExists(...args) {
|
|
178
|
-
return this.addOperation(new KnexOperation('whereNotExists'), args);
|
|
180
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('whereNotExists'), args);
|
|
179
181
|
}
|
|
180
182
|
orWhereNotExists(...args) {
|
|
181
|
-
return this.addOperation(new KnexOperation('orWhereNotExists'), args);
|
|
183
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('orWhereNotExists'), args);
|
|
182
184
|
}
|
|
183
185
|
whereIn(...args) {
|
|
184
|
-
return this.addOperation(new KnexOperation('whereIn'), args);
|
|
186
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('whereIn'), args);
|
|
185
187
|
}
|
|
186
188
|
orWhereIn(...args) {
|
|
187
|
-
return this.addOperation(new KnexOperation('orWhereIn'), args);
|
|
189
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('orWhereIn'), args);
|
|
188
190
|
}
|
|
189
191
|
whereNotIn(...args) {
|
|
190
|
-
return this.addOperation(new KnexOperation('whereNotIn'), args);
|
|
192
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('whereNotIn'), args);
|
|
191
193
|
}
|
|
192
194
|
orWhereNotIn(...args) {
|
|
193
|
-
return this.addOperation(new KnexOperation('orWhereNotIn'), args);
|
|
195
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('orWhereNotIn'), args);
|
|
194
196
|
}
|
|
195
197
|
whereNull(...args) {
|
|
196
|
-
return this.addOperation(new KnexOperation('whereNull'), args);
|
|
198
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('whereNull'), args);
|
|
197
199
|
}
|
|
198
200
|
orWhereNull(...args) {
|
|
199
|
-
return this.addOperation(new KnexOperation('orWhereNull'), args);
|
|
201
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('orWhereNull'), args);
|
|
200
202
|
}
|
|
201
203
|
whereNotNull(...args) {
|
|
202
|
-
return this.addOperation(new KnexOperation('whereNotNull'), args);
|
|
204
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('whereNotNull'), args);
|
|
203
205
|
}
|
|
204
206
|
orWhereNotNull(...args) {
|
|
205
|
-
return this.addOperation(new KnexOperation('orWhereNotNull'), args);
|
|
207
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('orWhereNotNull'), args);
|
|
206
208
|
}
|
|
207
209
|
whereBetween(...args) {
|
|
208
|
-
return this.addOperation(new KnexOperation('whereBetween'), args);
|
|
210
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('whereBetween'), args);
|
|
209
211
|
}
|
|
210
212
|
andWhereBetween(...args) {
|
|
211
|
-
return this.addOperation(new KnexOperation('andWhereBetween'), args);
|
|
213
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('andWhereBetween'), args);
|
|
212
214
|
}
|
|
213
215
|
whereNotBetween(...args) {
|
|
214
|
-
return this.addOperation(new KnexOperation('whereNotBetween'), args);
|
|
216
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('whereNotBetween'), args);
|
|
215
217
|
}
|
|
216
218
|
andWhereNotBetween(...args) {
|
|
217
|
-
return this.addOperation(new KnexOperation('andWhereNotBetween'), args);
|
|
219
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('andWhereNotBetween'), args);
|
|
218
220
|
}
|
|
219
221
|
orWhereBetween(...args) {
|
|
220
|
-
return this.addOperation(new KnexOperation('orWhereBetween'), args);
|
|
222
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('orWhereBetween'), args);
|
|
221
223
|
}
|
|
222
224
|
orWhereNotBetween(...args) {
|
|
223
|
-
return this.addOperation(new KnexOperation('orWhereNotBetween'), args);
|
|
225
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('orWhereNotBetween'), args);
|
|
224
226
|
}
|
|
225
227
|
whereLike(...args) {
|
|
226
|
-
return this.addOperation(new KnexOperation('whereLike'), args);
|
|
228
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('whereLike'), args);
|
|
227
229
|
}
|
|
228
230
|
andWhereLike(...args) {
|
|
229
|
-
return this.addOperation(new KnexOperation('andWhereLike'), args);
|
|
231
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('andWhereLike'), args);
|
|
230
232
|
}
|
|
231
233
|
orWhereLike(...args) {
|
|
232
|
-
return this.addOperation(new KnexOperation('orWhereLike'), args);
|
|
234
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('orWhereLike'), args);
|
|
233
235
|
}
|
|
234
236
|
whereILike(...args) {
|
|
235
|
-
return this.addOperation(new KnexOperation('whereILike'), args);
|
|
237
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('whereILike'), args);
|
|
236
238
|
}
|
|
237
239
|
andWhereILike(...args) {
|
|
238
|
-
return this.addOperation(new KnexOperation('andWhereILike'), args);
|
|
240
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('andWhereILike'), args);
|
|
239
241
|
}
|
|
240
242
|
orWhereILike(...args) {
|
|
241
|
-
return this.addOperation(new KnexOperation('orWhereILike'), args);
|
|
243
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('orWhereILike'), args);
|
|
242
244
|
}
|
|
243
245
|
groupBy(...args) {
|
|
244
|
-
return this.addOperation(new KnexOperation('groupBy'), args);
|
|
246
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('groupBy'), args);
|
|
245
247
|
}
|
|
246
248
|
groupByRaw(...args) {
|
|
247
|
-
return this.addOperation(new KnexOperation('groupByRaw'), args);
|
|
249
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('groupByRaw'), args);
|
|
248
250
|
}
|
|
249
251
|
orderBy(...args) {
|
|
250
|
-
return this.addOperation(new KnexOperation('orderBy'), args);
|
|
252
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('orderBy'), args);
|
|
251
253
|
}
|
|
252
254
|
orderByRaw(...args) {
|
|
253
|
-
return this.addOperation(new KnexOperation('orderByRaw'), args);
|
|
255
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('orderByRaw'), args);
|
|
254
256
|
}
|
|
255
257
|
union(...args) {
|
|
256
|
-
return this.addOperation(new KnexOperation('union'), args);
|
|
258
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('union'), args);
|
|
257
259
|
}
|
|
258
260
|
unionAll(...args) {
|
|
259
|
-
return this.addOperation(new KnexOperation('unionAll'), args);
|
|
261
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('unionAll'), args);
|
|
260
262
|
}
|
|
261
263
|
intersect(...args) {
|
|
262
|
-
return this.addOperation(new KnexOperation('intersect'), args);
|
|
264
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('intersect'), args);
|
|
263
265
|
}
|
|
264
266
|
except(...args) {
|
|
265
|
-
return this.addOperation(new KnexOperation('except'), args);
|
|
267
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('except'), args);
|
|
266
268
|
}
|
|
267
269
|
having(...args) {
|
|
268
|
-
return this.addOperation(new KnexOperation('having'), args);
|
|
270
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('having'), args);
|
|
269
271
|
}
|
|
270
272
|
// Like clearSelect() and clearWhere(), these remove the operations, so that
|
|
271
273
|
// has() and copyFrom() see the query as it is.
|
|
@@ -276,249 +278,249 @@ class QueryBuilderBase extends QueryBuilderOperationSupport {
|
|
|
276
278
|
return this.clear(GroupBySelector);
|
|
277
279
|
}
|
|
278
280
|
orHaving(...args) {
|
|
279
|
-
return this.addOperation(new KnexOperation('orHaving'), args);
|
|
281
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('orHaving'), args);
|
|
280
282
|
}
|
|
281
283
|
havingIn(...args) {
|
|
282
|
-
return this.addOperation(new KnexOperation('havingIn'), args);
|
|
284
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('havingIn'), args);
|
|
283
285
|
}
|
|
284
286
|
orHavingIn(...args) {
|
|
285
|
-
return this.addOperation(new KnexOperation('orHavingIn'), args);
|
|
287
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('orHavingIn'), args);
|
|
286
288
|
}
|
|
287
289
|
havingNotIn(...args) {
|
|
288
|
-
return this.addOperation(new KnexOperation('havingNotIn'), args);
|
|
290
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('havingNotIn'), args);
|
|
289
291
|
}
|
|
290
292
|
orHavingNotIn(...args) {
|
|
291
|
-
return this.addOperation(new KnexOperation('orHavingNotIn'), args);
|
|
293
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('orHavingNotIn'), args);
|
|
292
294
|
}
|
|
293
295
|
havingNull(...args) {
|
|
294
|
-
return this.addOperation(new KnexOperation('havingNull'), args);
|
|
296
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('havingNull'), args);
|
|
295
297
|
}
|
|
296
298
|
orHavingNull(...args) {
|
|
297
|
-
return this.addOperation(new KnexOperation('orHavingNull'), args);
|
|
299
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('orHavingNull'), args);
|
|
298
300
|
}
|
|
299
301
|
havingNotNull(...args) {
|
|
300
|
-
return this.addOperation(new KnexOperation('havingNotNull'), args);
|
|
302
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('havingNotNull'), args);
|
|
301
303
|
}
|
|
302
304
|
orHavingNotNull(...args) {
|
|
303
|
-
return this.addOperation(new KnexOperation('orHavingNotNull'), args);
|
|
305
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('orHavingNotNull'), args);
|
|
304
306
|
}
|
|
305
307
|
havingExists(...args) {
|
|
306
|
-
return this.addOperation(new KnexOperation('havingExists'), args);
|
|
308
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('havingExists'), args);
|
|
307
309
|
}
|
|
308
310
|
orHavingExists(...args) {
|
|
309
|
-
return this.addOperation(new KnexOperation('orHavingExists'), args);
|
|
311
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('orHavingExists'), args);
|
|
310
312
|
}
|
|
311
313
|
havingNotExists(...args) {
|
|
312
|
-
return this.addOperation(new KnexOperation('havingNotExists'), args);
|
|
314
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('havingNotExists'), args);
|
|
313
315
|
}
|
|
314
316
|
orHavingNotExists(...args) {
|
|
315
|
-
return this.addOperation(new KnexOperation('orHavingNotExists'), args);
|
|
317
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('orHavingNotExists'), args);
|
|
316
318
|
}
|
|
317
319
|
havingBetween(...args) {
|
|
318
|
-
return this.addOperation(new KnexOperation('havingBetween'), args);
|
|
320
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('havingBetween'), args);
|
|
319
321
|
}
|
|
320
322
|
orHavingBetween(...args) {
|
|
321
|
-
return this.addOperation(new KnexOperation('orHavingBetween'), args);
|
|
323
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('orHavingBetween'), args);
|
|
322
324
|
}
|
|
323
325
|
havingNotBetween(...args) {
|
|
324
|
-
return this.addOperation(new KnexOperation('havingNotBetween'), args);
|
|
326
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('havingNotBetween'), args);
|
|
325
327
|
}
|
|
326
328
|
orHavingNotBetween(...args) {
|
|
327
|
-
return this.addOperation(new KnexOperation('orHavingNotBetween'), args);
|
|
329
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('orHavingNotBetween'), args);
|
|
328
330
|
}
|
|
329
331
|
andHaving(...args) {
|
|
330
|
-
return this.addOperation(new KnexOperation('andHaving'), args);
|
|
332
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('andHaving'), args);
|
|
331
333
|
}
|
|
332
334
|
andHavingIn(...args) {
|
|
333
|
-
return this.addOperation(new KnexOperation('andHavingIn'), args);
|
|
335
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('andHavingIn'), args);
|
|
334
336
|
}
|
|
335
337
|
andHavingNotIn(...args) {
|
|
336
|
-
return this.addOperation(new KnexOperation('andHavingNotIn'), args);
|
|
338
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('andHavingNotIn'), args);
|
|
337
339
|
}
|
|
338
340
|
andHavingNull(...args) {
|
|
339
|
-
return this.addOperation(new KnexOperation('andHavingNull'), args);
|
|
341
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('andHavingNull'), args);
|
|
340
342
|
}
|
|
341
343
|
andHavingNotNull(...args) {
|
|
342
|
-
return this.addOperation(new KnexOperation('andHavingNotNull'), args);
|
|
344
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('andHavingNotNull'), args);
|
|
343
345
|
}
|
|
344
346
|
andHavingExists(...args) {
|
|
345
|
-
return this.addOperation(new KnexOperation('andHavingExists'), args);
|
|
347
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('andHavingExists'), args);
|
|
346
348
|
}
|
|
347
349
|
andHavingNotExists(...args) {
|
|
348
|
-
return this.addOperation(new KnexOperation('andHavingNotExists'), args);
|
|
350
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('andHavingNotExists'), args);
|
|
349
351
|
}
|
|
350
352
|
andHavingBetween(...args) {
|
|
351
|
-
return this.addOperation(new KnexOperation('andHavingBetween'), args);
|
|
353
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('andHavingBetween'), args);
|
|
352
354
|
}
|
|
353
355
|
andHavingNotBetween(...args) {
|
|
354
|
-
return this.addOperation(new KnexOperation('andHavingNotBetween'), args);
|
|
356
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('andHavingNotBetween'), args);
|
|
355
357
|
}
|
|
356
358
|
comment(...args) {
|
|
357
|
-
return this.addOperation(new KnexOperation('comment'), args);
|
|
359
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('comment'), args);
|
|
358
360
|
}
|
|
359
361
|
hintComment(...args) {
|
|
360
|
-
return this.addOperation(new KnexOperation('hintComment'), args);
|
|
362
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('hintComment'), args);
|
|
361
363
|
}
|
|
362
364
|
using(...args) {
|
|
363
|
-
return this.addOperation(new KnexOperation('using'), args);
|
|
365
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('using'), args);
|
|
364
366
|
}
|
|
365
367
|
havingRaw(...args) {
|
|
366
|
-
return this.addOperation(new KnexOperation('havingRaw'), args);
|
|
368
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('havingRaw'), args);
|
|
367
369
|
}
|
|
368
370
|
orHavingRaw(...args) {
|
|
369
|
-
return this.addOperation(new KnexOperation('orHavingRaw'), args);
|
|
371
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('orHavingRaw'), args);
|
|
370
372
|
}
|
|
371
373
|
offset(...args) {
|
|
372
|
-
return this.addOperation(new KnexOperation('offset'), args);
|
|
374
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('offset'), args);
|
|
373
375
|
}
|
|
374
376
|
limit(...args) {
|
|
375
|
-
return this.addOperation(new KnexOperation('limit'), args);
|
|
377
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('limit'), args);
|
|
376
378
|
}
|
|
377
379
|
count(...args) {
|
|
378
|
-
return this.addOperation(new SelectOperation('count'), args);
|
|
380
|
+
return this.addOperation(new SelectOperation_1.SelectOperation('count'), args);
|
|
379
381
|
}
|
|
380
382
|
countDistinct(...args) {
|
|
381
|
-
return this.addOperation(new SelectOperation('countDistinct'), args);
|
|
383
|
+
return this.addOperation(new SelectOperation_1.SelectOperation('countDistinct'), args);
|
|
382
384
|
}
|
|
383
385
|
min(...args) {
|
|
384
|
-
return this.addOperation(new SelectOperation('min'), args);
|
|
386
|
+
return this.addOperation(new SelectOperation_1.SelectOperation('min'), args);
|
|
385
387
|
}
|
|
386
388
|
max(...args) {
|
|
387
|
-
return this.addOperation(new SelectOperation('max'), args);
|
|
389
|
+
return this.addOperation(new SelectOperation_1.SelectOperation('max'), args);
|
|
388
390
|
}
|
|
389
391
|
sum(...args) {
|
|
390
|
-
return this.addOperation(new SelectOperation('sum'), args);
|
|
392
|
+
return this.addOperation(new SelectOperation_1.SelectOperation('sum'), args);
|
|
391
393
|
}
|
|
392
394
|
sumDistinct(...args) {
|
|
393
|
-
return this.addOperation(new SelectOperation('sumDistinct'), args);
|
|
395
|
+
return this.addOperation(new SelectOperation_1.SelectOperation('sumDistinct'), args);
|
|
394
396
|
}
|
|
395
397
|
avg(...args) {
|
|
396
|
-
return this.addOperation(new SelectOperation('avg'), args);
|
|
398
|
+
return this.addOperation(new SelectOperation_1.SelectOperation('avg'), args);
|
|
397
399
|
}
|
|
398
400
|
avgDistinct(...args) {
|
|
399
|
-
return this.addOperation(new SelectOperation('avgDistinct'), args);
|
|
401
|
+
return this.addOperation(new SelectOperation_1.SelectOperation('avgDistinct'), args);
|
|
400
402
|
}
|
|
401
403
|
debug(...args) {
|
|
402
|
-
return this.addOperation(new KnexOperation('debug'), args);
|
|
404
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('debug'), args);
|
|
403
405
|
}
|
|
404
406
|
returning(...args) {
|
|
405
|
-
return this.addOperation(new ReturningOperation('returning'), args);
|
|
407
|
+
return this.addOperation(new ReturningOperation_1.ReturningOperation('returning'), args);
|
|
406
408
|
}
|
|
407
409
|
truncate(...args) {
|
|
408
|
-
return this.addOperation(new KnexOperation('truncate'), args);
|
|
410
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('truncate'), args);
|
|
409
411
|
}
|
|
410
412
|
connection(...args) {
|
|
411
|
-
return this.addOperation(new KnexOperation('connection'), args);
|
|
413
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('connection'), args);
|
|
412
414
|
}
|
|
413
415
|
options(...args) {
|
|
414
|
-
return this.addOperation(new KnexOperation('options'), args);
|
|
416
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('options'), args);
|
|
415
417
|
}
|
|
416
418
|
columnInfo(...args) {
|
|
417
|
-
return this.addOperation(new KnexOperation('columnInfo'), args);
|
|
419
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('columnInfo'), args);
|
|
418
420
|
}
|
|
419
421
|
off(...args) {
|
|
420
|
-
return this.addOperation(new KnexOperation('off'), args);
|
|
422
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('off'), args);
|
|
421
423
|
}
|
|
422
424
|
timeout(...args) {
|
|
423
|
-
return this.addOperation(new KnexOperation('timeout'), args);
|
|
425
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('timeout'), args);
|
|
424
426
|
}
|
|
425
427
|
with(...args) {
|
|
426
|
-
return this.addOperation(new KnexOperation('with'), args);
|
|
428
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('with'), args);
|
|
427
429
|
}
|
|
428
430
|
withWrapped(...args) {
|
|
429
|
-
return this.addOperation(new KnexOperation('withWrapped'), args);
|
|
431
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('withWrapped'), args);
|
|
430
432
|
}
|
|
431
433
|
withRecursive(...args) {
|
|
432
|
-
return this.addOperation(new KnexOperation('withRecursive'), args);
|
|
434
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('withRecursive'), args);
|
|
433
435
|
}
|
|
434
436
|
withMaterialized(...args) {
|
|
435
|
-
return this.addOperation(new KnexOperation('withMaterialized'), args);
|
|
437
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('withMaterialized'), args);
|
|
436
438
|
}
|
|
437
439
|
withNotMaterialized(...args) {
|
|
438
|
-
return this.addOperation(new KnexOperation('withNotMaterialized'), args);
|
|
440
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('withNotMaterialized'), args);
|
|
439
441
|
}
|
|
440
442
|
whereComposite(...args) {
|
|
441
|
-
return this.addOperation(new WhereCompositeOperation('whereComposite'), args);
|
|
443
|
+
return this.addOperation(new WhereCompositeOperation_1.WhereCompositeOperation('whereComposite'), args);
|
|
442
444
|
}
|
|
443
445
|
whereInComposite(...args) {
|
|
444
446
|
let operation = null;
|
|
445
|
-
if (isSqlite(this.knex())) {
|
|
446
|
-
operation = new WhereInCompositeSqliteOperation('whereInComposite');
|
|
447
|
+
if ((0, knexUtils_1.isSqlite)(this.knex())) {
|
|
448
|
+
operation = new WhereInCompositeSqliteOperation_1.WhereInCompositeSqliteOperation('whereInComposite');
|
|
447
449
|
}
|
|
448
|
-
else if (isMsSql(this.knex())) {
|
|
449
|
-
operation = new WhereInCompositeMsSqlOperation('whereInComposite');
|
|
450
|
+
else if ((0, knexUtils_1.isMsSql)(this.knex())) {
|
|
451
|
+
operation = new WhereInCompositeMsSqlOperation_1.WhereInCompositeMsSqlOperation('whereInComposite');
|
|
450
452
|
}
|
|
451
453
|
else {
|
|
452
|
-
operation = new WhereInCompositeOperation('whereInComposite');
|
|
454
|
+
operation = new WhereInCompositeOperation_1.WhereInCompositeOperation('whereInComposite');
|
|
453
455
|
}
|
|
454
456
|
return this.addOperation(operation, args);
|
|
455
457
|
}
|
|
456
458
|
whereNotInComposite(...args) {
|
|
457
459
|
let operation = null;
|
|
458
|
-
if (isSqlite(this.knex())) {
|
|
459
|
-
operation = new WhereInCompositeSqliteOperation('whereNotInComposite', { prefix: 'not' });
|
|
460
|
+
if ((0, knexUtils_1.isSqlite)(this.knex())) {
|
|
461
|
+
operation = new WhereInCompositeSqliteOperation_1.WhereInCompositeSqliteOperation('whereNotInComposite', { prefix: 'not' });
|
|
460
462
|
}
|
|
461
|
-
else if (isMsSql(this.knex())) {
|
|
462
|
-
operation = new WhereInCompositeMsSqlOperation('whereNotInComposite', { prefix: 'not' });
|
|
463
|
+
else if ((0, knexUtils_1.isMsSql)(this.knex())) {
|
|
464
|
+
operation = new WhereInCompositeMsSqlOperation_1.WhereInCompositeMsSqlOperation('whereNotInComposite', { prefix: 'not' });
|
|
463
465
|
}
|
|
464
466
|
else {
|
|
465
|
-
operation = new WhereInCompositeOperation('whereNotInComposite', { prefix: 'not' });
|
|
467
|
+
operation = new WhereInCompositeOperation_1.WhereInCompositeOperation('whereNotInComposite', { prefix: 'not' });
|
|
466
468
|
}
|
|
467
469
|
return this.addOperation(operation, args);
|
|
468
470
|
}
|
|
469
471
|
jsonExtract(...args) {
|
|
470
|
-
return this.addOperation(new KnexOperation('jsonExtract'), args);
|
|
472
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('jsonExtract'), args);
|
|
471
473
|
}
|
|
472
474
|
jsonSet(...args) {
|
|
473
|
-
return this.addOperation(new KnexOperation('jsonSet'), args);
|
|
475
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('jsonSet'), args);
|
|
474
476
|
}
|
|
475
477
|
jsonInsert(...args) {
|
|
476
|
-
return this.addOperation(new KnexOperation('jsonInsert'), args);
|
|
478
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('jsonInsert'), args);
|
|
477
479
|
}
|
|
478
480
|
jsonRemove(...args) {
|
|
479
|
-
return this.addOperation(new KnexOperation('jsonRemove'), args);
|
|
481
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('jsonRemove'), args);
|
|
480
482
|
}
|
|
481
483
|
whereJsonObject(...args) {
|
|
482
|
-
return this.addOperation(new KnexOperation('whereJsonObject'), args);
|
|
484
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('whereJsonObject'), args);
|
|
483
485
|
}
|
|
484
486
|
orWhereJsonObject(...args) {
|
|
485
|
-
return this.addOperation(new KnexOperation('orWhereJsonObject'), args);
|
|
487
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('orWhereJsonObject'), args);
|
|
486
488
|
}
|
|
487
489
|
andWhereJsonObject(...args) {
|
|
488
|
-
return this.addOperation(new KnexOperation('andWhereJsonObject'), args);
|
|
490
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('andWhereJsonObject'), args);
|
|
489
491
|
}
|
|
490
492
|
whereNotJsonObject(...args) {
|
|
491
|
-
return this.addOperation(new KnexOperation('whereNotJsonObject'), args);
|
|
493
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('whereNotJsonObject'), args);
|
|
492
494
|
}
|
|
493
495
|
orWhereNotJsonObject(...args) {
|
|
494
|
-
return this.addOperation(new KnexOperation('orWhereNotJsonObject'), args);
|
|
496
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('orWhereNotJsonObject'), args);
|
|
495
497
|
}
|
|
496
498
|
andWhereNotJsonObject(...args) {
|
|
497
|
-
return this.addOperation(new KnexOperation('andWhereNotJsonObject'), args);
|
|
499
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('andWhereNotJsonObject'), args);
|
|
498
500
|
}
|
|
499
501
|
whereJsonPath(...args) {
|
|
500
|
-
return this.addOperation(new KnexOperation('whereJsonPath'), args);
|
|
502
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('whereJsonPath'), args);
|
|
501
503
|
}
|
|
502
504
|
orWhereJsonPath(...args) {
|
|
503
|
-
return this.addOperation(new KnexOperation('orWhereJsonPath'), args);
|
|
505
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('orWhereJsonPath'), args);
|
|
504
506
|
}
|
|
505
507
|
andWhereJsonPath(...args) {
|
|
506
|
-
return this.addOperation(new KnexOperation('andWhereJsonPath'), args);
|
|
508
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('andWhereJsonPath'), args);
|
|
507
509
|
}
|
|
508
510
|
// whereJson(Not)SupersetOf / whereJson(Not)SubsetOf are now supported by knex >= 1.0, but for now
|
|
509
511
|
// objection handles them differently and only for postgres.
|
|
510
512
|
// Changing them to utilize knex methods directly may require a major version bump and upgrade guide.
|
|
511
513
|
whereJsonSupersetOf(...args) {
|
|
512
|
-
return this.addOperation(new WhereJsonOperation('whereJsonSupersetOf', { operator: '@>', bool: 'and' }), args);
|
|
514
|
+
return this.addOperation(new WhereJsonOperation_1.WhereJsonOperation('whereJsonSupersetOf', { operator: '@>', bool: 'and' }), args);
|
|
513
515
|
}
|
|
514
516
|
andWhereJsonSupersetOf(...args) {
|
|
515
517
|
return this.whereJsonSupersetOf(...args);
|
|
516
518
|
}
|
|
517
519
|
orWhereJsonSupersetOf(...args) {
|
|
518
|
-
return this.addOperation(new WhereJsonOperation('orWhereJsonSupersetOf', { operator: '@>', bool: 'or' }), args);
|
|
520
|
+
return this.addOperation(new WhereJsonOperation_1.WhereJsonOperation('orWhereJsonSupersetOf', { operator: '@>', bool: 'or' }), args);
|
|
519
521
|
}
|
|
520
522
|
whereJsonNotSupersetOf(...args) {
|
|
521
|
-
return this.addOperation(new WhereJsonOperation('whereJsonNotSupersetOf', {
|
|
523
|
+
return this.addOperation(new WhereJsonOperation_1.WhereJsonOperation('whereJsonNotSupersetOf', {
|
|
522
524
|
operator: '@>',
|
|
523
525
|
bool: 'and',
|
|
524
526
|
prefix: 'not',
|
|
@@ -528,23 +530,23 @@ class QueryBuilderBase extends QueryBuilderOperationSupport {
|
|
|
528
530
|
return this.whereJsonNotSupersetOf(...args);
|
|
529
531
|
}
|
|
530
532
|
orWhereJsonNotSupersetOf(...args) {
|
|
531
|
-
return this.addOperation(new WhereJsonOperation('orWhereJsonNotSupersetOf', {
|
|
533
|
+
return this.addOperation(new WhereJsonOperation_1.WhereJsonOperation('orWhereJsonNotSupersetOf', {
|
|
532
534
|
operator: '@>',
|
|
533
535
|
bool: 'or',
|
|
534
536
|
prefix: 'not',
|
|
535
537
|
}), args);
|
|
536
538
|
}
|
|
537
539
|
whereJsonSubsetOf(...args) {
|
|
538
|
-
return this.addOperation(new WhereJsonOperation('whereJsonSubsetOf', { operator: '<@', bool: 'and' }), args);
|
|
540
|
+
return this.addOperation(new WhereJsonOperation_1.WhereJsonOperation('whereJsonSubsetOf', { operator: '<@', bool: 'and' }), args);
|
|
539
541
|
}
|
|
540
542
|
andWhereJsonSubsetOf(...args) {
|
|
541
543
|
return this.whereJsonSubsetOf(...args);
|
|
542
544
|
}
|
|
543
545
|
orWhereJsonSubsetOf(...args) {
|
|
544
|
-
return this.addOperation(new WhereJsonOperation('orWhereJsonSubsetOf', { operator: '<@', bool: 'or' }), args);
|
|
546
|
+
return this.addOperation(new WhereJsonOperation_1.WhereJsonOperation('orWhereJsonSubsetOf', { operator: '<@', bool: 'or' }), args);
|
|
545
547
|
}
|
|
546
548
|
whereJsonNotSubsetOf(...args) {
|
|
547
|
-
return this.addOperation(new WhereJsonOperation('whereJsonNotSubsetOf', {
|
|
549
|
+
return this.addOperation(new WhereJsonOperation_1.WhereJsonOperation('whereJsonNotSubsetOf', {
|
|
548
550
|
operator: '<@',
|
|
549
551
|
bool: 'and',
|
|
550
552
|
prefix: 'not',
|
|
@@ -554,65 +556,65 @@ class QueryBuilderBase extends QueryBuilderOperationSupport {
|
|
|
554
556
|
return this.whereJsonNotSubsetOf(...args);
|
|
555
557
|
}
|
|
556
558
|
orWhereJsonNotSubsetOf(...args) {
|
|
557
|
-
return this.addOperation(new WhereJsonOperation('orWhereJsonNotSubsetOf', {
|
|
559
|
+
return this.addOperation(new WhereJsonOperation_1.WhereJsonOperation('orWhereJsonNotSubsetOf', {
|
|
558
560
|
operator: '<@',
|
|
559
561
|
bool: 'or',
|
|
560
562
|
prefix: 'not',
|
|
561
563
|
}), args);
|
|
562
564
|
}
|
|
563
565
|
whereJsonNotArray(...args) {
|
|
564
|
-
return this.addOperation(new WhereJsonNotObjectOperation('whereJsonNotArray', {
|
|
566
|
+
return this.addOperation(new WhereJsonNotObjectOperation_1.WhereJsonNotObjectOperation('whereJsonNotArray', {
|
|
565
567
|
bool: 'and',
|
|
566
568
|
compareValue: [],
|
|
567
569
|
}), args);
|
|
568
570
|
}
|
|
569
571
|
orWhereJsonNotArray(...args) {
|
|
570
|
-
return this.addOperation(new WhereJsonNotObjectOperation('orWhereJsonNotArray', {
|
|
572
|
+
return this.addOperation(new WhereJsonNotObjectOperation_1.WhereJsonNotObjectOperation('orWhereJsonNotArray', {
|
|
571
573
|
bool: 'or',
|
|
572
574
|
compareValue: [],
|
|
573
575
|
}), args);
|
|
574
576
|
}
|
|
575
577
|
whereJsonNotObject(...args) {
|
|
576
|
-
return this.addOperation(new WhereJsonNotObjectOperation('whereJsonNotObject', {
|
|
578
|
+
return this.addOperation(new WhereJsonNotObjectOperation_1.WhereJsonNotObjectOperation('whereJsonNotObject', {
|
|
577
579
|
bool: 'and',
|
|
578
580
|
compareValue: {},
|
|
579
581
|
}), args);
|
|
580
582
|
}
|
|
581
583
|
orWhereJsonNotObject(...args) {
|
|
582
|
-
return this.addOperation(new WhereJsonNotObjectOperation('orWhereJsonNotObject', {
|
|
584
|
+
return this.addOperation(new WhereJsonNotObjectOperation_1.WhereJsonNotObjectOperation('orWhereJsonNotObject', {
|
|
583
585
|
bool: 'or',
|
|
584
586
|
compareValue: {},
|
|
585
587
|
}), args);
|
|
586
588
|
}
|
|
587
589
|
whereJsonHasAny(...args) {
|
|
588
|
-
return this.addOperation(new WhereJsonHasOperation('whereJsonHasAny', { bool: 'and', operator: '?|' }), args);
|
|
590
|
+
return this.addOperation(new WhereJsonHasOperation_1.WhereJsonHasOperation('whereJsonHasAny', { bool: 'and', operator: '?|' }), args);
|
|
589
591
|
}
|
|
590
592
|
orWhereJsonHasAny(...args) {
|
|
591
|
-
return this.addOperation(new WhereJsonHasOperation('orWhereJsonHasAny', { bool: 'or', operator: '?|' }), args);
|
|
593
|
+
return this.addOperation(new WhereJsonHasOperation_1.WhereJsonHasOperation('orWhereJsonHasAny', { bool: 'or', operator: '?|' }), args);
|
|
592
594
|
}
|
|
593
595
|
whereJsonHasAll(...args) {
|
|
594
|
-
return this.addOperation(new WhereJsonHasOperation('whereJsonHasAll', { bool: 'and', operator: '?&' }), args);
|
|
596
|
+
return this.addOperation(new WhereJsonHasOperation_1.WhereJsonHasOperation('whereJsonHasAll', { bool: 'and', operator: '?&' }), args);
|
|
595
597
|
}
|
|
596
598
|
orWhereJsonHasAll(...args) {
|
|
597
|
-
return this.addOperation(new WhereJsonHasOperation('orWhereJsonHasAll', { bool: 'or', operator: '?&' }), args);
|
|
599
|
+
return this.addOperation(new WhereJsonHasOperation_1.WhereJsonHasOperation('orWhereJsonHasAll', { bool: 'or', operator: '?&' }), args);
|
|
598
600
|
}
|
|
599
601
|
whereJsonOverlaps(...args) {
|
|
600
|
-
return this.addOperation(new WhereJsonOverlapsOperation('whereJsonOverlaps', { bool: 'and' }), args);
|
|
602
|
+
return this.addOperation(new WhereJsonOverlapsOperation_1.WhereJsonOverlapsOperation('whereJsonOverlaps', { bool: 'and' }), args);
|
|
601
603
|
}
|
|
602
604
|
andWhereJsonOverlaps(...args) {
|
|
603
605
|
return this.whereJsonOverlaps(...args);
|
|
604
606
|
}
|
|
605
607
|
orWhereJsonOverlaps(...args) {
|
|
606
|
-
return this.addOperation(new WhereJsonOverlapsOperation('orWhereJsonOverlaps', { bool: 'or' }), args);
|
|
608
|
+
return this.addOperation(new WhereJsonOverlapsOperation_1.WhereJsonOverlapsOperation('orWhereJsonOverlaps', { bool: 'or' }), args);
|
|
607
609
|
}
|
|
608
610
|
whereJsonNotOverlaps(...args) {
|
|
609
|
-
return this.addOperation(new WhereJsonOverlapsOperation('whereJsonNotOverlaps', { bool: 'and', prefix: 'not' }), args);
|
|
611
|
+
return this.addOperation(new WhereJsonOverlapsOperation_1.WhereJsonOverlapsOperation('whereJsonNotOverlaps', { bool: 'and', prefix: 'not' }), args);
|
|
610
612
|
}
|
|
611
613
|
andWhereJsonNotOverlaps(...args) {
|
|
612
614
|
return this.whereJsonNotOverlaps(...args);
|
|
613
615
|
}
|
|
614
616
|
orWhereJsonNotOverlaps(...args) {
|
|
615
|
-
return this.addOperation(new WhereJsonOverlapsOperation('orWhereJsonNotOverlaps', { bool: 'or', prefix: 'not' }), args);
|
|
617
|
+
return this.addOperation(new WhereJsonOverlapsOperation_1.WhereJsonOverlapsOperation('orWhereJsonNotOverlaps', { bool: 'or', prefix: 'not' }), args);
|
|
616
618
|
}
|
|
617
619
|
whereJsonIsArray(fieldExpression) {
|
|
618
620
|
return this.whereJsonSupersetOf(fieldExpression, []);
|
|
@@ -627,33 +629,34 @@ class QueryBuilderBase extends QueryBuilderOperationSupport {
|
|
|
627
629
|
return this.orWhereJsonSupersetOf(fieldExpression, {});
|
|
628
630
|
}
|
|
629
631
|
whereColumn(...args) {
|
|
630
|
-
return this.addOperation(new KnexOperation('whereColumn'), args);
|
|
632
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('whereColumn'), args);
|
|
631
633
|
}
|
|
632
634
|
andWhereColumn(...args) {
|
|
633
|
-
return this.addOperation(new KnexOperation('andWhereColumn'), args);
|
|
635
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('andWhereColumn'), args);
|
|
634
636
|
}
|
|
635
637
|
orWhereColumn(...args) {
|
|
636
|
-
return this.addOperation(new KnexOperation('orWhereColumn'), args);
|
|
638
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('orWhereColumn'), args);
|
|
637
639
|
}
|
|
638
640
|
whereNotColumn(...args) {
|
|
639
|
-
return this.addOperation(new KnexOperation('whereNotColumn'), args);
|
|
641
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('whereNotColumn'), args);
|
|
640
642
|
}
|
|
641
643
|
andWhereNotColumn(...args) {
|
|
642
|
-
return this.addOperation(new KnexOperation('andWhereNotColumn'), args);
|
|
644
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('andWhereNotColumn'), args);
|
|
643
645
|
}
|
|
644
646
|
orWhereNotColumn(...args) {
|
|
645
|
-
return this.addOperation(new KnexOperation('orWhereNotColumn'), args);
|
|
647
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('orWhereNotColumn'), args);
|
|
646
648
|
}
|
|
647
649
|
onConflict(...args) {
|
|
648
|
-
return this.addOperation(new KnexOperation('onConflict'), args);
|
|
650
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('onConflict'), args);
|
|
649
651
|
}
|
|
650
652
|
ignore(...args) {
|
|
651
|
-
return this.addOperation(new KnexOperation('ignore'), args);
|
|
653
|
+
return this.addOperation(new KnexOperation_1.KnexOperation('ignore'), args);
|
|
652
654
|
}
|
|
653
655
|
merge(...args) {
|
|
654
|
-
return this.addOperation(new MergeOperation('merge'), args);
|
|
656
|
+
return this.addOperation(new MergeOperation_1.MergeOperation('merge'), args);
|
|
655
657
|
}
|
|
656
658
|
}
|
|
659
|
+
exports.QueryBuilderBase = QueryBuilderBase;
|
|
657
660
|
Object.defineProperties(QueryBuilderBase.prototype, {
|
|
658
661
|
isObjectionQueryBuilderBase: {
|
|
659
662
|
enumerable: false,
|
|
@@ -661,6 +664,3 @@ Object.defineProperties(QueryBuilderBase.prototype, {
|
|
|
661
664
|
value: true,
|
|
662
665
|
},
|
|
663
666
|
});
|
|
664
|
-
module.exports = {
|
|
665
|
-
QueryBuilderBase,
|
|
666
|
-
};
|