@abedmurrar/objection 4.0.0-beta.0 → 4.0.0-beta.1
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/lib/relations/Relation.js +31 -29
- package/lib/relations/RelationDeleteOperation.js +10 -8
- package/lib/relations/RelationFindOperation.js +9 -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 +9 -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 +7 -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/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ManyToManyUnrelateOperation = void 0;
|
|
4
|
+
const ManyToManyUnrelateOperationBase_1 = require("./ManyToManyUnrelateOperationBase");
|
|
5
|
+
const ManyToManyModifyMixin_1 = require("../ManyToManyModifyMixin");
|
|
6
|
+
class ManyToManyUnrelateOperation extends (0, ManyToManyModifyMixin_1.ManyToManyModifyMixin)(ManyToManyUnrelateOperationBase_1.ManyToManyUnrelateOperationBase) {
|
|
5
7
|
get modifyMainQuery() {
|
|
6
8
|
return false;
|
|
7
9
|
}
|
|
8
10
|
}
|
|
9
|
-
|
|
10
|
-
ManyToManyUnrelateOperation,
|
|
11
|
-
};
|
|
11
|
+
exports.ManyToManyUnrelateOperation = ManyToManyUnrelateOperation;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ManyToManyUnrelateOperationBase = void 0;
|
|
4
|
+
const whereScopes_1 = require("../../../queryBuilder/whereScopes");
|
|
5
|
+
const UnrelateOperation_1 = require("../../../queryBuilder/operations/UnrelateOperation");
|
|
6
|
+
class ManyToManyUnrelateOperationBase extends UnrelateOperation_1.UnrelateOperation {
|
|
5
7
|
queryExecutor(builder) {
|
|
6
8
|
const unrelateQuery = this.relation
|
|
7
9
|
.getJoinModelClass(builder.knex())
|
|
8
10
|
.query()
|
|
9
11
|
.childQueryOf(builder)
|
|
10
12
|
.delete();
|
|
11
|
-
withWhereScope(unrelateQuery, () => {
|
|
13
|
+
(0, whereScopes_1.withWhereScope)(unrelateQuery, () => {
|
|
12
14
|
this.applyModifyFilterForJoinTable(unrelateQuery);
|
|
13
15
|
});
|
|
14
16
|
return unrelateQuery.modify(this.relation.joinTableModify);
|
|
@@ -22,6 +24,4 @@ class ManyToManyUnrelateOperationBase extends UnrelateOperation {
|
|
|
22
24
|
throw new Error('not implemented');
|
|
23
25
|
}
|
|
24
26
|
}
|
|
25
|
-
|
|
26
|
-
ManyToManyUnrelateOperationBase,
|
|
27
|
-
};
|
|
27
|
+
exports.ManyToManyUnrelateOperationBase = ManyToManyUnrelateOperationBase;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ManyToManyUnrelateSqliteOperation = void 0;
|
|
4
|
+
const ManyToManyUnrelateOperationBase_1 = require("./ManyToManyUnrelateOperationBase");
|
|
5
|
+
const ManyToManySqliteModifyMixin_1 = require("../ManyToManySqliteModifyMixin");
|
|
6
|
+
class ManyToManyUnrelateSqliteOperation extends (0, ManyToManySqliteModifyMixin_1.ManyToManySqliteModifyMixin)(ManyToManyUnrelateOperationBase_1.ManyToManyUnrelateOperationBase) {
|
|
5
7
|
get modifyMainQuery() {
|
|
6
8
|
return false;
|
|
7
9
|
}
|
|
8
10
|
}
|
|
9
|
-
|
|
10
|
-
ManyToManyUnrelateSqliteOperation,
|
|
11
|
-
};
|
|
11
|
+
exports.ManyToManyUnrelateSqliteOperation = ManyToManyUnrelateSqliteOperation;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ManyToManyUpdateOperation = void 0;
|
|
4
|
+
const ManyToManyUpdateOperationBase_1 = require("./ManyToManyUpdateOperationBase");
|
|
5
|
+
const ManyToManyModifyMixin_1 = require("../ManyToManyModifyMixin");
|
|
6
|
+
class ManyToManyUpdateOperation extends (0, ManyToManyModifyMixin_1.ManyToManyModifyMixin)(ManyToManyUpdateOperationBase_1.ManyToManyUpdateOperationBase) {
|
|
5
7
|
}
|
|
6
|
-
|
|
7
|
-
ManyToManyUpdateOperation,
|
|
8
|
-
};
|
|
8
|
+
exports.ManyToManyUpdateOperation = ManyToManyUpdateOperation;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ManyToManyUpdateOperationBase = void 0;
|
|
4
|
+
const whereScopes_1 = require("../../../queryBuilder/whereScopes");
|
|
5
|
+
const UpdateOperation_1 = require("../../../queryBuilder/operations/UpdateOperation");
|
|
6
|
+
class ManyToManyUpdateOperationBase extends UpdateOperation_1.UpdateOperation {
|
|
5
7
|
constructor(name, opt) {
|
|
6
8
|
super(name, opt);
|
|
7
9
|
this.relation = opt.relation;
|
|
@@ -34,7 +36,7 @@ class ManyToManyUpdateOperationBase extends UpdateOperation {
|
|
|
34
36
|
.query()
|
|
35
37
|
.childQueryOf(builder)
|
|
36
38
|
.patch(this.joinTablePatch);
|
|
37
|
-
withWhereScope(joinTableUpdateQuery, () => {
|
|
39
|
+
(0, whereScopes_1.withWhereScope)(joinTableUpdateQuery, () => {
|
|
38
40
|
this.applyModifyFilterForJoinTable(joinTableUpdateQuery);
|
|
39
41
|
});
|
|
40
42
|
await joinTableUpdateQuery.modify(this.relation.joinTableModify);
|
|
@@ -60,6 +62,4 @@ class ManyToManyUpdateOperationBase extends UpdateOperation {
|
|
|
60
62
|
return clone;
|
|
61
63
|
}
|
|
62
64
|
}
|
|
63
|
-
|
|
64
|
-
ManyToManyUpdateOperationBase,
|
|
65
|
-
};
|
|
65
|
+
exports.ManyToManyUpdateOperationBase = ManyToManyUpdateOperationBase;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ManyToManyUpdateSqliteOperation = void 0;
|
|
4
|
+
const ManyToManyUpdateOperationBase_1 = require("./ManyToManyUpdateOperationBase");
|
|
5
|
+
const ManyToManySqliteModifyMixin_1 = require("../ManyToManySqliteModifyMixin");
|
|
6
|
+
class ManyToManyUpdateSqliteOperation extends (0, ManyToManySqliteModifyMixin_1.ManyToManySqliteModifyMixin)(ManyToManyUpdateOperationBase_1.ManyToManyUpdateOperationBase) {
|
|
5
7
|
}
|
|
6
|
-
|
|
7
|
-
ManyToManyUpdateSqliteOperation,
|
|
8
|
-
};
|
|
8
|
+
exports.ManyToManyUpdateSqliteOperation = ManyToManyUpdateSqliteOperation;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abedmurrar/objection",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.1",
|
|
4
4
|
"description": "An SQL-friendly ORM for Node.js. A fork of objection.js with strict TypeScript types and MySQL support.",
|
|
5
5
|
"main": "lib/objection.js",
|
|
6
6
|
"type": "commonjs",
|