@technicity/data-service-generator 0.23.0-next.10 → 0.23.0-next.12
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.
|
@@ -106,7 +106,8 @@ async function generate(input) {
|
|
|
106
106
|
tables = tables.filter((x) => !input.excludeTables?.includes(x));
|
|
107
107
|
}
|
|
108
108
|
ctx.log.debug({ tableCount: tables.length, tables }, "tables after filter");
|
|
109
|
-
|
|
109
|
+
// Process table-by-table to avoid exhausting DB connection pool (e.g. Cloud SQL limits)
|
|
110
|
+
const data = (await Promise.all(tables.map((x) => Promise.all([
|
|
110
111
|
getGetOneData(x, includeMappedFields),
|
|
111
112
|
getGetListData(x),
|
|
112
113
|
getGetListPaginatedData(x),
|
|
@@ -115,7 +116,7 @@ async function generate(input) {
|
|
|
115
116
|
getPatchListData(x),
|
|
116
117
|
getDeleteOneData(x),
|
|
117
118
|
getDeleteListData(x)
|
|
118
|
-
]));
|
|
119
|
+
])))).flat();
|
|
119
120
|
ctx.log.debug({ inputLength: data.length }, "SDK input data collected");
|
|
120
121
|
const artifacts = await getArtifacts(tables, includeMappedFields, specialCaseUuidColumn);
|
|
121
122
|
ctx.log.debug("getArtifacts() completed");
|
|
@@ -1692,6 +1693,7 @@ function getRelationManyToOneFieldName(x) {
|
|
|
1692
1693
|
return changeCase.camelCase(x.foreignKey.replace(new RegExp(x.referencedKey + "$", "i"), ""));
|
|
1693
1694
|
}
|
|
1694
1695
|
// TODO: not sure if this logic is correct
|
|
1696
|
+
// Note: intentionally not the filtered tables
|
|
1695
1697
|
const getJunctionTables = (0, memoize_1.default)(async function getJunctionTables() {
|
|
1696
1698
|
const tables = await getTableNames();
|
|
1697
1699
|
return (await Promise.all(tables.map(async (table) => {
|