drizzle-orm 0.10.26 → 0.10.27
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 +439 -0
- package/dist/builders/aggregators/abstractAggregator.d.ts +11 -0
- package/dist/builders/aggregators/abstractAggregator.js +35 -0
- package/dist/builders/aggregators/deleteAggregator.d.ts +16 -0
- package/dist/builders/aggregators/deleteAggregator.js +42 -0
- package/dist/builders/aggregators/insertAggregator.d.ts +22 -0
- package/dist/builders/aggregators/insertAggregator.js +106 -0
- package/dist/builders/aggregators/selectAggregator.d.ts +39 -0
- package/dist/builders/aggregators/selectAggregator.js +143 -0
- package/dist/builders/aggregators/updateAggregator.d.ts +19 -0
- package/dist/builders/aggregators/updateAggregator.js +50 -0
- package/dist/builders/highLvlBuilders/abstractRequestBuilder.d.ts +27 -0
- package/dist/builders/highLvlBuilders/abstractRequestBuilder.js +32 -0
- package/dist/builders/highLvlBuilders/deleteRequestBuilder.d.ts +19 -0
- package/dist/builders/highLvlBuilders/deleteRequestBuilder.js +61 -0
- package/dist/builders/highLvlBuilders/insertRequestBuilder.d.ts +20 -0
- package/dist/builders/highLvlBuilders/insertRequestBuilder.js +73 -0
- package/dist/builders/highLvlBuilders/order.d.ts +5 -0
- package/dist/builders/highLvlBuilders/order.js +8 -0
- package/dist/builders/highLvlBuilders/selectRequestBuilder.d.ts +47 -0
- package/dist/builders/highLvlBuilders/selectRequestBuilder.js +128 -0
- package/dist/builders/highLvlBuilders/updateRequestBuilder.d.ts +22 -0
- package/dist/builders/highLvlBuilders/updateRequestBuilder.js +80 -0
- package/dist/builders/index.d.ts +18 -0
- package/dist/builders/index.js +54 -0
- package/dist/builders/joinBuilders/builders/abstractJoinBuilder.d.ts +40 -0
- package/dist/builders/joinBuilders/builders/abstractJoinBuilder.js +78 -0
- package/dist/builders/joinBuilders/builders/selectWithFiveJoins.d.ts +35 -0
- package/dist/builders/joinBuilders/builders/selectWithFiveJoins.js +45 -0
- package/dist/builders/joinBuilders/builders/selectWithFourJoins.d.ts +55 -0
- package/dist/builders/joinBuilders/builders/selectWithFourJoins.js +78 -0
- package/dist/builders/joinBuilders/builders/selectWithJoin.d.ts +49 -0
- package/dist/builders/joinBuilders/builders/selectWithJoin.js +64 -0
- package/dist/builders/joinBuilders/builders/selectWithThreeJoins.d.ts +53 -0
- package/dist/builders/joinBuilders/builders/selectWithThreeJoins.js +73 -0
- package/dist/builders/joinBuilders/builders/selectWithTwoJoins.d.ts +51 -0
- package/dist/builders/joinBuilders/builders/selectWithTwoJoins.js +68 -0
- package/dist/builders/joinBuilders/join.d.ts +23 -0
- package/dist/builders/joinBuilders/join.js +28 -0
- package/dist/builders/joinBuilders/joinWith.d.ts +14 -0
- package/dist/builders/joinBuilders/joinWith.js +14 -0
- package/dist/builders/joinBuilders/responses/selectResponseFiveJoins.d.ts +20 -0
- package/dist/builders/joinBuilders/responses/selectResponseFiveJoins.js +35 -0
- package/dist/builders/joinBuilders/responses/selectResponseFourJoins.d.ts +19 -0
- package/dist/builders/joinBuilders/responses/selectResponseFourJoins.js +34 -0
- package/dist/builders/joinBuilders/responses/selectResponseThreeJoins.d.ts +18 -0
- package/dist/builders/joinBuilders/responses/selectResponseThreeJoins.js +33 -0
- package/dist/builders/joinBuilders/responses/selectResponseTwoJoins.d.ts +17 -0
- package/dist/builders/joinBuilders/responses/selectResponseTwoJoins.js +32 -0
- package/dist/builders/joinBuilders/responses/selectResponseWithJoin.d.ts +16 -0
- package/dist/builders/joinBuilders/responses/selectResponseWithJoin.js +31 -0
- package/dist/builders/joinBuilders/static.d.ts +5 -0
- package/dist/builders/joinBuilders/static.js +9 -0
- package/dist/builders/lowLvlBuilders/alter.d.ts +0 -0
- package/dist/builders/lowLvlBuilders/alter.js +1 -0
- package/dist/builders/lowLvlBuilders/create.d.ts +12 -0
- package/dist/builders/lowLvlBuilders/create.js +100 -0
- package/dist/builders/lowLvlBuilders/delets/delete.d.ts +5 -0
- package/dist/builders/lowLvlBuilders/delets/delete.js +15 -0
- package/dist/builders/lowLvlBuilders/delets/deleteFilter.d.ts +11 -0
- package/dist/builders/lowLvlBuilders/delets/deleteFilter.js +13 -0
- package/dist/builders/lowLvlBuilders/delets/deleteFrom.d.ts +12 -0
- package/dist/builders/lowLvlBuilders/delets/deleteFrom.js +14 -0
- package/dist/builders/lowLvlBuilders/inserts/insert.d.ts +5 -0
- package/dist/builders/lowLvlBuilders/inserts/insert.js +15 -0
- package/dist/builders/lowLvlBuilders/inserts/insertInto.d.ts +13 -0
- package/dist/builders/lowLvlBuilders/inserts/insertInto.js +16 -0
- package/dist/builders/lowLvlBuilders/inserts/onConflictInsert.d.ts +12 -0
- package/dist/builders/lowLvlBuilders/inserts/onConflictInsert.js +13 -0
- package/dist/builders/lowLvlBuilders/inserts/valuesInsert.d.ts +16 -0
- package/dist/builders/lowLvlBuilders/inserts/valuesInsert.js +19 -0
- package/dist/builders/lowLvlBuilders/selects/select.d.ts +9 -0
- package/dist/builders/lowLvlBuilders/selects/select.js +16 -0
- package/dist/builders/lowLvlBuilders/selects/selectFrom.d.ts +28 -0
- package/dist/builders/lowLvlBuilders/selects/selectFrom.js +34 -0
- package/dist/builders/lowLvlBuilders/selects/selectJoined.d.ts +26 -0
- package/dist/builders/lowLvlBuilders/selects/selectJoined.js +30 -0
- package/dist/builders/lowLvlBuilders/selects/whereSelect.d.ts +17 -0
- package/dist/builders/lowLvlBuilders/selects/whereSelect.js +25 -0
- package/dist/builders/lowLvlBuilders/updates/update.d.ts +5 -0
- package/dist/builders/lowLvlBuilders/updates/update.js +15 -0
- package/dist/builders/lowLvlBuilders/updates/updateIn.d.ts +13 -0
- package/dist/builders/lowLvlBuilders/updates/updateIn.js +15 -0
- package/dist/builders/lowLvlBuilders/updates/whereSelect.d.ts +11 -0
- package/dist/builders/lowLvlBuilders/updates/whereSelect.js +13 -0
- package/dist/builders/lowLvlBuilders/updates/whereSet.d.ts +14 -0
- package/dist/builders/lowLvlBuilders/updates/whereSet.js +18 -0
- package/dist/builders/requestBuilders/updates/combine.d.ts +9 -0
- package/dist/builders/requestBuilders/updates/combine.js +26 -0
- package/dist/builders/requestBuilders/updates/increment.d.ts +13 -0
- package/dist/builders/requestBuilders/updates/increment.js +18 -0
- package/dist/builders/requestBuilders/updates/setObjects.d.ts +12 -0
- package/dist/builders/requestBuilders/updates/setObjects.js +19 -0
- package/dist/builders/requestBuilders/updates/static.d.ts +7 -0
- package/dist/builders/requestBuilders/updates/static.js +15 -0
- package/dist/builders/requestBuilders/updates/updates.d.ts +9 -0
- package/dist/builders/requestBuilders/updates/updates.js +10 -0
- package/dist/builders/requestBuilders/where/and.d.ts +11 -0
- package/dist/builders/requestBuilders/where/and.js +31 -0
- package/dist/builders/requestBuilders/where/const.d.ts +9 -0
- package/dist/builders/requestBuilders/where/const.js +25 -0
- package/dist/builders/requestBuilders/where/constArray.d.ts +9 -0
- package/dist/builders/requestBuilders/where/constArray.js +39 -0
- package/dist/builders/requestBuilders/where/eqWhere.d.ts +12 -0
- package/dist/builders/requestBuilders/where/eqWhere.js +20 -0
- package/dist/builders/requestBuilders/where/greater.d.ts +15 -0
- package/dist/builders/requestBuilders/where/greater.js +20 -0
- package/dist/builders/requestBuilders/where/greaterEq.d.ts +15 -0
- package/dist/builders/requestBuilders/where/greaterEq.js +20 -0
- package/dist/builders/requestBuilders/where/in.d.ts +12 -0
- package/dist/builders/requestBuilders/where/in.js +20 -0
- package/dist/builders/requestBuilders/where/isNotNull.d.ts +11 -0
- package/dist/builders/requestBuilders/where/isNotNull.js +18 -0
- package/dist/builders/requestBuilders/where/isNull.d.ts +11 -0
- package/dist/builders/requestBuilders/where/isNull.js +18 -0
- package/dist/builders/requestBuilders/where/less.d.ts +15 -0
- package/dist/builders/requestBuilders/where/less.js +20 -0
- package/dist/builders/requestBuilders/where/lessEq.d.ts +15 -0
- package/dist/builders/requestBuilders/where/lessEq.js +20 -0
- package/dist/builders/requestBuilders/where/like.d.ts +12 -0
- package/dist/builders/requestBuilders/where/like.js +20 -0
- package/dist/builders/requestBuilders/where/notEqWhere.d.ts +12 -0
- package/dist/builders/requestBuilders/where/notEqWhere.js +20 -0
- package/dist/builders/requestBuilders/where/or.d.ts +11 -0
- package/dist/builders/requestBuilders/where/or.js +31 -0
- package/dist/builders/requestBuilders/where/rawWhere.d.ts +9 -0
- package/dist/builders/requestBuilders/where/rawWhere.js +15 -0
- package/dist/builders/requestBuilders/where/static.d.ts +17 -0
- package/dist/builders/requestBuilders/where/static.js +49 -0
- package/dist/builders/requestBuilders/where/var.d.ts +13 -0
- package/dist/builders/requestBuilders/where/var.js +18 -0
- package/dist/builders/requestBuilders/where/where.d.ts +8 -0
- package/dist/builders/requestBuilders/where/where.js +6 -0
- package/dist/builders/transaction/transaction.d.ts +8 -0
- package/dist/builders/transaction/transaction.js +20 -0
- package/dist/columns/column.d.ts +72 -0
- package/dist/columns/column.js +101 -0
- package/dist/columns/index.d.ts +10 -0
- package/dist/columns/index.js +27 -0
- package/dist/columns/types/columnType.d.ts +7 -0
- package/dist/columns/types/columnType.js +6 -0
- package/dist/columns/types/pgBigDecimal.d.ts +10 -0
- package/dist/columns/types/pgBigDecimal.js +31 -0
- package/dist/columns/types/pgBigInt.d.ts +15 -0
- package/dist/columns/types/pgBigInt.js +32 -0
- package/dist/columns/types/pgBigSerial.d.ts +15 -0
- package/dist/columns/types/pgBigSerial.js +32 -0
- package/dist/columns/types/pgBoolean.d.ts +8 -0
- package/dist/columns/types/pgBoolean.js +18 -0
- package/dist/columns/types/pgEnum.d.ts +9 -0
- package/dist/columns/types/pgEnum.js +18 -0
- package/dist/columns/types/pgInteger.d.ts +8 -0
- package/dist/columns/types/pgInteger.js +21 -0
- package/dist/columns/types/pgJsonb.d.ts +9 -0
- package/dist/columns/types/pgJsonb.js +20 -0
- package/dist/columns/types/pgSerial.d.ts +8 -0
- package/dist/columns/types/pgSerial.js +18 -0
- package/dist/columns/types/pgSmallInt.d.ts +8 -0
- package/dist/columns/types/pgSmallInt.js +18 -0
- package/dist/columns/types/pgText.d.ts +8 -0
- package/dist/columns/types/pgText.js +18 -0
- package/dist/columns/types/pgTime.d.ts +8 -0
- package/dist/columns/types/pgTime.js +18 -0
- package/dist/columns/types/pgTimestamp.d.ts +8 -0
- package/dist/columns/types/pgTimestamp.js +18 -0
- package/dist/columns/types/pgTimestamptz.d.ts +8 -0
- package/dist/columns/types/pgTimestamptz.js +18 -0
- package/dist/columns/types/pgVarChar.d.ts +9 -0
- package/dist/columns/types/pgVarChar.js +24 -0
- package/dist/db/db.d.ts +18 -0
- package/dist/db/db.js +25 -0
- package/dist/db/dbConnector.d.ts +9 -0
- package/dist/db/dbConnector.js +32 -0
- package/dist/db/dbStringConnector.d.ts +6 -0
- package/dist/db/dbStringConnector.js +29 -0
- package/dist/db/group_by.d.ts +0 -0
- package/dist/db/group_by.js +68 -0
- package/dist/db/index.d.ts +4 -0
- package/dist/db/index.js +14 -0
- package/dist/db/session.d.ts +9 -0
- package/dist/db/session.js +16 -0
- package/dist/docs/cases/simple_delete.d.ts +1 -0
- package/dist/docs/cases/simple_delete.js +35 -0
- package/dist/docs/cases/simple_insert.d.ts +1 -0
- package/dist/docs/cases/simple_insert.js +57 -0
- package/dist/docs/cases/simple_join.d.ts +1 -0
- package/dist/docs/cases/simple_join.js +115 -0
- package/dist/docs/cases/simple_select.d.ts +1 -0
- package/dist/docs/cases/simple_select.js +50 -0
- package/dist/docs/cases/simple_update.d.ts +1 -0
- package/dist/docs/cases/simple_update.js +39 -0
- package/dist/docs/tables/citiesTable.d.ts +14 -0
- package/dist/docs/tables/citiesTable.js +21 -0
- package/dist/docs/tables/userGroupsTable.d.ts +7 -0
- package/dist/docs/tables/userGroupsTable.js +18 -0
- package/dist/docs/tables/usersTable.d.ts +17 -0
- package/dist/docs/tables/usersTable.js +35 -0
- package/dist/docs/tables/usersToUserGroups.d.ts +7 -0
- package/dist/docs/tables/usersToUserGroups.js +20 -0
- package/dist/docs/types/rolesType.d.ts +1 -0
- package/dist/docs/types/rolesType.js +6 -0
- package/dist/errors/baseError.d.ts +22 -0
- package/dist/errors/baseError.js +35 -0
- package/dist/errors/builderError.d.ts +14 -0
- package/dist/errors/builderError.js +25 -0
- package/dist/errors/dbErrors.d.ts +12 -0
- package/dist/errors/dbErrors.js +28 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +31 -0
- package/dist/indexes/tableIndex.d.ts +11 -0
- package/dist/indexes/tableIndex.js +17 -0
- package/dist/logger/abstractLogger.d.ts +4 -0
- package/dist/logger/abstractLogger.js +5 -0
- package/dist/logger/consoleLogger.d.ts +5 -0
- package/dist/logger/consoleLogger.js +15 -0
- package/dist/mappers/index.d.ts +0 -0
- package/dist/mappers/index.js +1 -0
- package/dist/mappers/responseMapper.d.ts +10 -0
- package/dist/mappers/responseMapper.js +35 -0
- package/dist/migrator/index.d.ts +0 -0
- package/dist/migrator/index.js +1 -0
- package/dist/migrator/migrator.d.ts +11 -0
- package/dist/migrator/migrator.js +105 -0
- package/dist/serializer/serializer.d.ts +47 -0
- package/dist/serializer/serializer.js +258 -0
- package/dist/tables/abstractTable.d.ts +68 -0
- package/dist/tables/abstractTable.js +151 -0
- package/dist/tables/index.d.ts +3 -0
- package/dist/tables/index.js +11 -0
- package/dist/tables/inferTypes.d.ts +39 -0
- package/dist/tables/inferTypes.js +2 -0
- package/dist/tables/migrationsTable.d.ts +7 -0
- package/dist/tables/migrationsTable.js +18 -0
- package/dist/test.d.ts +1 -0
- package/dist/test.js +65 -0
- package/dist/types/type.d.ts +10 -0
- package/dist/types/type.js +14 -0
- package/dist/utils/ecranate.d.ts +2 -0
- package/dist/utils/ecranate.js +8 -0
- package/package.json +3 -2
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const join_1 = require("../join");
|
|
7
|
+
const joinWith_1 = __importDefault(require("../joinWith"));
|
|
8
|
+
const selectResponseFourJoins_1 = __importDefault(require("../responses/selectResponseFourJoins"));
|
|
9
|
+
const abstractJoinBuilder_1 = __importDefault(require("./abstractJoinBuilder"));
|
|
10
|
+
const selectWithFiveJoins_1 = __importDefault(require("./selectWithFiveJoins"));
|
|
11
|
+
class SelectTRBWithFourJoins extends abstractJoinBuilder_1.default {
|
|
12
|
+
constructor(table, session, filter, join1, join2, join3, join4, props, orderBy, order, distinct, tablePartial, joinedPartial, joinedPartial1, joinedPartial2, joinedPartial3) {
|
|
13
|
+
super(table, filter, session, props, orderBy, order, distinct, tablePartial);
|
|
14
|
+
this._join1 = join1;
|
|
15
|
+
this._join2 = join2;
|
|
16
|
+
this._join3 = join3;
|
|
17
|
+
this._join4 = join4;
|
|
18
|
+
this._joinedPartial = joinedPartial;
|
|
19
|
+
this._joinedPartial1 = joinedPartial1;
|
|
20
|
+
this._joinedPartial2 = joinedPartial2;
|
|
21
|
+
this._joinedPartial3 = joinedPartial3;
|
|
22
|
+
}
|
|
23
|
+
innerJoin(fromTable, table, from, to, partial) {
|
|
24
|
+
const toTable = this._table.db.create(table);
|
|
25
|
+
const tableFrom = this._table.db.create(fromTable);
|
|
26
|
+
const fromColumn = from(tableFrom);
|
|
27
|
+
const toColumn = to(toTable);
|
|
28
|
+
const join = new joinWith_1.default(toTable.tableName(), toTable.mapServiceToDb())
|
|
29
|
+
.columns(fromColumn, toColumn).joinStrategy(join_1.JoinStrategy.INNER_JOIN);
|
|
30
|
+
return new selectWithFiveJoins_1.default(this._table, this._session, this._filter, this._join1, this._join2, this._join3, this._join4, join, this._props, this._orderBy, this._order, this._distinct, this._partial, this._joinedPartial, this._joinedPartial1, this._joinedPartial2, this._joinedPartial3, partial);
|
|
31
|
+
}
|
|
32
|
+
leftJoin(fromTable, table, from, to, partial) {
|
|
33
|
+
const toTable = this._table.db.create(table);
|
|
34
|
+
const tableFrom = this._table.db.create(fromTable);
|
|
35
|
+
const fromColumn = from(tableFrom);
|
|
36
|
+
const toColumn = to(toTable);
|
|
37
|
+
const join = new joinWith_1.default(toTable.tableName(), toTable.mapServiceToDb())
|
|
38
|
+
.columns(fromColumn, toColumn).joinStrategy(join_1.JoinStrategy.LEFT_JOIN);
|
|
39
|
+
return new selectWithFiveJoins_1.default(this._table, this._session, this._filter, this._join1, this._join2, this._join3, this._join4, join, this._props, this._orderBy, this._order, this._distinct, this._partial, this._joinedPartial, this._joinedPartial1, this._joinedPartial2, this._joinedPartial3, partial);
|
|
40
|
+
}
|
|
41
|
+
rightJoin(fromTable, table, from, to, partial) {
|
|
42
|
+
const toTable = this._table.db.create(table);
|
|
43
|
+
const tableFrom = this._table.db.create(fromTable);
|
|
44
|
+
const fromColumn = from(tableFrom);
|
|
45
|
+
const toColumn = to(toTable);
|
|
46
|
+
const join = new joinWith_1.default(toTable.tableName(), toTable.mapServiceToDb())
|
|
47
|
+
.columns(fromColumn, toColumn).joinStrategy(join_1.JoinStrategy.RIGHT_JOIN);
|
|
48
|
+
return new selectWithFiveJoins_1.default(this._table, this._session, this._filter, this._join1, this._join2, this._join3, this._join4, join, this._props, this._orderBy, this._order, this._distinct, this._partial, this._joinedPartial, this._joinedPartial1, this._joinedPartial2, this._joinedPartial3, partial);
|
|
49
|
+
}
|
|
50
|
+
fullJoin(fromTable, table, from, to, partial) {
|
|
51
|
+
const toTable = this._table.db.create(table);
|
|
52
|
+
const tableFrom = this._table.db.create(fromTable);
|
|
53
|
+
const fromColumn = from(tableFrom);
|
|
54
|
+
const toColumn = to(toTable);
|
|
55
|
+
const join = new joinWith_1.default(toTable.tableName(), toTable.mapServiceToDb())
|
|
56
|
+
.columns(fromColumn, toColumn).joinStrategy(join_1.JoinStrategy.FULL_JOIN);
|
|
57
|
+
return new selectWithFiveJoins_1.default(this._table, this._session, this._filter, this._join1, this._join2, this._join3, this._join4, join, this._props, this._orderBy, this._order, this._distinct, this._partial, this._joinedPartial, this._joinedPartial1, this._joinedPartial2, this._joinedPartial3, partial);
|
|
58
|
+
}
|
|
59
|
+
joins() {
|
|
60
|
+
return [{ join: this._join1, partial: this._joinedPartial, id: 1 },
|
|
61
|
+
{ join: this._join2, partial: this._joinedPartial1, id: 2 },
|
|
62
|
+
{ join: this._join3, partial: this._joinedPartial2, id: 3 },
|
|
63
|
+
{ join: this._join4, partial: this._joinedPartial3, id: 4 }];
|
|
64
|
+
}
|
|
65
|
+
mapResponse(result) {
|
|
66
|
+
const parent = this._join1.mappedServiceToDb;
|
|
67
|
+
const parentTwo = this._join2.mappedServiceToDb;
|
|
68
|
+
const parentThree = this._join3.mappedServiceToDb;
|
|
69
|
+
const parentFour = this._join4.mappedServiceToDb;
|
|
70
|
+
const response = this.fullOrPartial(this._table.mapServiceToDb(), result, this._partial);
|
|
71
|
+
const objects = this.fullOrPartial(parent, result, this._joinedPartial, 1);
|
|
72
|
+
const objectsTwo = this.fullOrPartial(parentTwo, result, this._joinedPartial1, 2);
|
|
73
|
+
const objectsThree = this.fullOrPartial(parentThree, result, this._joinedPartial2, 3);
|
|
74
|
+
const objectsFour = this.fullOrPartial(parentFour, result, this._joinedPartial3, 4);
|
|
75
|
+
return new selectResponseFourJoins_1.default(response, objects, objectsTwo, objectsThree, objectsFour);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
exports.default = SelectTRBWithFourJoins;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { QueryResult } from 'pg';
|
|
2
|
+
import { AbstractColumn } from '../../../columns/column';
|
|
3
|
+
import ColumnType from '../../../columns/types/columnType';
|
|
4
|
+
import DB from '../../../db/db';
|
|
5
|
+
import { ISession } from '../../../db/session';
|
|
6
|
+
import AbstractTable from '../../../tables/abstractTable';
|
|
7
|
+
import { CheckTwoTypes, PartialFor } from '../../../tables/inferTypes';
|
|
8
|
+
import Order from '../../highLvlBuilders/order';
|
|
9
|
+
import Expr from '../../requestBuilders/where/where';
|
|
10
|
+
import Join from '../join';
|
|
11
|
+
import SelectResponseJoin from '../responses/selectResponseWithJoin';
|
|
12
|
+
import AbstractJoined from './abstractJoinBuilder';
|
|
13
|
+
import SelectTRBWithTwoJoins from './selectWithTwoJoins';
|
|
14
|
+
export default class SelectTRBWithJoin<TTable extends AbstractTable<TTable>, TTable1 extends AbstractTable<TTable1>, TPartial extends PartialFor<TTable> = {}, TPartial1 extends PartialFor<TTable1> = {}> extends AbstractJoined<TTable, SelectResponseJoin<TTable, TTable1, TPartial, TPartial1>, TPartial> {
|
|
15
|
+
private _join;
|
|
16
|
+
private _joinedPartial?;
|
|
17
|
+
constructor(table: TTable, session: ISession, filter: Expr, join: Join<TTable1>, props: {
|
|
18
|
+
limit?: number;
|
|
19
|
+
offset?: number;
|
|
20
|
+
}, orderBy?: AbstractColumn<ColumnType, boolean, boolean>, order?: Order, distinct?: AbstractColumn<ColumnType, boolean, boolean>, tablePartial?: TPartial, joinedPartial?: TPartial1);
|
|
21
|
+
innerJoin<InputTable extends AbstractTable<InputTable>, TColumn extends ColumnType, TToColumn extends ColumnType, IToTable extends AbstractTable<IToTable>, IToPartial extends PartialFor<IToTable> = {}>(fromTable: {
|
|
22
|
+
new (db: DB): InputTable;
|
|
23
|
+
}, table: {
|
|
24
|
+
new (db: DB): IToTable;
|
|
25
|
+
}, from: (table: CheckTwoTypes<InputTable, TTable, TTable1>) => AbstractColumn<TColumn, boolean, boolean, CheckTwoTypes<InputTable, TTable, TTable1>>, to: (table: IToTable) => AbstractColumn<TToColumn, boolean, boolean, IToTable>, partial?: IToPartial): SelectTRBWithTwoJoins<TTable, TTable1, IToTable, TPartial, TPartial1, IToPartial>;
|
|
26
|
+
leftJoin<InputTable extends AbstractTable<InputTable>, TColumn extends ColumnType, TToColumn extends ColumnType, IToTable extends AbstractTable<IToTable>, IToPartial extends PartialFor<IToTable> = {}>(fromTable: {
|
|
27
|
+
new (db: DB): InputTable;
|
|
28
|
+
}, table: {
|
|
29
|
+
new (db: DB): IToTable;
|
|
30
|
+
}, from: (table: CheckTwoTypes<InputTable, TTable, TTable1>) => AbstractColumn<TColumn, boolean, boolean, CheckTwoTypes<InputTable, TTable, TTable1>>, to: (table: IToTable) => AbstractColumn<TToColumn, boolean, boolean, IToTable>, partial?: IToPartial): SelectTRBWithTwoJoins<TTable, TTable1, IToTable, TPartial, TPartial1, IToPartial>;
|
|
31
|
+
rightJoin<InputTable extends AbstractTable<InputTable>, TColumn extends ColumnType, TToColumn extends ColumnType, IToTable extends AbstractTable<IToTable>, IToPartial extends PartialFor<IToTable> = {}>(fromTable: {
|
|
32
|
+
new (db: DB): InputTable;
|
|
33
|
+
}, table: {
|
|
34
|
+
new (db: DB): IToTable;
|
|
35
|
+
}, from: (table: CheckTwoTypes<InputTable, TTable, TTable1>) => AbstractColumn<TColumn, boolean, boolean, CheckTwoTypes<InputTable, TTable, TTable1>>, to: (table: IToTable) => AbstractColumn<TToColumn, boolean, boolean, IToTable>, partial?: IToPartial): SelectTRBWithTwoJoins<TTable, TTable1, IToTable, TPartial, TPartial1, IToPartial>;
|
|
36
|
+
fullJoin<InputTable extends AbstractTable<InputTable>, TColumn extends ColumnType, TToColumn extends ColumnType, IToTable extends AbstractTable<IToTable>, IToPartial extends PartialFor<IToTable> = {}>(fromTable: {
|
|
37
|
+
new (db: DB): InputTable;
|
|
38
|
+
}, table: {
|
|
39
|
+
new (db: DB): IToTable;
|
|
40
|
+
}, from: (table: CheckTwoTypes<InputTable, TTable, TTable1>) => AbstractColumn<TColumn, boolean, boolean, CheckTwoTypes<InputTable, TTable, TTable1>>, to: (table: IToTable) => AbstractColumn<TToColumn, boolean, boolean, IToTable>, partial?: IToPartial): SelectTRBWithTwoJoins<TTable, TTable1, IToTable, TPartial, TPartial1, IToPartial>;
|
|
41
|
+
protected joins(): Array<{
|
|
42
|
+
join: Join<any>;
|
|
43
|
+
partial?: {
|
|
44
|
+
[name: string]: AbstractColumn<ColumnType<any>, boolean, boolean, any>;
|
|
45
|
+
};
|
|
46
|
+
id?: number;
|
|
47
|
+
}>;
|
|
48
|
+
protected mapResponse(result: QueryResult<any>): SelectResponseJoin<TTable, TTable1, TPartial, TPartial1>;
|
|
49
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const join_1 = require("../join");
|
|
7
|
+
const joinWith_1 = __importDefault(require("../joinWith"));
|
|
8
|
+
const selectResponseWithJoin_1 = __importDefault(require("../responses/selectResponseWithJoin"));
|
|
9
|
+
const abstractJoinBuilder_1 = __importDefault(require("./abstractJoinBuilder"));
|
|
10
|
+
const selectWithTwoJoins_1 = __importDefault(require("./selectWithTwoJoins"));
|
|
11
|
+
// eslint-disable-next-line max-len
|
|
12
|
+
class SelectTRBWithJoin extends abstractJoinBuilder_1.default {
|
|
13
|
+
constructor(table, session, filter, join, props, orderBy, order, distinct, tablePartial, joinedPartial) {
|
|
14
|
+
super(table, filter, session, props, orderBy, order, distinct, tablePartial);
|
|
15
|
+
this._join = join;
|
|
16
|
+
this._joinedPartial = joinedPartial;
|
|
17
|
+
}
|
|
18
|
+
innerJoin(fromTable, table, from, to, partial) {
|
|
19
|
+
const toTable = this._table.db.create(table);
|
|
20
|
+
const tableFrom = this._table.db.create(fromTable);
|
|
21
|
+
const fromColumn = from(tableFrom);
|
|
22
|
+
const toColumn = to(toTable);
|
|
23
|
+
const join = new joinWith_1.default(toTable.tableName(), toTable.mapServiceToDb())
|
|
24
|
+
.columns(fromColumn, toColumn).joinStrategy(join_1.JoinStrategy.INNER_JOIN);
|
|
25
|
+
return new selectWithTwoJoins_1.default(this._table, this._session, this._filter, this._join, join, this._props, this._orderBy, this._order, this._distinct, this._partial, this._joinedPartial, partial);
|
|
26
|
+
}
|
|
27
|
+
leftJoin(fromTable, table, from, to, partial) {
|
|
28
|
+
const toTable = this._table.db.create(table);
|
|
29
|
+
const tableFrom = this._table.db.create(fromTable);
|
|
30
|
+
const fromColumn = from(tableFrom);
|
|
31
|
+
const toColumn = to(toTable);
|
|
32
|
+
const join = new joinWith_1.default(toTable.tableName(), toTable.mapServiceToDb())
|
|
33
|
+
.columns(fromColumn, toColumn).joinStrategy(join_1.JoinStrategy.LEFT_JOIN);
|
|
34
|
+
return new selectWithTwoJoins_1.default(this._table, this._session, this._filter, this._join, join, this._props, this._orderBy, this._order, this._distinct, this._partial, this._joinedPartial, partial);
|
|
35
|
+
}
|
|
36
|
+
rightJoin(fromTable, table, from, to, partial) {
|
|
37
|
+
const toTable = this._table.db.create(table);
|
|
38
|
+
const tableFrom = this._table.db.create(fromTable);
|
|
39
|
+
const fromColumn = from(tableFrom);
|
|
40
|
+
const toColumn = to(toTable);
|
|
41
|
+
const join = new joinWith_1.default(toTable.tableName(), toTable.mapServiceToDb())
|
|
42
|
+
.columns(fromColumn, toColumn).joinStrategy(join_1.JoinStrategy.RIGHT_JOIN);
|
|
43
|
+
return new selectWithTwoJoins_1.default(this._table, this._session, this._filter, this._join, join, this._props, this._orderBy, this._order, this._distinct, this._partial, this._joinedPartial, partial);
|
|
44
|
+
}
|
|
45
|
+
fullJoin(fromTable, table, from, to, partial) {
|
|
46
|
+
const toTable = this._table.db.create(table);
|
|
47
|
+
const tableFrom = this._table.db.create(fromTable);
|
|
48
|
+
const fromColumn = from(tableFrom);
|
|
49
|
+
const toColumn = to(toTable);
|
|
50
|
+
const join = new joinWith_1.default(toTable.tableName(), toTable.mapServiceToDb())
|
|
51
|
+
.columns(fromColumn, toColumn).joinStrategy(join_1.JoinStrategy.FULL_JOIN);
|
|
52
|
+
return new selectWithTwoJoins_1.default(this._table, this._session, this._filter, this._join, join, this._props, this._orderBy, this._order, this._distinct, this._partial, this._joinedPartial, partial);
|
|
53
|
+
}
|
|
54
|
+
joins() {
|
|
55
|
+
return [{ join: this._join, partial: this._joinedPartial, id: 1 }];
|
|
56
|
+
}
|
|
57
|
+
mapResponse(result) {
|
|
58
|
+
const parent = this._join.mappedServiceToDb;
|
|
59
|
+
const response = this.fullOrPartial(this._table.mapServiceToDb(), result, this._partial);
|
|
60
|
+
const objects = this.fullOrPartial(parent, result, this._joinedPartial, 1);
|
|
61
|
+
return new selectResponseWithJoin_1.default(response, objects);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.default = SelectTRBWithJoin;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { QueryResult } from 'pg';
|
|
2
|
+
import { AbstractColumn } from '../../../columns/column';
|
|
3
|
+
import ColumnType from '../../../columns/types/columnType';
|
|
4
|
+
import DB from '../../../db/db';
|
|
5
|
+
import { ISession } from '../../../db/session';
|
|
6
|
+
import AbstractTable from '../../../tables/abstractTable';
|
|
7
|
+
import { CheckFourTypes, PartialFor } from '../../../tables/inferTypes';
|
|
8
|
+
import Order from '../../highLvlBuilders/order';
|
|
9
|
+
import Expr from '../../requestBuilders/where/where';
|
|
10
|
+
import Join from '../join';
|
|
11
|
+
import SelectResponseThreeJoins from '../responses/selectResponseThreeJoins';
|
|
12
|
+
import AbstractJoined from './abstractJoinBuilder';
|
|
13
|
+
import SelectTRBWithFourJoins from './selectWithFourJoins';
|
|
14
|
+
export default class SelectTRBWithThreeJoins<TTable extends AbstractTable<TTable>, TTable1 extends AbstractTable<TTable1>, TTable2 extends AbstractTable<TTable2>, TTable3 extends AbstractTable<TTable3>, TPartial extends PartialFor<TTable> = {}, TPartial1 extends PartialFor<TTable1> = {}, TPartial2 extends PartialFor<TTable2> = {}, TPartial3 extends PartialFor<TTable3> = {}> extends AbstractJoined<TTable, SelectResponseThreeJoins<TTable, TTable1, TTable2, TTable3, TPartial, TPartial1, TPartial2, TPartial3>, TPartial> {
|
|
15
|
+
private _join1;
|
|
16
|
+
private _join2;
|
|
17
|
+
private _join3;
|
|
18
|
+
private _joinedPartial?;
|
|
19
|
+
private _joinedPartial1?;
|
|
20
|
+
private _joinedPartial2?;
|
|
21
|
+
constructor(table: TTable, session: ISession, filter: Expr, join1: Join<TTable1>, join2: Join<TTable2>, join3: Join<TTable3>, props: {
|
|
22
|
+
limit?: number;
|
|
23
|
+
offset?: number;
|
|
24
|
+
}, orderBy?: AbstractColumn<ColumnType, boolean, boolean>, order?: Order, distinct?: AbstractColumn<ColumnType, boolean, boolean>, tablePartial?: TPartial, joinedPartial?: TPartial1, joinedPartial1?: TPartial2, joinedPartial2?: TPartial3);
|
|
25
|
+
innerJoin<InputTable extends AbstractTable<InputTable>, TColumn extends ColumnType, TToColumn extends ColumnType, IToTable extends AbstractTable<IToTable>, IToPartial extends PartialFor<IToTable> = {}>(fromTable: {
|
|
26
|
+
new (db: DB): InputTable;
|
|
27
|
+
}, table: {
|
|
28
|
+
new (db: DB): IToTable;
|
|
29
|
+
}, from: (table: CheckFourTypes<InputTable, TTable, TTable1, TTable2, TTable3>) => AbstractColumn<TColumn, boolean, boolean, CheckFourTypes<InputTable, TTable, TTable1, TTable2, TTable3>>, to: (table: IToTable) => AbstractColumn<TToColumn, boolean, boolean, IToTable>, partial?: IToPartial): SelectTRBWithFourJoins<TTable, TTable1, TTable2, TTable3, IToTable, TPartial, TPartial1, TPartial2, TPartial3, IToPartial>;
|
|
30
|
+
leftJoin<InputTable extends AbstractTable<InputTable>, TColumn extends ColumnType, TToColumn extends ColumnType, IToTable extends AbstractTable<IToTable>, IToPartial extends PartialFor<IToTable> = {}>(fromTable: {
|
|
31
|
+
new (db: DB): InputTable;
|
|
32
|
+
}, table: {
|
|
33
|
+
new (db: DB): IToTable;
|
|
34
|
+
}, from: (table: CheckFourTypes<InputTable, TTable, TTable1, TTable2, TTable3>) => AbstractColumn<TColumn, boolean, boolean, CheckFourTypes<InputTable, TTable, TTable1, TTable2, TTable3>>, to: (table: IToTable) => AbstractColumn<TToColumn, boolean, boolean, IToTable>, partial?: IToPartial): SelectTRBWithFourJoins<TTable, TTable1, TTable2, TTable3, IToTable, TPartial, TPartial1, TPartial2, TPartial3, IToPartial>;
|
|
35
|
+
rightJoin<InputTable extends AbstractTable<InputTable>, TColumn extends ColumnType, TToColumn extends ColumnType, IToTable extends AbstractTable<IToTable>, IToPartial extends PartialFor<IToTable> = {}>(fromTable: {
|
|
36
|
+
new (db: DB): InputTable;
|
|
37
|
+
}, table: {
|
|
38
|
+
new (db: DB): IToTable;
|
|
39
|
+
}, from: (table: CheckFourTypes<InputTable, TTable, TTable1, TTable2, TTable3>) => AbstractColumn<TColumn, boolean, boolean, CheckFourTypes<InputTable, TTable, TTable1, TTable2, TTable3>>, to: (table: IToTable) => AbstractColumn<TToColumn, boolean, boolean, IToTable>, partial?: IToPartial): SelectTRBWithFourJoins<TTable, TTable1, TTable2, TTable3, IToTable, TPartial, TPartial1, TPartial2, TPartial3, IToPartial>;
|
|
40
|
+
fullJoin<InputTable extends AbstractTable<InputTable>, TColumn extends ColumnType, TToColumn extends ColumnType, IToTable extends AbstractTable<IToTable>, IToPartial extends PartialFor<IToTable> = {}>(fromTable: {
|
|
41
|
+
new (db: DB): InputTable;
|
|
42
|
+
}, table: {
|
|
43
|
+
new (db: DB): IToTable;
|
|
44
|
+
}, from: (table: CheckFourTypes<InputTable, TTable, TTable1, TTable2, TTable3>) => AbstractColumn<TColumn, boolean, boolean, CheckFourTypes<InputTable, TTable, TTable1, TTable2, TTable3>>, to: (table: IToTable) => AbstractColumn<TToColumn, boolean, boolean, IToTable>, partial?: IToPartial): SelectTRBWithFourJoins<TTable, TTable1, TTable2, TTable3, IToTable, TPartial, TPartial1, TPartial2, TPartial3, IToPartial>;
|
|
45
|
+
protected mapResponse(result: QueryResult<any>): SelectResponseThreeJoins<TTable, TTable1, TTable2, TTable3, TPartial, TPartial1, TPartial2, TPartial3>;
|
|
46
|
+
protected joins(): Array<{
|
|
47
|
+
join: Join<any>;
|
|
48
|
+
partial?: {
|
|
49
|
+
[name: string]: AbstractColumn<ColumnType<any>, boolean, boolean, any>;
|
|
50
|
+
};
|
|
51
|
+
id?: number;
|
|
52
|
+
}>;
|
|
53
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const join_1 = require("../join");
|
|
7
|
+
const joinWith_1 = __importDefault(require("../joinWith"));
|
|
8
|
+
const selectResponseThreeJoins_1 = __importDefault(require("../responses/selectResponseThreeJoins"));
|
|
9
|
+
const abstractJoinBuilder_1 = __importDefault(require("./abstractJoinBuilder"));
|
|
10
|
+
const selectWithFourJoins_1 = __importDefault(require("./selectWithFourJoins"));
|
|
11
|
+
class SelectTRBWithThreeJoins extends abstractJoinBuilder_1.default {
|
|
12
|
+
constructor(table, session, filter, join1, join2, join3, props, orderBy, order, distinct, tablePartial, joinedPartial, joinedPartial1, joinedPartial2) {
|
|
13
|
+
super(table, filter, session, props, orderBy, order, distinct, tablePartial);
|
|
14
|
+
this._join1 = join1;
|
|
15
|
+
this._join2 = join2;
|
|
16
|
+
this._join3 = join3;
|
|
17
|
+
this._joinedPartial = joinedPartial;
|
|
18
|
+
this._joinedPartial1 = joinedPartial1;
|
|
19
|
+
this._joinedPartial2 = joinedPartial2;
|
|
20
|
+
}
|
|
21
|
+
innerJoin(fromTable, table, from, to, partial) {
|
|
22
|
+
const toTable = this._table.db.create(table);
|
|
23
|
+
const tableFrom = this._table.db.create(fromTable);
|
|
24
|
+
const fromColumn = from(tableFrom);
|
|
25
|
+
const toColumn = to(toTable);
|
|
26
|
+
const join = new joinWith_1.default(toTable.tableName(), toTable.mapServiceToDb())
|
|
27
|
+
.columns(fromColumn, toColumn).joinStrategy(join_1.JoinStrategy.INNER_JOIN);
|
|
28
|
+
return new selectWithFourJoins_1.default(this._table, this._session, this._filter, this._join1, this._join2, this._join3, join, this._props, this._orderBy, this._order, this._distinct, this._partial, this._joinedPartial, this._joinedPartial1, this._joinedPartial2, partial);
|
|
29
|
+
}
|
|
30
|
+
leftJoin(fromTable, table, from, to, partial) {
|
|
31
|
+
const toTable = this._table.db.create(table);
|
|
32
|
+
const tableFrom = this._table.db.create(fromTable);
|
|
33
|
+
const fromColumn = from(tableFrom);
|
|
34
|
+
const toColumn = to(toTable);
|
|
35
|
+
const join = new joinWith_1.default(toTable.tableName(), toTable.mapServiceToDb())
|
|
36
|
+
.columns(fromColumn, toColumn).joinStrategy(join_1.JoinStrategy.LEFT_JOIN);
|
|
37
|
+
return new selectWithFourJoins_1.default(this._table, this._session, this._filter, this._join1, this._join2, this._join3, join, this._props, this._orderBy, this._order, this._distinct, this._partial, this._joinedPartial, this._joinedPartial1, this._joinedPartial2, partial);
|
|
38
|
+
}
|
|
39
|
+
rightJoin(fromTable, table, from, to, partial) {
|
|
40
|
+
const toTable = this._table.db.create(table);
|
|
41
|
+
const tableFrom = this._table.db.create(fromTable);
|
|
42
|
+
const fromColumn = from(tableFrom);
|
|
43
|
+
const toColumn = to(toTable);
|
|
44
|
+
const join = new joinWith_1.default(toTable.tableName(), toTable.mapServiceToDb())
|
|
45
|
+
.columns(fromColumn, toColumn).joinStrategy(join_1.JoinStrategy.RIGHT_JOIN);
|
|
46
|
+
return new selectWithFourJoins_1.default(this._table, this._session, this._filter, this._join1, this._join2, this._join3, join, this._props, this._orderBy, this._order, this._distinct, this._partial, this._joinedPartial, this._joinedPartial1, this._joinedPartial2, partial);
|
|
47
|
+
}
|
|
48
|
+
fullJoin(fromTable, table, from, to, partial) {
|
|
49
|
+
const toTable = this._table.db.create(table);
|
|
50
|
+
const tableFrom = this._table.db.create(fromTable);
|
|
51
|
+
const fromColumn = from(tableFrom);
|
|
52
|
+
const toColumn = to(toTable);
|
|
53
|
+
const join = new joinWith_1.default(toTable.tableName(), toTable.mapServiceToDb())
|
|
54
|
+
.columns(fromColumn, toColumn).joinStrategy(join_1.JoinStrategy.FULL_JOIN);
|
|
55
|
+
return new selectWithFourJoins_1.default(this._table, this._session, this._filter, this._join1, this._join2, this._join3, join, this._props, this._orderBy, this._order, this._distinct, this._partial, this._joinedPartial, this._joinedPartial1, this._joinedPartial2, partial);
|
|
56
|
+
}
|
|
57
|
+
mapResponse(result) {
|
|
58
|
+
const parent = this._join1.mappedServiceToDb;
|
|
59
|
+
const parentTwo = this._join2.mappedServiceToDb;
|
|
60
|
+
const parentThree = this._join3.mappedServiceToDb;
|
|
61
|
+
const response = this.fullOrPartial(this._table.mapServiceToDb(), result, this._partial);
|
|
62
|
+
const objects = this.fullOrPartial(parent, result, this._joinedPartial, 1);
|
|
63
|
+
const objectsTwo = this.fullOrPartial(parentTwo, result, this._joinedPartial1, 2);
|
|
64
|
+
const objectsThree = this.fullOrPartial(parentThree, result, this._joinedPartial2, 3);
|
|
65
|
+
return new selectResponseThreeJoins_1.default(response, objects, objectsTwo, objectsThree);
|
|
66
|
+
}
|
|
67
|
+
joins() {
|
|
68
|
+
return [{ join: this._join1, partial: this._joinedPartial, id: 1 },
|
|
69
|
+
{ join: this._join2, partial: this._joinedPartial1, id: 2 },
|
|
70
|
+
{ join: this._join3, partial: this._joinedPartial2, id: 3 }];
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.default = SelectTRBWithThreeJoins;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { QueryResult } from 'pg';
|
|
2
|
+
import { AbstractColumn } from '../../../columns/column';
|
|
3
|
+
import ColumnType from '../../../columns/types/columnType';
|
|
4
|
+
import DB from '../../../db/db';
|
|
5
|
+
import { ISession } from '../../../db/session';
|
|
6
|
+
import AbstractTable from '../../../tables/abstractTable';
|
|
7
|
+
import { CheckThreeTypes, PartialFor } from '../../../tables/inferTypes';
|
|
8
|
+
import Order from '../../highLvlBuilders/order';
|
|
9
|
+
import Expr from '../../requestBuilders/where/where';
|
|
10
|
+
import Join from '../join';
|
|
11
|
+
import SelectResponseTwoJoins from '../responses/selectResponseTwoJoins';
|
|
12
|
+
import AbstractJoined from './abstractJoinBuilder';
|
|
13
|
+
import SelectTRBWithThreeJoins from './selectWithThreeJoins';
|
|
14
|
+
export default class SelectTRBWithTwoJoins<TTable extends AbstractTable<TTable>, TTable1 extends AbstractTable<TTable1>, TTable2 extends AbstractTable<TTable2>, TPartial extends PartialFor<TTable> = {}, TPartial1 extends PartialFor<TTable1> = {}, TPartial2 extends PartialFor<TTable2> = {}> extends AbstractJoined<TTable, SelectResponseTwoJoins<TTable, TTable1, TTable2, TPartial, TPartial1, TPartial2>, TPartial> {
|
|
15
|
+
private _join1;
|
|
16
|
+
private _join2;
|
|
17
|
+
private _joinedPartial?;
|
|
18
|
+
private _joinedPartial1?;
|
|
19
|
+
constructor(table: TTable, session: ISession, filter: Expr, join1: Join<TTable1>, join2: Join<TTable2>, props: {
|
|
20
|
+
limit?: number;
|
|
21
|
+
offset?: number;
|
|
22
|
+
}, orderBy?: AbstractColumn<ColumnType, boolean, boolean>, order?: Order, distinct?: AbstractColumn<ColumnType, boolean, boolean>, tablePartial?: TPartial, joinedPartial?: TPartial1, joinedPartial1?: TPartial2);
|
|
23
|
+
innerJoin<InputTable extends AbstractTable<InputTable>, TColumn extends ColumnType, TToColumn extends ColumnType, IToTable extends AbstractTable<IToTable>, IToPartial extends PartialFor<IToTable> = {}>(fromTable: {
|
|
24
|
+
new (db: DB): InputTable;
|
|
25
|
+
}, table: {
|
|
26
|
+
new (db: DB): IToTable;
|
|
27
|
+
}, from: (table: CheckThreeTypes<InputTable, TTable, TTable1, TTable2>) => AbstractColumn<TColumn, boolean, boolean, CheckThreeTypes<InputTable, TTable, TTable1, TTable2>>, to: (table: IToTable) => AbstractColumn<TToColumn, boolean, boolean, IToTable>, partial?: IToPartial): SelectTRBWithThreeJoins<TTable, TTable1, TTable2, IToTable, TPartial, TPartial1, TPartial2, IToPartial>;
|
|
28
|
+
leftJoin<InputTable extends AbstractTable<InputTable>, TColumn extends ColumnType, TToColumn extends ColumnType, IToTable extends AbstractTable<IToTable>, IToPartial extends PartialFor<IToTable> = {}>(fromTable: {
|
|
29
|
+
new (db: DB): InputTable;
|
|
30
|
+
}, table: {
|
|
31
|
+
new (db: DB): IToTable;
|
|
32
|
+
}, from: (table: CheckThreeTypes<InputTable, TTable, TTable1, TTable2>) => AbstractColumn<TColumn, boolean, boolean, CheckThreeTypes<InputTable, TTable, TTable1, TTable2>>, to: (table: IToTable) => AbstractColumn<TToColumn, boolean, boolean, IToTable>, partial?: IToPartial): SelectTRBWithThreeJoins<TTable, TTable1, TTable2, IToTable, TPartial, TPartial1, TPartial2, IToPartial>;
|
|
33
|
+
rightJoin<InputTable extends AbstractTable<InputTable>, TColumn extends ColumnType, TToColumn extends ColumnType, IToTable extends AbstractTable<IToTable>, IToPartial extends PartialFor<IToTable> = {}>(fromTable: {
|
|
34
|
+
new (db: DB): InputTable;
|
|
35
|
+
}, table: {
|
|
36
|
+
new (db: DB): IToTable;
|
|
37
|
+
}, from: (table: CheckThreeTypes<InputTable, TTable, TTable1, TTable2>) => AbstractColumn<TColumn, boolean, boolean, CheckThreeTypes<InputTable, TTable, TTable1, TTable2>>, to: (table: IToTable) => AbstractColumn<TToColumn, boolean, boolean, IToTable>, partial?: IToPartial): SelectTRBWithThreeJoins<TTable, TTable1, TTable2, IToTable, TPartial, TPartial1, TPartial2, IToPartial>;
|
|
38
|
+
fullJoin<InputTable extends AbstractTable<InputTable>, TColumn extends ColumnType, TToColumn extends ColumnType, IToTable extends AbstractTable<IToTable>, IToPartial extends PartialFor<IToTable> = {}>(fromTable: {
|
|
39
|
+
new (db: DB): InputTable;
|
|
40
|
+
}, table: {
|
|
41
|
+
new (db: DB): IToTable;
|
|
42
|
+
}, from: (table: CheckThreeTypes<InputTable, TTable, TTable1, TTable2>) => AbstractColumn<TColumn, boolean, boolean, CheckThreeTypes<InputTable, TTable, TTable1, TTable2>>, to: (table: IToTable) => AbstractColumn<TToColumn, boolean, boolean, IToTable>, partial?: IToPartial): SelectTRBWithThreeJoins<TTable, TTable1, TTable2, IToTable, TPartial, TPartial1, TPartial2, IToPartial>;
|
|
43
|
+
protected mapResponse(result: QueryResult<any>): SelectResponseTwoJoins<TTable, TTable1, TTable2, TPartial, TPartial1, TPartial2>;
|
|
44
|
+
protected joins(): Array<{
|
|
45
|
+
join: Join<any>;
|
|
46
|
+
partial?: {
|
|
47
|
+
[name: string]: AbstractColumn<ColumnType<any>, boolean, boolean, any>;
|
|
48
|
+
};
|
|
49
|
+
id?: number;
|
|
50
|
+
}>;
|
|
51
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const join_1 = require("../join");
|
|
7
|
+
const joinWith_1 = __importDefault(require("../joinWith"));
|
|
8
|
+
const selectResponseTwoJoins_1 = __importDefault(require("../responses/selectResponseTwoJoins"));
|
|
9
|
+
const abstractJoinBuilder_1 = __importDefault(require("./abstractJoinBuilder"));
|
|
10
|
+
const selectWithThreeJoins_1 = __importDefault(require("./selectWithThreeJoins"));
|
|
11
|
+
class SelectTRBWithTwoJoins extends abstractJoinBuilder_1.default {
|
|
12
|
+
constructor(table, session, filter, join1, join2, props, orderBy, order, distinct, tablePartial, joinedPartial, joinedPartial1) {
|
|
13
|
+
super(table, filter, session, props, orderBy, order, distinct, tablePartial);
|
|
14
|
+
this._join1 = join1;
|
|
15
|
+
this._join2 = join2;
|
|
16
|
+
this._joinedPartial = joinedPartial;
|
|
17
|
+
this._joinedPartial1 = joinedPartial1;
|
|
18
|
+
}
|
|
19
|
+
innerJoin(fromTable, table, from, to, partial) {
|
|
20
|
+
const toTable = this._table.db.create(table);
|
|
21
|
+
const tableFrom = this._table.db.create(fromTable);
|
|
22
|
+
const fromColumn = from(tableFrom);
|
|
23
|
+
const toColumn = to(toTable);
|
|
24
|
+
const join = new joinWith_1.default(toTable.tableName(), toTable.mapServiceToDb())
|
|
25
|
+
.columns(fromColumn, toColumn).joinStrategy(join_1.JoinStrategy.INNER_JOIN);
|
|
26
|
+
return new selectWithThreeJoins_1.default(this._table, this._session, this._filter, this._join1, this._join2, join, this._props, this._orderBy, this._order, this._distinct, this._partial, this._joinedPartial, this._joinedPartial1, partial);
|
|
27
|
+
}
|
|
28
|
+
leftJoin(fromTable, table, from, to, partial) {
|
|
29
|
+
const toTable = this._table.db.create(table);
|
|
30
|
+
const tableFrom = this._table.db.create(fromTable);
|
|
31
|
+
const fromColumn = from(tableFrom);
|
|
32
|
+
const toColumn = to(toTable);
|
|
33
|
+
const join = new joinWith_1.default(toTable.tableName(), toTable.mapServiceToDb())
|
|
34
|
+
.columns(fromColumn, toColumn).joinStrategy(join_1.JoinStrategy.LEFT_JOIN);
|
|
35
|
+
return new selectWithThreeJoins_1.default(this._table, this._session, this._filter, this._join1, this._join2, join, this._props, this._orderBy, this._order, this._distinct, this._partial, this._joinedPartial, this._joinedPartial1, partial);
|
|
36
|
+
}
|
|
37
|
+
rightJoin(fromTable, table, from, to, partial) {
|
|
38
|
+
const toTable = this._table.db.create(table);
|
|
39
|
+
const tableFrom = this._table.db.create(fromTable);
|
|
40
|
+
const fromColumn = from(tableFrom);
|
|
41
|
+
const toColumn = to(toTable);
|
|
42
|
+
const join = new joinWith_1.default(toTable.tableName(), toTable.mapServiceToDb())
|
|
43
|
+
.columns(fromColumn, toColumn).joinStrategy(join_1.JoinStrategy.RIGHT_JOIN);
|
|
44
|
+
return new selectWithThreeJoins_1.default(this._table, this._session, this._filter, this._join1, this._join2, join, this._props, this._orderBy, this._order, this._distinct, this._partial, this._joinedPartial, this._joinedPartial1, partial);
|
|
45
|
+
}
|
|
46
|
+
fullJoin(fromTable, table, from, to, partial) {
|
|
47
|
+
const toTable = this._table.db.create(table);
|
|
48
|
+
const tableFrom = this._table.db.create(fromTable);
|
|
49
|
+
const fromColumn = from(tableFrom);
|
|
50
|
+
const toColumn = to(toTable);
|
|
51
|
+
const join = new joinWith_1.default(toTable.tableName(), toTable.mapServiceToDb())
|
|
52
|
+
.columns(fromColumn, toColumn).joinStrategy(join_1.JoinStrategy.FULL_JOIN);
|
|
53
|
+
return new selectWithThreeJoins_1.default(this._table, this._session, this._filter, this._join1, this._join2, join, this._props, this._orderBy, this._order, this._distinct, this._partial, this._joinedPartial, this._joinedPartial1, partial);
|
|
54
|
+
}
|
|
55
|
+
mapResponse(result) {
|
|
56
|
+
const parent = this._join1.mappedServiceToDb;
|
|
57
|
+
const parentTwo = this._join2.mappedServiceToDb;
|
|
58
|
+
const response = this.fullOrPartial(this._table.mapServiceToDb(), result, this._partial);
|
|
59
|
+
const objects = this.fullOrPartial(parent, result, this._joinedPartial, 1);
|
|
60
|
+
const objectsTwo = this.fullOrPartial(parentTwo, result, this._joinedPartial1, 2);
|
|
61
|
+
return new selectResponseTwoJoins_1.default(response, objects, objectsTwo);
|
|
62
|
+
}
|
|
63
|
+
joins() {
|
|
64
|
+
return [{ join: this._join1, partial: this._joinedPartial, id: 1 },
|
|
65
|
+
{ join: this._join2, partial: this._joinedPartial1, id: 2 }];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.default = SelectTRBWithTwoJoins;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AbstractColumn } from '../../columns/column';
|
|
2
|
+
import ColumnType from '../../columns/types/columnType';
|
|
3
|
+
import { ExtractModel } from '../../tables/inferTypes';
|
|
4
|
+
export default class Join<TTable> {
|
|
5
|
+
fromColumn: AbstractColumn<ColumnType, boolean, boolean>;
|
|
6
|
+
toColumn: AbstractColumn<ColumnType, boolean, boolean>;
|
|
7
|
+
joinTableName: string;
|
|
8
|
+
mappedServiceToDb: {
|
|
9
|
+
[name in keyof ExtractModel<TTable>]: AbstractColumn<ColumnType>;
|
|
10
|
+
};
|
|
11
|
+
type: JoinStrategy;
|
|
12
|
+
constructor(joinTableName: string, fromColumn: AbstractColumn<ColumnType, boolean, boolean>, toColumn: AbstractColumn<ColumnType, boolean, boolean>, mappedServiceToDb: {
|
|
13
|
+
[name in keyof ExtractModel<TTable>]: AbstractColumn<ColumnType>;
|
|
14
|
+
});
|
|
15
|
+
joinStrategy: (type: JoinStrategy) => Join<TTable>;
|
|
16
|
+
columns: (fromColumn: AbstractColumn<ColumnType>, toColumn: AbstractColumn<ColumnType>) => Join<TTable>;
|
|
17
|
+
}
|
|
18
|
+
export declare enum JoinStrategy {
|
|
19
|
+
INNER_JOIN = "INNER JOIN",
|
|
20
|
+
LEFT_JOIN = "LEFT JOIN",
|
|
21
|
+
RIGHT_JOIN = "RIGHT JOIN",
|
|
22
|
+
FULL_JOIN = "FULL JOIN"
|
|
23
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.JoinStrategy = void 0;
|
|
4
|
+
class Join {
|
|
5
|
+
constructor(joinTableName, fromColumn, toColumn, mappedServiceToDb) {
|
|
6
|
+
this.joinStrategy = (type) => {
|
|
7
|
+
this.type = type;
|
|
8
|
+
return this;
|
|
9
|
+
};
|
|
10
|
+
this.columns = (fromColumn, toColumn) => {
|
|
11
|
+
this.toColumn = toColumn;
|
|
12
|
+
this.fromColumn = fromColumn;
|
|
13
|
+
return this;
|
|
14
|
+
};
|
|
15
|
+
this.joinTableName = joinTableName;
|
|
16
|
+
this.toColumn = toColumn;
|
|
17
|
+
this.fromColumn = fromColumn;
|
|
18
|
+
this.mappedServiceToDb = mappedServiceToDb;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.default = Join;
|
|
22
|
+
var JoinStrategy;
|
|
23
|
+
(function (JoinStrategy) {
|
|
24
|
+
JoinStrategy["INNER_JOIN"] = "INNER JOIN";
|
|
25
|
+
JoinStrategy["LEFT_JOIN"] = "LEFT JOIN";
|
|
26
|
+
JoinStrategy["RIGHT_JOIN"] = "RIGHT JOIN";
|
|
27
|
+
JoinStrategy["FULL_JOIN"] = "FULL JOIN";
|
|
28
|
+
})(JoinStrategy = exports.JoinStrategy || (exports.JoinStrategy = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AbstractColumn } from '../../columns/column';
|
|
2
|
+
import ColumnType from '../../columns/types/columnType';
|
|
3
|
+
import { ExtractModel } from '../../tables/inferTypes';
|
|
4
|
+
import Join from './join';
|
|
5
|
+
export default class JoinWith<TColumn extends ColumnType, TTable> {
|
|
6
|
+
joinTableName: string;
|
|
7
|
+
mappedServiceToDb: {
|
|
8
|
+
[name in keyof ExtractModel<TTable>]: AbstractColumn<TColumn>;
|
|
9
|
+
};
|
|
10
|
+
constructor(joinTableName: string, mappedServiceToDb: {
|
|
11
|
+
[name in keyof ExtractModel<TTable>]: AbstractColumn<TColumn>;
|
|
12
|
+
});
|
|
13
|
+
columns: (fromColumn: AbstractColumn<TColumn, boolean, boolean>, toColumn: AbstractColumn<TColumn, boolean, boolean>) => Join<TTable>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const join_1 = __importDefault(require("./join"));
|
|
7
|
+
class JoinWith {
|
|
8
|
+
constructor(joinTableName, mappedServiceToDb) {
|
|
9
|
+
this.columns = (fromColumn, toColumn) => new join_1.default(this.joinTableName, fromColumn, toColumn, this.mappedServiceToDb);
|
|
10
|
+
this.joinTableName = joinTableName;
|
|
11
|
+
this.mappedServiceToDb = mappedServiceToDb;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.default = JoinWith;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import AbstractTable from '../../../tables/abstractTable';
|
|
2
|
+
import { FullOrPartial, PartialFor } from '../../../tables/inferTypes';
|
|
3
|
+
export default class SelectResponseFiveJoins<T1 extends AbstractTable<T1>, T2 extends AbstractTable<T2>, T3 extends AbstractTable<T3>, T4 extends AbstractTable<T4>, T5 extends AbstractTable<T5>, T6 extends AbstractTable<T6>, TPartial1 extends PartialFor<T1>, TPartial2 extends PartialFor<T2>, TPartial3 extends PartialFor<T3>, TPartial4 extends PartialFor<T4>, TPartial5 extends PartialFor<T5>, TPartial6 extends PartialFor<T6>> {
|
|
4
|
+
_t1: Array<FullOrPartial<T1, TPartial1>>;
|
|
5
|
+
_t2: Array<FullOrPartial<T2, TPartial2>>;
|
|
6
|
+
_t3: Array<FullOrPartial<T3, TPartial3>>;
|
|
7
|
+
_t4: Array<FullOrPartial<T4, TPartial4>>;
|
|
8
|
+
_t5: Array<FullOrPartial<T5, TPartial5>>;
|
|
9
|
+
_t6: Array<FullOrPartial<T6, TPartial6>>;
|
|
10
|
+
constructor(t1: Array<FullOrPartial<T1, TPartial1>>, t2: Array<FullOrPartial<T2, TPartial2>>, t3: Array<FullOrPartial<T3, TPartial3>>, t4: Array<FullOrPartial<T4, TPartial4>>, t5: Array<FullOrPartial<T5, TPartial5>>, t6: Array<FullOrPartial<T6, TPartial6>>);
|
|
11
|
+
map: <M>(imac: (t1: FullOrPartial<T1, TPartial1>, t2: FullOrPartial<T2, TPartial2>, t3: FullOrPartial<T3, TPartial3>, t4: FullOrPartial<T4, TPartial4>, t5: FullOrPartial<T5, TPartial5>, t6: FullOrPartial<T6, TPartial6>) => M) => M[];
|
|
12
|
+
foreach: (imac: (t1: FullOrPartial<T1, TPartial1>, t2: FullOrPartial<T2, TPartial2>, t3: FullOrPartial<T3, TPartial3>, t4: FullOrPartial<T4, TPartial4>, t5: FullOrPartial<T5, TPartial5>, t6: FullOrPartial<T6, TPartial6>) => void) => void;
|
|
13
|
+
group: <TOne, TMany>({ one, many, }: {
|
|
14
|
+
one: (t1: FullOrPartial<T1, TPartial1>, t2: FullOrPartial<T2, TPartial2>, t3: FullOrPartial<T3, TPartial3>, t4: FullOrPartial<T4, TPartial4>, t5: FullOrPartial<T5, TPartial5>, t6: FullOrPartial<T6, TPartial6>) => TOne;
|
|
15
|
+
many: (t1: FullOrPartial<T1, TPartial1>, t2: FullOrPartial<T2, TPartial2>, t3: FullOrPartial<T3, TPartial3>, t4: FullOrPartial<T4, TPartial4>, t5: FullOrPartial<T5, TPartial5>, t6: FullOrPartial<T6, TPartial6>) => TMany;
|
|
16
|
+
}) => {
|
|
17
|
+
one: TOne;
|
|
18
|
+
many: TMany[];
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class SelectResponseFiveJoins {
|
|
4
|
+
constructor(t1, t2, t3, t4, t5, t6) {
|
|
5
|
+
this.map = (imac) => {
|
|
6
|
+
const objects = new Array();
|
|
7
|
+
for (let i = 0; i < this._t1.length; i += 1) {
|
|
8
|
+
objects.push(imac(this._t1[i], this._t2[i], this._t3[i], this._t4[i], this._t5[i], this._t6[i]));
|
|
9
|
+
}
|
|
10
|
+
return objects;
|
|
11
|
+
};
|
|
12
|
+
this.foreach = (imac) => {
|
|
13
|
+
for (let i = 0; i < this._t1.length; i += 1) {
|
|
14
|
+
imac(this._t1[i], this._t2[i], this._t3[i], this._t4[i], this._t5[i], this._t6[i]);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
this.group = ({ one, many, }) => {
|
|
18
|
+
const objects = new Array();
|
|
19
|
+
for (let i = 0; i < this._t1.length; i += 1) {
|
|
20
|
+
objects.push(many(this._t1[i], this._t2[i], this._t3[i], this._t4[i], this._t5[i], this._t6[i]));
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
one: one(this._t1[0], this._t2[0], this._t3[0], this._t4[0], this._t5[0], this._t6[0]),
|
|
24
|
+
many: objects,
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
this._t1 = t1;
|
|
28
|
+
this._t2 = t2;
|
|
29
|
+
this._t3 = t3;
|
|
30
|
+
this._t4 = t4;
|
|
31
|
+
this._t5 = t5;
|
|
32
|
+
this._t6 = t6;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.default = SelectResponseFiveJoins;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import AbstractTable from '../../../tables/abstractTable';
|
|
2
|
+
import { FullOrPartial, PartialFor } from '../../../tables/inferTypes';
|
|
3
|
+
export default class SelectResponseFourJoins<T1 extends AbstractTable<T1>, T2 extends AbstractTable<T2>, T3 extends AbstractTable<T3>, T4 extends AbstractTable<T4>, T5 extends AbstractTable<T5>, TPartial1 extends PartialFor<T1>, TPartial2 extends PartialFor<T2>, TPartial3 extends PartialFor<T3>, TPartial4 extends PartialFor<T4>, TPartial5 extends PartialFor<T5>> {
|
|
4
|
+
_t1: Array<FullOrPartial<T1, TPartial1>>;
|
|
5
|
+
_t2: Array<FullOrPartial<T2, TPartial2>>;
|
|
6
|
+
_t3: Array<FullOrPartial<T3, TPartial3>>;
|
|
7
|
+
_t4: Array<FullOrPartial<T4, TPartial4>>;
|
|
8
|
+
_t5: Array<FullOrPartial<T5, TPartial5>>;
|
|
9
|
+
constructor(t1: Array<FullOrPartial<T1, TPartial1>>, t2: Array<FullOrPartial<T2, TPartial2>>, t3: Array<FullOrPartial<T3, TPartial3>>, t4: Array<FullOrPartial<T4, TPartial4>>, t5: Array<FullOrPartial<T5, TPartial5>>);
|
|
10
|
+
map: <M>(imac: (t1: FullOrPartial<T1, TPartial1>, t2: FullOrPartial<T2, TPartial2>, t3: FullOrPartial<T3, TPartial3>, t4: FullOrPartial<T4, TPartial4>, t5: FullOrPartial<T5, TPartial5>) => M) => M[];
|
|
11
|
+
foreach: (imac: (t1: FullOrPartial<T1, TPartial1>, t2: FullOrPartial<T2, TPartial2>, t3: FullOrPartial<T3, TPartial3>, t4: FullOrPartial<T4, TPartial4>, t5: FullOrPartial<T5, TPartial5>) => void) => void;
|
|
12
|
+
group: <TOne, TMany>({ one, many, }: {
|
|
13
|
+
one: (t1: FullOrPartial<T1, TPartial1>, t2: FullOrPartial<T2, TPartial2>, t3: FullOrPartial<T3, TPartial3>, t4: FullOrPartial<T4, TPartial4>, t5: FullOrPartial<T5, TPartial5>) => TOne;
|
|
14
|
+
many: (t1: FullOrPartial<T1, TPartial1>, t2: FullOrPartial<T2, TPartial2>, t3: FullOrPartial<T3, TPartial3>, t4: FullOrPartial<T4, TPartial4>, t5: FullOrPartial<T5, TPartial5>) => TMany;
|
|
15
|
+
}) => {
|
|
16
|
+
one: TOne;
|
|
17
|
+
many: TMany[];
|
|
18
|
+
};
|
|
19
|
+
}
|