@abedmurrar/objection 4.0.0-beta.0 → 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/Relation.js +31 -29
- package/lib/relations/RelationDeleteOperation.js +8 -8
- package/lib/relations/RelationFindOperation.js +8 -6
- package/lib/relations/RelationInsertOperation.js +6 -6
- package/lib/relations/RelationOwner.js +16 -13
- package/lib/relations/RelationProperty.js +18 -15
- package/lib/relations/RelationUpdateOperation.js +8 -8
- package/lib/relations/belongsToOne/BelongsToOneDeleteOperation.js +6 -6
- package/lib/relations/belongsToOne/BelongsToOneInsertOperation.js +8 -8
- package/lib/relations/belongsToOne/BelongsToOneRelateOperation.js +8 -8
- package/lib/relations/belongsToOne/BelongsToOneRelation.js +14 -14
- package/lib/relations/belongsToOne/BelongsToOneUnrelateOperation.js +6 -6
- package/lib/relations/hasMany/HasManyInsertOperation.js +6 -6
- package/lib/relations/hasMany/HasManyRelateOperation.js +11 -11
- package/lib/relations/hasMany/HasManyRelation.js +12 -12
- package/lib/relations/hasMany/HasManyUnrelateOperation.js +9 -9
- package/lib/relations/hasOne/HasOneRelation.js +6 -6
- package/lib/relations/hasOneThrough/HasOneThroughRelation.js +6 -6
- package/lib/relations/manyToMany/ManyToManyModifyMixin.js +9 -8
- package/lib/relations/manyToMany/ManyToManyRelation.js +52 -49
- package/lib/relations/manyToMany/ManyToManySqliteModifyMixin.js +6 -6
- package/lib/relations/manyToMany/delete/ManyToManyDeleteOperation.js +7 -7
- package/lib/relations/manyToMany/delete/ManyToManyDeleteOperationBase.js +6 -6
- package/lib/relations/manyToMany/delete/ManyToManyDeleteSqliteOperation.js +7 -7
- package/lib/relations/manyToMany/find/ManyToManyFindOperation.js +8 -8
- package/lib/relations/manyToMany/insert/ManyToManyInsertOperation.js +8 -8
- package/lib/relations/manyToMany/relate/ManyToManyRelateOperation.js +11 -10
- package/lib/relations/manyToMany/unrelate/ManyToManyUnrelateOperation.js +7 -7
- package/lib/relations/manyToMany/unrelate/ManyToManyUnrelateOperationBase.js +8 -8
- package/lib/relations/manyToMany/unrelate/ManyToManyUnrelateSqliteOperation.js +7 -7
- package/lib/relations/manyToMany/update/ManyToManyUpdateOperation.js +7 -7
- package/lib/relations/manyToMany/update/ManyToManyUpdateOperationBase.js +8 -8
- package/lib/relations/manyToMany/update/ManyToManyUpdateSqliteOperation.js +7 -7
- 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,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BelongsToOneInsertOperation = void 0;
|
|
4
|
+
const RelationInsertOperation_1 = require("../RelationInsertOperation");
|
|
5
|
+
const BelongsToOneRelateOperation_1 = require("./BelongsToOneRelateOperation");
|
|
6
|
+
class BelongsToOneInsertOperation extends RelationInsertOperation_1.RelationInsertOperation {
|
|
5
7
|
onAdd(builder, args) {
|
|
6
8
|
const retVal = super.onAdd(builder, args);
|
|
7
9
|
if (this.models.length > 1) {
|
|
@@ -14,7 +16,7 @@ class BelongsToOneInsertOperation extends RelationInsertOperation {
|
|
|
14
16
|
if (!builder.isExecutable()) {
|
|
15
17
|
return inserted;
|
|
16
18
|
}
|
|
17
|
-
const relateOp = new BelongsToOneRelateOperation('relate', {
|
|
19
|
+
const relateOp = new BelongsToOneRelateOperation_1.BelongsToOneRelateOperation('relate', {
|
|
18
20
|
relation: this.relation,
|
|
19
21
|
owner: this.owner,
|
|
20
22
|
});
|
|
@@ -28,6 +30,4 @@ class BelongsToOneInsertOperation extends RelationInsertOperation {
|
|
|
28
30
|
return inserted;
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
|
-
|
|
32
|
-
BelongsToOneInsertOperation,
|
|
33
|
-
};
|
|
33
|
+
exports.BelongsToOneInsertOperation = BelongsToOneInsertOperation;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BelongsToOneRelateOperation = void 0;
|
|
4
|
+
const normalizeIds_1 = require("../../utils/normalizeIds");
|
|
5
|
+
const RelateOperation_1 = require("../../queryBuilder/operations/RelateOperation");
|
|
6
|
+
class BelongsToOneRelateOperation extends RelateOperation_1.RelateOperation {
|
|
5
7
|
onAdd(_, args) {
|
|
6
8
|
this.input = args[0];
|
|
7
|
-
this.ids = normalizeIds(args[0], this.relation.relatedProp, { arrayOutput: true });
|
|
9
|
+
this.ids = (0, normalizeIds_1.normalizeIds)(args[0], this.relation.relatedProp, { arrayOutput: true });
|
|
8
10
|
assertOneId(this.ids);
|
|
9
11
|
return true;
|
|
10
12
|
}
|
|
@@ -29,11 +31,9 @@ class BelongsToOneRelateOperation extends RelateOperation {
|
|
|
29
31
|
.whereInComposite(ownerIdProp.refs(builder), ownerIds);
|
|
30
32
|
}
|
|
31
33
|
}
|
|
34
|
+
exports.BelongsToOneRelateOperation = BelongsToOneRelateOperation;
|
|
32
35
|
function assertOneId(ids) {
|
|
33
36
|
if (ids.length > 1) {
|
|
34
37
|
throw new Error('can only relate one model to a BelongsToOneRelation');
|
|
35
38
|
}
|
|
36
39
|
}
|
|
37
|
-
module.exports = {
|
|
38
|
-
BelongsToOneRelateOperation,
|
|
39
|
-
};
|
|
@@ -1,38 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BelongsToOneRelation = void 0;
|
|
4
|
+
const Relation_1 = require("../Relation");
|
|
5
|
+
const BelongsToOneInsertOperation_1 = require("./BelongsToOneInsertOperation");
|
|
6
|
+
const BelongsToOneDeleteOperation_1 = require("./BelongsToOneDeleteOperation");
|
|
7
|
+
const BelongsToOneRelateOperation_1 = require("./BelongsToOneRelateOperation");
|
|
8
|
+
const BelongsToOneUnrelateOperation_1 = require("./BelongsToOneUnrelateOperation");
|
|
9
|
+
class BelongsToOneRelation extends Relation_1.Relation {
|
|
8
10
|
isOneToOne() {
|
|
9
11
|
return true;
|
|
10
12
|
}
|
|
11
13
|
insert(_, owner) {
|
|
12
|
-
return new BelongsToOneInsertOperation('insert', {
|
|
14
|
+
return new BelongsToOneInsertOperation_1.BelongsToOneInsertOperation('insert', {
|
|
13
15
|
relation: this,
|
|
14
16
|
owner,
|
|
15
17
|
});
|
|
16
18
|
}
|
|
17
19
|
delete(_, owner) {
|
|
18
|
-
return new BelongsToOneDeleteOperation('delete', {
|
|
20
|
+
return new BelongsToOneDeleteOperation_1.BelongsToOneDeleteOperation('delete', {
|
|
19
21
|
relation: this,
|
|
20
22
|
owner,
|
|
21
23
|
});
|
|
22
24
|
}
|
|
23
25
|
relate(_, owner) {
|
|
24
|
-
return new BelongsToOneRelateOperation('relate', {
|
|
26
|
+
return new BelongsToOneRelateOperation_1.BelongsToOneRelateOperation('relate', {
|
|
25
27
|
relation: this,
|
|
26
28
|
owner,
|
|
27
29
|
});
|
|
28
30
|
}
|
|
29
31
|
unrelate(_, owner) {
|
|
30
|
-
return new BelongsToOneUnrelateOperation('unrelate', {
|
|
32
|
+
return new BelongsToOneUnrelateOperation_1.BelongsToOneUnrelateOperation('unrelate', {
|
|
31
33
|
relation: this,
|
|
32
34
|
owner,
|
|
33
35
|
});
|
|
34
36
|
}
|
|
35
37
|
}
|
|
38
|
+
exports.BelongsToOneRelation = BelongsToOneRelation;
|
|
36
39
|
Object.defineProperties(BelongsToOneRelation.prototype, {
|
|
37
40
|
isObjectionBelongsToOneRelation: {
|
|
38
41
|
enumerable: false,
|
|
@@ -40,6 +43,3 @@ Object.defineProperties(BelongsToOneRelation.prototype, {
|
|
|
40
43
|
value: true,
|
|
41
44
|
},
|
|
42
45
|
});
|
|
43
|
-
module.exports = {
|
|
44
|
-
BelongsToOneRelation,
|
|
45
|
-
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BelongsToOneUnrelateOperation = void 0;
|
|
4
|
+
const UnrelateOperation_1 = require("../../queryBuilder/operations/UnrelateOperation");
|
|
5
|
+
class BelongsToOneUnrelateOperation extends UnrelateOperation_1.UnrelateOperation {
|
|
4
6
|
onAdd() {
|
|
5
7
|
const ids = new Array(this.relation.ownerProp.size);
|
|
6
8
|
this.relation.ownerProp.forEach((i) => {
|
|
@@ -41,6 +43,4 @@ class BelongsToOneUnrelateOperation extends UnrelateOperation {
|
|
|
41
43
|
return query;
|
|
42
44
|
}
|
|
43
45
|
}
|
|
44
|
-
|
|
45
|
-
BelongsToOneUnrelateOperation,
|
|
46
|
-
};
|
|
46
|
+
exports.BelongsToOneUnrelateOperation = BelongsToOneUnrelateOperation;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HasManyInsertOperation = void 0;
|
|
4
|
+
const RelationInsertOperation_1 = require("../RelationInsertOperation");
|
|
5
|
+
class HasManyInsertOperation extends RelationInsertOperation_1.RelationInsertOperation {
|
|
4
6
|
onAdd(builder, args) {
|
|
5
7
|
const retVal = super.onAdd(builder, args);
|
|
6
8
|
assertOwnerIsSingleItem(this.owner, this.relation);
|
|
@@ -26,6 +28,7 @@ class HasManyInsertOperation extends RelationInsertOperation {
|
|
|
26
28
|
return inserted;
|
|
27
29
|
}
|
|
28
30
|
}
|
|
31
|
+
exports.HasManyInsertOperation = HasManyInsertOperation;
|
|
29
32
|
function assertOwnerIsSingleItem(owner, relation) {
|
|
30
33
|
const { isModels, isIdentifiers, isQueryBuilder } = owner;
|
|
31
34
|
const { ownerProp } = relation;
|
|
@@ -40,6 +43,3 @@ function assertOwnerIsSingleItem(owner, relation) {
|
|
|
40
43
|
].join(' '));
|
|
41
44
|
}
|
|
42
45
|
}
|
|
43
|
-
module.exports = {
|
|
44
|
-
HasManyInsertOperation,
|
|
45
|
-
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HasManyRelateOperation = void 0;
|
|
4
|
+
const whereScopes_1 = require("../../queryBuilder/whereScopes");
|
|
5
|
+
const normalizeIds_1 = require("../../utils/normalizeIds");
|
|
6
|
+
const RelateOperation_1 = require("../../queryBuilder/operations/RelateOperation");
|
|
7
|
+
class HasManyRelateOperation extends RelateOperation_1.RelateOperation {
|
|
6
8
|
onAdd(_, args) {
|
|
7
9
|
this.input = args[0];
|
|
8
|
-
this.ids = normalizeIds(args[0], this.relation.relatedModelClass.getIdRelationProperty(), {
|
|
10
|
+
this.ids = (0, normalizeIds_1.normalizeIds)(args[0], this.relation.relatedModelClass.getIdRelationProperty(), {
|
|
9
11
|
arrayOutput: true,
|
|
10
12
|
});
|
|
11
13
|
assertOwnerIsSingleItem(this.owner, this.relation);
|
|
@@ -24,11 +26,12 @@ class HasManyRelateOperation extends RelateOperation {
|
|
|
24
26
|
.patch(patch)
|
|
25
27
|
.copyFrom(builder, builder.constructor.JoinSelector)
|
|
26
28
|
.copyFrom(builder, builder.constructor.WhereSelector);
|
|
27
|
-
withWhereScope(query, () => query.findByIds(this.ids));
|
|
28
|
-
withWhereScope(query, () => query.modify(this.relation.modify));
|
|
29
|
+
(0, whereScopes_1.withWhereScope)(query, () => query.findByIds(this.ids));
|
|
30
|
+
(0, whereScopes_1.withWhereScope)(query, () => query.modify(this.relation.modify));
|
|
29
31
|
return query;
|
|
30
32
|
}
|
|
31
33
|
}
|
|
34
|
+
exports.HasManyRelateOperation = HasManyRelateOperation;
|
|
32
35
|
function assertOwnerIsSingleItem(owner, relation) {
|
|
33
36
|
const { isModels, isIdentifiers, isQueryBuilder } = owner;
|
|
34
37
|
const { ownerProp } = relation;
|
|
@@ -43,6 +46,3 @@ function assertOwnerIsSingleItem(owner, relation) {
|
|
|
43
46
|
].join(' '));
|
|
44
47
|
}
|
|
45
48
|
}
|
|
46
|
-
module.exports = {
|
|
47
|
-
HasManyRelateOperation,
|
|
48
|
-
};
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HasManyRelation = void 0;
|
|
4
|
+
const Relation_1 = require("../Relation");
|
|
5
|
+
const HasManyInsertOperation_1 = require("./HasManyInsertOperation");
|
|
6
|
+
const HasManyRelateOperation_1 = require("./HasManyRelateOperation");
|
|
7
|
+
const HasManyUnrelateOperation_1 = require("./HasManyUnrelateOperation");
|
|
8
|
+
class HasManyRelation extends Relation_1.Relation {
|
|
7
9
|
insert(_, owner) {
|
|
8
|
-
return new HasManyInsertOperation('insert', {
|
|
10
|
+
return new HasManyInsertOperation_1.HasManyInsertOperation('insert', {
|
|
9
11
|
relation: this,
|
|
10
12
|
owner: owner,
|
|
11
13
|
});
|
|
12
14
|
}
|
|
13
15
|
relate(_, owner) {
|
|
14
|
-
return new HasManyRelateOperation('relate', {
|
|
16
|
+
return new HasManyRelateOperation_1.HasManyRelateOperation('relate', {
|
|
15
17
|
relation: this,
|
|
16
18
|
owner: owner,
|
|
17
19
|
});
|
|
18
20
|
}
|
|
19
21
|
unrelate(_, owner) {
|
|
20
|
-
return new HasManyUnrelateOperation('unrelate', {
|
|
22
|
+
return new HasManyUnrelateOperation_1.HasManyUnrelateOperation('unrelate', {
|
|
21
23
|
relation: this,
|
|
22
24
|
owner: owner,
|
|
23
25
|
});
|
|
@@ -29,6 +31,7 @@ class HasManyRelation extends Relation {
|
|
|
29
31
|
model.$id(values);
|
|
30
32
|
}
|
|
31
33
|
}
|
|
34
|
+
exports.HasManyRelation = HasManyRelation;
|
|
32
35
|
Object.defineProperties(HasManyRelation.prototype, {
|
|
33
36
|
isObjectionHasManyRelation: {
|
|
34
37
|
enumerable: false,
|
|
@@ -36,6 +39,3 @@ Object.defineProperties(HasManyRelation.prototype, {
|
|
|
36
39
|
value: true,
|
|
37
40
|
},
|
|
38
41
|
});
|
|
39
|
-
module.exports = {
|
|
40
|
-
HasManyRelation,
|
|
41
|
-
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HasManyUnrelateOperation = void 0;
|
|
4
|
+
const whereScopes_1 = require("../../queryBuilder/whereScopes");
|
|
5
|
+
const UnrelateOperation_1 = require("../../queryBuilder/operations/UnrelateOperation");
|
|
6
|
+
class HasManyUnrelateOperation extends UnrelateOperation_1.UnrelateOperation {
|
|
5
7
|
queryExecutor(builder) {
|
|
6
8
|
const patch = {};
|
|
7
9
|
const relatedProp = this.relation.relatedProp;
|
|
@@ -16,11 +18,9 @@ class HasManyUnrelateOperation extends UnrelateOperation {
|
|
|
16
18
|
.patch(patch)
|
|
17
19
|
.copyFrom(builder, builder.constructor.JoinSelector)
|
|
18
20
|
.copyFrom(builder, builder.constructor.WhereSelector);
|
|
19
|
-
withWhereScope(query, () => query.whereInComposite(relatedRefs, ownerValues));
|
|
20
|
-
withWhereScope(query, () => query.modify(this.relation.modify));
|
|
21
|
+
(0, whereScopes_1.withWhereScope)(query, () => query.whereInComposite(relatedRefs, ownerValues));
|
|
22
|
+
(0, whereScopes_1.withWhereScope)(query, () => query.modify(this.relation.modify));
|
|
21
23
|
return query;
|
|
22
24
|
}
|
|
23
25
|
}
|
|
24
|
-
|
|
25
|
-
HasManyUnrelateOperation,
|
|
26
|
-
};
|
|
26
|
+
exports.HasManyUnrelateOperation = HasManyUnrelateOperation;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HasOneRelation = void 0;
|
|
4
|
+
const HasManyRelation_1 = require("../hasMany/HasManyRelation");
|
|
5
|
+
class HasOneRelation extends HasManyRelation_1.HasManyRelation {
|
|
4
6
|
isOneToOne() {
|
|
5
7
|
return true;
|
|
6
8
|
}
|
|
7
9
|
}
|
|
8
|
-
|
|
9
|
-
HasOneRelation,
|
|
10
|
-
};
|
|
10
|
+
exports.HasOneRelation = HasOneRelation;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HasOneThroughRelation = void 0;
|
|
4
|
+
const ManyToManyRelation_1 = require("../manyToMany/ManyToManyRelation");
|
|
5
|
+
class HasOneThroughRelation extends ManyToManyRelation_1.ManyToManyRelation {
|
|
4
6
|
isOneToOne() {
|
|
5
7
|
return true;
|
|
6
8
|
}
|
|
7
9
|
}
|
|
8
|
-
|
|
9
|
-
HasOneThroughRelation,
|
|
10
|
-
};
|
|
10
|
+
exports.HasOneThroughRelation = HasOneThroughRelation;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ManyToManyModifyMixin = void 0;
|
|
4
|
+
const whereScopes_1 = require("../../queryBuilder/whereScopes");
|
|
5
|
+
const ManyToManyFindOperation_1 = require("./find/ManyToManyFindOperation");
|
|
4
6
|
// This mixin contains the shared code for all modify operations (update, delete, relate, unrelate)
|
|
5
7
|
// for ManyToManyRelation operations.
|
|
6
8
|
//
|
|
@@ -11,6 +13,7 @@ const { ManyToManyFindOperation } = require('./find/ManyToManyFindOperation');
|
|
|
11
13
|
// table columns.
|
|
12
14
|
const ManyToManyModifyMixin = (Operation) => {
|
|
13
15
|
return class extends Operation {
|
|
16
|
+
// The arguments of the operation class this mixin is applied to.
|
|
14
17
|
constructor(...args) {
|
|
15
18
|
super(...args);
|
|
16
19
|
this.modifyFilterSubquery = null;
|
|
@@ -26,7 +29,7 @@ const ManyToManyModifyMixin = (Operation) => {
|
|
|
26
29
|
// We can now remove the where and join statements from the main query.
|
|
27
30
|
this.removeFiltersFromMainQuery(builder);
|
|
28
31
|
// Add a single where clause that uses the created subquery.
|
|
29
|
-
withWhereScope(builder, () => this.applyModifyFilterForRelatedTable(builder));
|
|
32
|
+
(0, whereScopes_1.withWhereScope)(builder, () => this.applyModifyFilterForRelatedTable(builder));
|
|
30
33
|
}
|
|
31
34
|
return super.onBuild(builder);
|
|
32
35
|
}
|
|
@@ -65,7 +68,7 @@ const ManyToManyModifyMixin = (Operation) => {
|
|
|
65
68
|
.whereInComposite(joinTableOwnerRefs, ownerValues);
|
|
66
69
|
}
|
|
67
70
|
toFindOperation() {
|
|
68
|
-
return new ManyToManyFindOperation('find', {
|
|
71
|
+
return new ManyToManyFindOperation_1.ManyToManyFindOperation('find', {
|
|
69
72
|
relation: this.relation,
|
|
70
73
|
owner: this.owner,
|
|
71
74
|
});
|
|
@@ -77,6 +80,4 @@ const ManyToManyModifyMixin = (Operation) => {
|
|
|
77
80
|
}
|
|
78
81
|
};
|
|
79
82
|
};
|
|
80
|
-
|
|
81
|
-
ManyToManyModifyMixin,
|
|
82
|
-
};
|
|
83
|
+
exports.ManyToManyModifyMixin = ManyToManyModifyMixin;
|
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ManyToManyRelation = void 0;
|
|
4
|
+
const whereScopes_1 = require("../../queryBuilder/whereScopes");
|
|
5
|
+
const getModel_1 = require("../../model/getModel");
|
|
6
|
+
const Relation_1 = require("../Relation");
|
|
7
|
+
const RelationProperty_1 = require("../RelationProperty");
|
|
8
|
+
const knexUtils_1 = require("../../utils/knexUtils");
|
|
9
|
+
const inheritModel_1 = require("../../model/inheritModel");
|
|
10
|
+
const resolveModel_1 = require("../../utils/resolveModel");
|
|
11
|
+
const promiseUtils_1 = require("../../utils/promiseUtils");
|
|
12
|
+
const objectUtils_1 = require("../../utils/objectUtils");
|
|
13
|
+
const createModifier_1 = require("../../utils/createModifier");
|
|
14
|
+
const ManyToManyFindOperation_1 = require("./find/ManyToManyFindOperation");
|
|
15
|
+
const ManyToManyInsertOperation_1 = require("./insert/ManyToManyInsertOperation");
|
|
16
|
+
const ManyToManyRelateOperation_1 = require("./relate/ManyToManyRelateOperation");
|
|
17
|
+
const ManyToManyUnrelateOperation_1 = require("./unrelate/ManyToManyUnrelateOperation");
|
|
18
|
+
const ManyToManyUnrelateSqliteOperation_1 = require("./unrelate/ManyToManyUnrelateSqliteOperation");
|
|
19
|
+
const ManyToManyUpdateOperation_1 = require("./update/ManyToManyUpdateOperation");
|
|
20
|
+
const ManyToManyUpdateSqliteOperation_1 = require("./update/ManyToManyUpdateSqliteOperation");
|
|
21
|
+
const ManyToManyDeleteOperation_1 = require("./delete/ManyToManyDeleteOperation");
|
|
22
|
+
const ManyToManyDeleteSqliteOperation_1 = require("./delete/ManyToManyDeleteSqliteOperation");
|
|
23
|
+
class ManyToManyRelation extends Relation_1.Relation {
|
|
22
24
|
setMapping(mapping) {
|
|
23
25
|
const retVal = super.setMapping(mapping);
|
|
24
26
|
let ctx = {
|
|
@@ -71,7 +73,7 @@ class ManyToManyRelation extends Relation {
|
|
|
71
73
|
join.on(relatedRef, joinTableRelatedRef);
|
|
72
74
|
});
|
|
73
75
|
});
|
|
74
|
-
withWhereScope(builder, () => {
|
|
76
|
+
(0, whereScopes_1.withWhereScope)(builder, () => {
|
|
75
77
|
owner.buildFindQuery(builder, this, joinTableOwnerRefs);
|
|
76
78
|
});
|
|
77
79
|
return this.applyModify(builder);
|
|
@@ -109,41 +111,41 @@ class ManyToManyRelation extends Relation {
|
|
|
109
111
|
});
|
|
110
112
|
}
|
|
111
113
|
find(_, owner) {
|
|
112
|
-
return new ManyToManyFindOperation('find', {
|
|
114
|
+
return new ManyToManyFindOperation_1.ManyToManyFindOperation('find', {
|
|
113
115
|
relation: this,
|
|
114
116
|
owner,
|
|
115
117
|
});
|
|
116
118
|
}
|
|
117
119
|
insert(_, owner) {
|
|
118
|
-
return new ManyToManyInsertOperation('insert', {
|
|
120
|
+
return new ManyToManyInsertOperation_1.ManyToManyInsertOperation('insert', {
|
|
119
121
|
relation: this,
|
|
120
122
|
owner,
|
|
121
123
|
});
|
|
122
124
|
}
|
|
123
125
|
update(builder, owner) {
|
|
124
|
-
if (isSqlite(builder.knex())) {
|
|
125
|
-
return new ManyToManyUpdateSqliteOperation('update', {
|
|
126
|
+
if ((0, knexUtils_1.isSqlite)(builder.knex())) {
|
|
127
|
+
return new ManyToManyUpdateSqliteOperation_1.ManyToManyUpdateSqliteOperation('update', {
|
|
126
128
|
relation: this,
|
|
127
129
|
owner,
|
|
128
130
|
});
|
|
129
131
|
}
|
|
130
132
|
else {
|
|
131
|
-
return new ManyToManyUpdateOperation('update', {
|
|
133
|
+
return new ManyToManyUpdateOperation_1.ManyToManyUpdateOperation('update', {
|
|
132
134
|
relation: this,
|
|
133
135
|
owner,
|
|
134
136
|
});
|
|
135
137
|
}
|
|
136
138
|
}
|
|
137
139
|
patch(builder, owner) {
|
|
138
|
-
if (isSqlite(builder.knex())) {
|
|
139
|
-
return new ManyToManyUpdateSqliteOperation('patch', {
|
|
140
|
+
if ((0, knexUtils_1.isSqlite)(builder.knex())) {
|
|
141
|
+
return new ManyToManyUpdateSqliteOperation_1.ManyToManyUpdateSqliteOperation('patch', {
|
|
140
142
|
modelOptions: { patch: true },
|
|
141
143
|
relation: this,
|
|
142
144
|
owner,
|
|
143
145
|
});
|
|
144
146
|
}
|
|
145
147
|
else {
|
|
146
|
-
return new ManyToManyUpdateOperation('patch', {
|
|
148
|
+
return new ManyToManyUpdateOperation_1.ManyToManyUpdateOperation('patch', {
|
|
147
149
|
modelOptions: { patch: true },
|
|
148
150
|
relation: this,
|
|
149
151
|
owner,
|
|
@@ -151,34 +153,34 @@ class ManyToManyRelation extends Relation {
|
|
|
151
153
|
}
|
|
152
154
|
}
|
|
153
155
|
delete(builder, owner) {
|
|
154
|
-
if (isSqlite(builder.knex())) {
|
|
155
|
-
return new ManyToManyDeleteSqliteOperation('delete', {
|
|
156
|
+
if ((0, knexUtils_1.isSqlite)(builder.knex())) {
|
|
157
|
+
return new ManyToManyDeleteSqliteOperation_1.ManyToManyDeleteSqliteOperation('delete', {
|
|
156
158
|
relation: this,
|
|
157
159
|
owner,
|
|
158
160
|
});
|
|
159
161
|
}
|
|
160
162
|
else {
|
|
161
|
-
return new ManyToManyDeleteOperation('delete', {
|
|
163
|
+
return new ManyToManyDeleteOperation_1.ManyToManyDeleteOperation('delete', {
|
|
162
164
|
relation: this,
|
|
163
165
|
owner,
|
|
164
166
|
});
|
|
165
167
|
}
|
|
166
168
|
}
|
|
167
169
|
relate(builder, owner) {
|
|
168
|
-
return new ManyToManyRelateOperation('relate', {
|
|
170
|
+
return new ManyToManyRelateOperation_1.ManyToManyRelateOperation('relate', {
|
|
169
171
|
relation: this,
|
|
170
172
|
owner,
|
|
171
173
|
});
|
|
172
174
|
}
|
|
173
175
|
unrelate(builder, owner) {
|
|
174
|
-
if (isSqlite(builder.knex())) {
|
|
175
|
-
return new ManyToManyUnrelateSqliteOperation('unrelate', {
|
|
176
|
+
if ((0, knexUtils_1.isSqlite)(builder.knex())) {
|
|
177
|
+
return new ManyToManyUnrelateSqliteOperation_1.ManyToManyUnrelateSqliteOperation('unrelate', {
|
|
176
178
|
relation: this,
|
|
177
179
|
owner,
|
|
178
180
|
});
|
|
179
181
|
}
|
|
180
182
|
else {
|
|
181
|
-
return new ManyToManyUnrelateOperation('unrelate', {
|
|
183
|
+
return new ManyToManyUnrelateOperation_1.ManyToManyUnrelateOperation('unrelate', {
|
|
182
184
|
relation: this,
|
|
183
185
|
owner,
|
|
184
186
|
});
|
|
@@ -187,6 +189,7 @@ class ManyToManyRelation extends Relation {
|
|
|
187
189
|
createJoinModels(ownerId, related) {
|
|
188
190
|
return related.map((related) => this.createJoinModel(ownerId, related));
|
|
189
191
|
}
|
|
192
|
+
// `rel` is a related model, or an id object (see ManyToManyRelateOperation).
|
|
190
193
|
createJoinModel(ownerId, rel) {
|
|
191
194
|
const joinModel = {};
|
|
192
195
|
for (let j = 0, lp = this.joinTableOwnerProp.size; j < lp; ++j) {
|
|
@@ -220,9 +223,10 @@ class ManyToManyRelation extends Relation {
|
|
|
220
223
|
}
|
|
221
224
|
}
|
|
222
225
|
executeJoinTableBeforeInsert(models, queryContext, result) {
|
|
223
|
-
return mapAfterAllReturn(models, (model) => this.joinTableBeforeInsert(model, queryContext), result);
|
|
226
|
+
return (0, promiseUtils_1.mapAfterAllReturn)(models, (model) => this.joinTableBeforeInsert(model, queryContext), result);
|
|
224
227
|
}
|
|
225
228
|
}
|
|
229
|
+
exports.ManyToManyRelation = ManyToManyRelation;
|
|
226
230
|
Object.defineProperties(ManyToManyRelation.prototype, {
|
|
227
231
|
isObjectionManyToManyRelation: {
|
|
228
232
|
enumerable: false,
|
|
@@ -264,7 +268,7 @@ function aliasedTableName(tableName, alias) {
|
|
|
264
268
|
}
|
|
265
269
|
function checkThroughObject(ctx) {
|
|
266
270
|
const mapping = ctx.mapping;
|
|
267
|
-
if (!isObject(mapping.join.through)) {
|
|
271
|
+
if (!(0, objectUtils_1.isObject)(mapping.join.through)) {
|
|
268
272
|
throw ctx.createError('join must have a `through` object that describes the join table.');
|
|
269
273
|
}
|
|
270
274
|
if (!mapping.join.through.from || !mapping.join.through.to) {
|
|
@@ -276,7 +280,9 @@ function resolveJoinModelClassIfDefined(ctx) {
|
|
|
276
280
|
let joinTableModelClass = null;
|
|
277
281
|
if (ctx.mapping.join.through.modelClass) {
|
|
278
282
|
try {
|
|
279
|
-
|
|
283
|
+
// undefined only for a relative path without `modelPaths`, which then
|
|
284
|
+
// fails further on, as it did in the JavaScript code.
|
|
285
|
+
joinTableModelClass = (0, resolveModel_1.resolveModel)(ctx.mapping.join.through.modelClass, ctx.ownerModelClass.modelPaths, 'join.through.modelClass');
|
|
280
286
|
}
|
|
281
287
|
catch (err) {
|
|
282
288
|
throw ctx.createError(err.message);
|
|
@@ -317,7 +323,7 @@ function createRelationProperty(ctx, refString, messagePrefix) {
|
|
|
317
323
|
let joinTableModelClass = ctx.joinTableModelClass;
|
|
318
324
|
const resolveModelClass = (table) => {
|
|
319
325
|
if (joinTableModelClass === null) {
|
|
320
|
-
joinTableModelClass = inheritModel(getModel());
|
|
326
|
+
joinTableModelClass = (0, inheritModel_1.inheritModel)((0, getModel_1.getModel)());
|
|
321
327
|
joinTableModelClass.tableName = table;
|
|
322
328
|
joinTableModelClass.idColumn = null;
|
|
323
329
|
joinTableModelClass.concurrency = ctx.ownerModelClass.concurrency;
|
|
@@ -330,10 +336,10 @@ function createRelationProperty(ctx, refString, messagePrefix) {
|
|
|
330
336
|
}
|
|
331
337
|
};
|
|
332
338
|
try {
|
|
333
|
-
prop = new RelationProperty(refString, resolveModelClass);
|
|
339
|
+
prop = new RelationProperty_1.RelationProperty(refString, resolveModelClass);
|
|
334
340
|
}
|
|
335
341
|
catch (err) {
|
|
336
|
-
if (err instanceof RelationProperty.ModelNotFoundError) {
|
|
342
|
+
if (err instanceof RelationProperty_1.RelationProperty.ModelNotFoundError) {
|
|
337
343
|
throw ctx.createError('join.through `from` and `to` must point to the same join table.');
|
|
338
344
|
}
|
|
339
345
|
else {
|
|
@@ -350,7 +356,7 @@ function parseExtras(ctx) {
|
|
|
350
356
|
if (!extraDef) {
|
|
351
357
|
return ctx;
|
|
352
358
|
}
|
|
353
|
-
if (isString(extraDef)) {
|
|
359
|
+
if ((0, objectUtils_1.isString)(extraDef)) {
|
|
354
360
|
extraDef = {
|
|
355
361
|
[extraDef]: extraDef,
|
|
356
362
|
};
|
|
@@ -376,7 +382,7 @@ function parseModify(ctx) {
|
|
|
376
382
|
const mapping = ctx.mapping.join.through;
|
|
377
383
|
const modifier = mapping.modify || mapping.filter;
|
|
378
384
|
const joinTableModify = modifier &&
|
|
379
|
-
createModifier({
|
|
385
|
+
(0, createModifier_1.createModifier)({
|
|
380
386
|
modifier,
|
|
381
387
|
modelClass: ctx.relatedModelClass,
|
|
382
388
|
});
|
|
@@ -384,7 +390,7 @@ function parseModify(ctx) {
|
|
|
384
390
|
}
|
|
385
391
|
function parseBeforeInsert(ctx) {
|
|
386
392
|
let joinTableBeforeInsert;
|
|
387
|
-
if (isFunction(ctx.mapping.join.through.beforeInsert)) {
|
|
393
|
+
if ((0, objectUtils_1.isFunction)(ctx.mapping.join.through.beforeInsert)) {
|
|
388
394
|
joinTableBeforeInsert = ctx.mapping.join.through.beforeInsert;
|
|
389
395
|
}
|
|
390
396
|
else {
|
|
@@ -400,6 +406,3 @@ function finalizeJoinModelClass(ctx) {
|
|
|
400
406
|
}
|
|
401
407
|
return ctx;
|
|
402
408
|
}
|
|
403
|
-
module.exports = {
|
|
404
|
-
ManyToManyRelation,
|
|
405
|
-
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ManyToManySqliteModifyMixin = void 0;
|
|
4
|
+
const ManyToManyModifyMixin_1 = require("./ManyToManyModifyMixin");
|
|
3
5
|
const SQLITE_BUILTIN_ROW_ID = '_rowid_';
|
|
4
6
|
// We need to override this mixin for sqlite because sqlite doesn't support
|
|
5
7
|
// multi-column where in statements with subqueries. We need to use the
|
|
6
8
|
// internal _rowid_ column instead.
|
|
7
9
|
const ManyToManySqliteModifyMixin = (Operation) => {
|
|
8
|
-
return class extends ManyToManyModifyMixin(Operation) {
|
|
10
|
+
return class extends (0, ManyToManyModifyMixin_1.ManyToManyModifyMixin)(Operation) {
|
|
9
11
|
applyModifyFilterForRelatedTable(builder) {
|
|
10
12
|
const tableRef = builder.tableRefFor(this.relation.relatedModelClass);
|
|
11
13
|
const rowIdRef = `${tableRef}.${SQLITE_BUILTIN_ROW_ID}`;
|
|
@@ -24,6 +26,4 @@ const ManyToManySqliteModifyMixin = (Operation) => {
|
|
|
24
26
|
}
|
|
25
27
|
};
|
|
26
28
|
};
|
|
27
|
-
|
|
28
|
-
ManyToManySqliteModifyMixin,
|
|
29
|
-
};
|
|
29
|
+
exports.ManyToManySqliteModifyMixin = ManyToManySqliteModifyMixin;
|