@etohq/index 1.0.0
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 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/loaders/index.d.ts +4 -0
- package/dist/loaders/index.d.ts.map +1 -0
- package/dist/loaders/index.js +27 -0
- package/dist/loaders/index.js.map +1 -0
- package/dist/migrations/Migration20231019174230.d.ts +5 -0
- package/dist/migrations/Migration20231019174230.d.ts.map +1 -0
- package/dist/migrations/Migration20231019174230.js +16 -0
- package/dist/migrations/Migration20231019174230.js.map +1 -0
- package/dist/migrations/Migration20241209173313.d.ts +6 -0
- package/dist/migrations/Migration20241209173313.d.ts.map +1 -0
- package/dist/migrations/Migration20241209173313.js +36 -0
- package/dist/migrations/Migration20241209173313.js.map +1 -0
- package/dist/models/index-data.d.ts +9 -0
- package/dist/models/index-data.d.ts.map +1 -0
- package/dist/models/index-data.js +39 -0
- package/dist/models/index-data.js.map +1 -0
- package/dist/models/index-relation.d.ts +22 -0
- package/dist/models/index-relation.d.ts.map +1 -0
- package/dist/models/index-relation.js +21 -0
- package/dist/models/index-relation.js.map +1 -0
- package/dist/models/index.d.ts +3 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +11 -0
- package/dist/models/index.js.map +1 -0
- package/dist/services/index-module-service.d.ts +30 -0
- package/dist/services/index-module-service.d.ts.map +1 -0
- package/dist/services/index-module-service.js +71 -0
- package/dist/services/index-module-service.js.map +1 -0
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +9 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/postgres-provider.d.ts +132 -0
- package/dist/services/postgres-provider.d.ts.map +1 -0
- package/dist/services/postgres-provider.js +490 -0
- package/dist/services/postgres-provider.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/index.d.ts +22 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +8 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/build-config.d.ts +24 -0
- package/dist/utils/build-config.d.ts.map +1 -0
- package/dist/utils/build-config.js +472 -0
- package/dist/utils/build-config.js.map +1 -0
- package/dist/utils/create-partitions.d.ts +4 -0
- package/dist/utils/create-partitions.d.ts.map +1 -0
- package/dist/utils/create-partitions.js +31 -0
- package/dist/utils/create-partitions.js.map +1 -0
- package/dist/utils/default-schema.d.ts +2 -0
- package/dist/utils/default-schema.d.ts.map +1 -0
- package/dist/utils/default-schema.js +24 -0
- package/dist/utils/default-schema.js.map +1 -0
- package/dist/utils/flatten-object-keys.d.ts +23 -0
- package/dist/utils/flatten-object-keys.d.ts.map +1 -0
- package/dist/utils/flatten-object-keys.js +54 -0
- package/dist/utils/flatten-object-keys.js.map +1 -0
- package/dist/utils/gql-to-types.d.ts +2 -0
- package/dist/utils/gql-to-types.d.ts.map +1 -0
- package/dist/utils/gql-to-types.js +91 -0
- package/dist/utils/gql-to-types.js.map +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +20 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/normalize-fields-selection.d.ts +2 -0
- package/dist/utils/normalize-fields-selection.d.ts.map +1 -0
- package/dist/utils/normalize-fields-selection.js +10 -0
- package/dist/utils/normalize-fields-selection.js.map +1 -0
- package/dist/utils/query-builder.d.ts +42 -0
- package/dist/utils/query-builder.d.ts.map +1 -0
- package/dist/utils/query-builder.js +420 -0
- package/dist/utils/query-builder.js.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QueryBuilder = exports.OPERATOR_MAP = void 0;
|
|
4
|
+
const utils_1 = require("@etohq/framework/utils");
|
|
5
|
+
exports.OPERATOR_MAP = {
|
|
6
|
+
$eq: "=",
|
|
7
|
+
$lt: "<",
|
|
8
|
+
$gt: ">",
|
|
9
|
+
$lte: "<=",
|
|
10
|
+
$gte: ">=",
|
|
11
|
+
$ne: "!=",
|
|
12
|
+
$in: "IN",
|
|
13
|
+
$is: "IS",
|
|
14
|
+
$like: "LIKE",
|
|
15
|
+
$ilike: "ILIKE",
|
|
16
|
+
};
|
|
17
|
+
class QueryBuilder {
|
|
18
|
+
constructor(args) {
|
|
19
|
+
this.schema = args.schema;
|
|
20
|
+
this.entityMap = args.entityMap;
|
|
21
|
+
this.selector = args.selector;
|
|
22
|
+
this.options = args.options;
|
|
23
|
+
this.knex = args.knex;
|
|
24
|
+
this.structure = this.selector.select;
|
|
25
|
+
}
|
|
26
|
+
getStructureKeys(structure) {
|
|
27
|
+
return Object.keys(structure ?? {}).filter((key) => key !== "entity");
|
|
28
|
+
}
|
|
29
|
+
getEntity(path) {
|
|
30
|
+
if (!this.schema._schemaPropertiesMap[path]) {
|
|
31
|
+
throw new Error(`Could not find entity for path: ${path}`);
|
|
32
|
+
}
|
|
33
|
+
return this.schema._schemaPropertiesMap[path];
|
|
34
|
+
}
|
|
35
|
+
getGraphQLType(path, field) {
|
|
36
|
+
const entity = this.getEntity(path)?.ref?.entity;
|
|
37
|
+
const fieldRef = this.entityMap[entity]._fields[field];
|
|
38
|
+
if (!fieldRef) {
|
|
39
|
+
throw new Error(`Field ${field} not found in the entityMap.`);
|
|
40
|
+
}
|
|
41
|
+
let currentType = fieldRef.type;
|
|
42
|
+
let isArray = false;
|
|
43
|
+
while (currentType.ofType) {
|
|
44
|
+
if (currentType instanceof utils_1.GraphQLUtils.GraphQLList) {
|
|
45
|
+
isArray = true;
|
|
46
|
+
}
|
|
47
|
+
currentType = currentType.ofType;
|
|
48
|
+
}
|
|
49
|
+
return currentType.name + (isArray ? "[]" : "");
|
|
50
|
+
}
|
|
51
|
+
transformValueToType(path, field, value) {
|
|
52
|
+
if (value === null) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
const typeToFn = {
|
|
56
|
+
Int: (val) => parseInt(val, 10),
|
|
57
|
+
Float: (val) => parseFloat(val),
|
|
58
|
+
String: (val) => String(val),
|
|
59
|
+
Boolean: (val) => Boolean(val),
|
|
60
|
+
ID: (val) => String(val),
|
|
61
|
+
Date: (val) => new Date(val).toISOString(),
|
|
62
|
+
Time: (val) => new Date(`1970-01-01T${val}Z`).toISOString(),
|
|
63
|
+
};
|
|
64
|
+
const fullPath = [path, ...field];
|
|
65
|
+
const prop = fullPath.pop();
|
|
66
|
+
const fieldPath = fullPath.join(".");
|
|
67
|
+
const graphqlType = this.getGraphQLType(fieldPath, prop).replace("[]", "");
|
|
68
|
+
const fn = typeToFn[graphqlType];
|
|
69
|
+
if (Array.isArray(value)) {
|
|
70
|
+
return value.map((v) => (!fn ? v : fn(v)));
|
|
71
|
+
}
|
|
72
|
+
return !fn ? value : fn(value);
|
|
73
|
+
}
|
|
74
|
+
getPostgresCastType(path, field) {
|
|
75
|
+
const graphqlToPostgresTypeMap = {
|
|
76
|
+
Int: "::int",
|
|
77
|
+
Float: "::double precision",
|
|
78
|
+
Boolean: "::boolean",
|
|
79
|
+
Date: "::timestamp",
|
|
80
|
+
Time: "::time",
|
|
81
|
+
"": "",
|
|
82
|
+
};
|
|
83
|
+
const fullPath = [path, ...field];
|
|
84
|
+
const prop = fullPath.pop();
|
|
85
|
+
const fieldPath = fullPath.join(".");
|
|
86
|
+
let graphqlType = this.getGraphQLType(fieldPath, prop);
|
|
87
|
+
const isList = graphqlType.endsWith("[]");
|
|
88
|
+
graphqlType = graphqlType.replace("[]", "");
|
|
89
|
+
return (graphqlToPostgresTypeMap[graphqlType] ?? "") + (isList ? "[]" : "");
|
|
90
|
+
}
|
|
91
|
+
parseWhere(aliasMapping, obj, builder) {
|
|
92
|
+
const keys = Object.keys(obj);
|
|
93
|
+
const getPathAndField = (key) => {
|
|
94
|
+
const path = key.split(".");
|
|
95
|
+
const field = [path.pop()];
|
|
96
|
+
while (!aliasMapping[path.join(".")] && path.length > 0) {
|
|
97
|
+
field.unshift(path.pop());
|
|
98
|
+
}
|
|
99
|
+
const attr = path.join(".");
|
|
100
|
+
return { field, attr };
|
|
101
|
+
};
|
|
102
|
+
const getPathOperation = (attr, path, value) => {
|
|
103
|
+
const partialPath = path.length > 1 ? path.slice(0, -1) : path;
|
|
104
|
+
const val = this.transformValueToType(attr, partialPath, value);
|
|
105
|
+
const result = path.reduceRight((acc, key) => {
|
|
106
|
+
return { [key]: acc };
|
|
107
|
+
}, val);
|
|
108
|
+
return JSON.stringify(result);
|
|
109
|
+
};
|
|
110
|
+
keys.forEach((key) => {
|
|
111
|
+
let value = obj[key];
|
|
112
|
+
if ((key === "$and" || key === "$or") && !Array.isArray(value)) {
|
|
113
|
+
value = [value];
|
|
114
|
+
}
|
|
115
|
+
if (key === "$and" && Array.isArray(value)) {
|
|
116
|
+
builder.where((qb) => {
|
|
117
|
+
value.forEach((cond) => {
|
|
118
|
+
qb.andWhere((subBuilder) => this.parseWhere(aliasMapping, cond, subBuilder));
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
else if (key === "$or" && Array.isArray(value)) {
|
|
123
|
+
builder.where((qb) => {
|
|
124
|
+
value.forEach((cond) => {
|
|
125
|
+
qb.orWhere((subBuilder) => this.parseWhere(aliasMapping, cond, subBuilder));
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
else if ((0, utils_1.isObject)(value) && !Array.isArray(value)) {
|
|
130
|
+
const subKeys = Object.keys(value);
|
|
131
|
+
subKeys.forEach((subKey) => {
|
|
132
|
+
let operator = exports.OPERATOR_MAP[subKey];
|
|
133
|
+
if (operator) {
|
|
134
|
+
const { field, attr } = getPathAndField(key);
|
|
135
|
+
const nested = new Array(field.length).join("->?");
|
|
136
|
+
const subValue = this.transformValueToType(attr, field, value[subKey]);
|
|
137
|
+
const castType = this.getPostgresCastType(attr, field);
|
|
138
|
+
const val = operator === "IN" ? subValue : [subValue];
|
|
139
|
+
if (operator === "=" && subValue === null) {
|
|
140
|
+
operator = "IS";
|
|
141
|
+
}
|
|
142
|
+
if (operator === "=") {
|
|
143
|
+
builder.whereRaw(`${aliasMapping[attr]}.data @> '${getPathOperation(attr, field, subValue)}'::jsonb`);
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
builder.whereRaw(`(${aliasMapping[attr]}.data${nested}->>?)${castType} ${operator} ?`, [...field, ...val]);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
throw new Error(`Unsupported operator: ${subKey}`);
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
const { field, attr } = getPathAndField(key);
|
|
156
|
+
const nested = new Array(field.length).join("->?");
|
|
157
|
+
value = this.transformValueToType(attr, field, value);
|
|
158
|
+
if (Array.isArray(value)) {
|
|
159
|
+
const castType = this.getPostgresCastType(attr, field);
|
|
160
|
+
const inPlaceholders = value.map(() => "?").join(",");
|
|
161
|
+
builder.whereRaw(`(${aliasMapping[attr]}.data${nested}->>?)${castType} IN (${inPlaceholders})`, [...field, ...value]);
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
const operator = value === null ? "IS" : "=";
|
|
165
|
+
if (operator === "=") {
|
|
166
|
+
builder.whereRaw(`${aliasMapping[attr]}.data @> '${getPathOperation(attr, field, value)}'::jsonb`);
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
const castType = this.getPostgresCastType(attr, field);
|
|
170
|
+
builder.whereRaw(`(${aliasMapping[attr]}.data${nested}->>?)${castType} ${operator} ?`, [...field, value]);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
return builder;
|
|
176
|
+
}
|
|
177
|
+
buildQueryParts(structure, parentAlias, parentEntity, parentProperty, aliasPath = [], level = 0, aliasMapping = {}) {
|
|
178
|
+
const currentAliasPath = [...aliasPath, parentProperty].join(".");
|
|
179
|
+
const entities = this.getEntity(currentAliasPath);
|
|
180
|
+
const mainEntity = entities.ref.entity;
|
|
181
|
+
const mainAlias = mainEntity.toLowerCase() + level;
|
|
182
|
+
const allEntities = [];
|
|
183
|
+
if (!entities.shortCutOf) {
|
|
184
|
+
allEntities.push({
|
|
185
|
+
entity: mainEntity,
|
|
186
|
+
parEntity: parentEntity,
|
|
187
|
+
parAlias: parentAlias,
|
|
188
|
+
alias: mainAlias,
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
const intermediateAlias = entities.shortCutOf.split(".");
|
|
193
|
+
for (let i = intermediateAlias.length - 1, x = 0; i >= 0; i--, x++) {
|
|
194
|
+
const intermediateEntity = this.getEntity(intermediateAlias.join("."));
|
|
195
|
+
intermediateAlias.pop();
|
|
196
|
+
if (intermediateEntity.ref.entity === parentEntity) {
|
|
197
|
+
break;
|
|
198
|
+
}
|
|
199
|
+
const parentIntermediateEntity = this.getEntity(intermediateAlias.join("."));
|
|
200
|
+
const alias = intermediateEntity.ref.entity.toLowerCase() + level + "_" + x;
|
|
201
|
+
const parAlias = parentIntermediateEntity.ref.entity === parentEntity
|
|
202
|
+
? parentAlias
|
|
203
|
+
: parentIntermediateEntity.ref.entity.toLowerCase() +
|
|
204
|
+
level +
|
|
205
|
+
"_" +
|
|
206
|
+
(x + 1);
|
|
207
|
+
if (x === 0) {
|
|
208
|
+
aliasMapping[currentAliasPath] = alias;
|
|
209
|
+
}
|
|
210
|
+
allEntities.unshift({
|
|
211
|
+
entity: intermediateEntity.ref.entity,
|
|
212
|
+
parEntity: parentIntermediateEntity.ref.entity,
|
|
213
|
+
parAlias,
|
|
214
|
+
alias,
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
let queryParts = [];
|
|
219
|
+
for (const join of allEntities) {
|
|
220
|
+
const { alias, entity, parEntity, parAlias } = join;
|
|
221
|
+
aliasMapping[currentAliasPath] = alias;
|
|
222
|
+
if (level > 0) {
|
|
223
|
+
const subQuery = this.knex.queryBuilder();
|
|
224
|
+
const knex = this.knex;
|
|
225
|
+
subQuery
|
|
226
|
+
.select(`${alias}.id`, `${alias}.data`)
|
|
227
|
+
.from("index_data AS " + alias)
|
|
228
|
+
.join(`index_relation AS ${alias}_ref`, function () {
|
|
229
|
+
this.on(`${alias}_ref.pivot`, "=", knex.raw("?", [`${parEntity}-${entity}`]))
|
|
230
|
+
.andOn(`${alias}_ref.parent_id`, "=", `${parAlias}.id`)
|
|
231
|
+
.andOn(`${alias}.id`, "=", `${alias}_ref.child_id`);
|
|
232
|
+
})
|
|
233
|
+
.where(`${alias}.name`, "=", knex.raw("?", [entity]));
|
|
234
|
+
const joinWhere = this.selector.joinWhere ?? {};
|
|
235
|
+
const joinKey = Object.keys(joinWhere).find((key) => {
|
|
236
|
+
const k = key.split(".");
|
|
237
|
+
k.pop();
|
|
238
|
+
return k.join(".") === currentAliasPath;
|
|
239
|
+
});
|
|
240
|
+
if (joinKey) {
|
|
241
|
+
this.parseWhere(aliasMapping, { [joinKey]: joinWhere[joinKey] }, subQuery);
|
|
242
|
+
}
|
|
243
|
+
queryParts.push(`LEFT JOIN LATERAL (
|
|
244
|
+
${subQuery.toQuery()}
|
|
245
|
+
) ${alias} ON TRUE`);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
const children = this.getStructureKeys(structure);
|
|
249
|
+
for (const child of children) {
|
|
250
|
+
const childStructure = structure[child];
|
|
251
|
+
queryParts = queryParts.concat(this.buildQueryParts(childStructure, mainAlias, mainEntity, child, aliasPath.concat(parentProperty), level + 1, aliasMapping));
|
|
252
|
+
}
|
|
253
|
+
return queryParts;
|
|
254
|
+
}
|
|
255
|
+
buildSelectParts(structure, parentProperty, aliasMapping, aliasPath = [], selectParts = {}) {
|
|
256
|
+
const currentAliasPath = [...aliasPath, parentProperty].join(".");
|
|
257
|
+
const alias = aliasMapping[currentAliasPath];
|
|
258
|
+
selectParts[currentAliasPath] = `${alias}.data`;
|
|
259
|
+
selectParts[currentAliasPath + ".id"] = `${alias}.id`;
|
|
260
|
+
const children = this.getStructureKeys(structure);
|
|
261
|
+
for (const child of children) {
|
|
262
|
+
const childStructure = structure[child];
|
|
263
|
+
this.buildSelectParts(childStructure, child, aliasMapping, aliasPath.concat(parentProperty), selectParts);
|
|
264
|
+
}
|
|
265
|
+
return selectParts;
|
|
266
|
+
}
|
|
267
|
+
transformOrderBy(arr) {
|
|
268
|
+
const result = {};
|
|
269
|
+
const map = new Map();
|
|
270
|
+
map.set(true, "ASC");
|
|
271
|
+
map.set(1, "ASC");
|
|
272
|
+
map.set("ASC", "ASC");
|
|
273
|
+
map.set(false, "DESC");
|
|
274
|
+
map.set(-1, "DESC");
|
|
275
|
+
map.set("DESC", "DESC");
|
|
276
|
+
function nested(obj, prefix = "") {
|
|
277
|
+
const keys = Object.keys(obj);
|
|
278
|
+
if (!keys.length) {
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
else if (keys.length > 1) {
|
|
282
|
+
throw new Error("Order by only supports one key per object.");
|
|
283
|
+
}
|
|
284
|
+
const key = keys[0];
|
|
285
|
+
let value = obj[key];
|
|
286
|
+
if ((0, utils_1.isObject)(value)) {
|
|
287
|
+
nested(value, prefix + key + ".");
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
if ((0, utils_1.isString)(value)) {
|
|
291
|
+
value = value.toUpperCase();
|
|
292
|
+
}
|
|
293
|
+
result[prefix + key] = map.get(value) ?? "ASC";
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
arr.forEach((obj) => nested(obj));
|
|
297
|
+
return result;
|
|
298
|
+
}
|
|
299
|
+
buildQuery(countAllResults = true, returnIdOnly = false) {
|
|
300
|
+
const queryBuilder = this.knex.queryBuilder();
|
|
301
|
+
const structure = this.structure;
|
|
302
|
+
const filter = this.selector.where ?? {};
|
|
303
|
+
const { orderBy: order, skip, take } = this.options ?? {};
|
|
304
|
+
const orderBy = this.transformOrderBy((order && !Array.isArray(order) ? [order] : order) ?? []);
|
|
305
|
+
const rootKey = this.getStructureKeys(structure)[0];
|
|
306
|
+
const rootStructure = structure[rootKey];
|
|
307
|
+
const entity = this.getEntity(rootKey).ref.entity;
|
|
308
|
+
const rootEntity = entity.toLowerCase();
|
|
309
|
+
const aliasMapping = {};
|
|
310
|
+
const joinParts = this.buildQueryParts(rootStructure, "", entity, rootKey, [], 0, aliasMapping);
|
|
311
|
+
const rootAlias = aliasMapping[rootKey];
|
|
312
|
+
const selectParts = !returnIdOnly
|
|
313
|
+
? this.buildSelectParts(rootStructure, rootKey, aliasMapping)
|
|
314
|
+
: { [rootKey + ".id"]: `${rootAlias}.id` };
|
|
315
|
+
if (countAllResults) {
|
|
316
|
+
selectParts["offset_"] = this.knex.raw(`DENSE_RANK() OVER (ORDER BY ${rootEntity}0.id)`);
|
|
317
|
+
}
|
|
318
|
+
queryBuilder.select(selectParts);
|
|
319
|
+
queryBuilder.from(`index_data AS ${rootEntity}0`);
|
|
320
|
+
joinParts.forEach((joinPart) => {
|
|
321
|
+
queryBuilder.joinRaw(joinPart);
|
|
322
|
+
});
|
|
323
|
+
queryBuilder.where(`${aliasMapping[rootEntity]}.name`, "=", entity);
|
|
324
|
+
// WHERE clause
|
|
325
|
+
this.parseWhere(aliasMapping, filter, queryBuilder);
|
|
326
|
+
// ORDER BY clause
|
|
327
|
+
for (const aliasPath in orderBy) {
|
|
328
|
+
const path = aliasPath.split(".");
|
|
329
|
+
const field = path.pop();
|
|
330
|
+
const attr = path.join(".");
|
|
331
|
+
const alias = aliasMapping[attr];
|
|
332
|
+
const direction = orderBy[aliasPath];
|
|
333
|
+
queryBuilder.orderByRaw(`${alias}.data->>'${field}' ${direction}`);
|
|
334
|
+
}
|
|
335
|
+
let sql = `WITH data AS (${queryBuilder.toQuery()})
|
|
336
|
+
SELECT * ${countAllResults ? ", (SELECT max(offset_) FROM data) AS count" : ""}
|
|
337
|
+
FROM data`;
|
|
338
|
+
let take_ = !isNaN(+take) ? +take : 15;
|
|
339
|
+
let skip_ = !isNaN(+skip) ? +skip : 0;
|
|
340
|
+
if (typeof take === "number" || typeof skip === "number") {
|
|
341
|
+
sql += `
|
|
342
|
+
WHERE offset_ > ${skip_}
|
|
343
|
+
AND offset_ <= ${skip_ + take_}
|
|
344
|
+
`;
|
|
345
|
+
}
|
|
346
|
+
return sql;
|
|
347
|
+
}
|
|
348
|
+
buildObjectFromResultset(resultSet) {
|
|
349
|
+
const structure = this.structure;
|
|
350
|
+
const rootKey = this.getStructureKeys(structure)[0];
|
|
351
|
+
const maps = {};
|
|
352
|
+
const isListMap = {};
|
|
353
|
+
const referenceMap = {};
|
|
354
|
+
const pathDetails = {};
|
|
355
|
+
const initializeMaps = (structure, path) => {
|
|
356
|
+
const currentPath = path.join(".");
|
|
357
|
+
maps[currentPath] = {};
|
|
358
|
+
if (path.length > 1) {
|
|
359
|
+
const property = path[path.length - 1];
|
|
360
|
+
const parents = path.slice(0, -1);
|
|
361
|
+
const parentPath = parents.join(".");
|
|
362
|
+
isListMap[currentPath] = !!this.getEntity(currentPath).ref.parents.find((p) => p.targetProp === property)?.isList;
|
|
363
|
+
pathDetails[currentPath] = { property, parents, parentPath };
|
|
364
|
+
}
|
|
365
|
+
const children = this.getStructureKeys(structure);
|
|
366
|
+
for (const key of children) {
|
|
367
|
+
initializeMaps(structure[key], [...path, key]);
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
initializeMaps(structure[rootKey], [rootKey]);
|
|
371
|
+
function buildReferenceKey(path, id, row) {
|
|
372
|
+
let current = "";
|
|
373
|
+
let key = "";
|
|
374
|
+
for (const p of path) {
|
|
375
|
+
current += `${p}`;
|
|
376
|
+
key += row[`${current}.id`] + ".";
|
|
377
|
+
current += ".";
|
|
378
|
+
}
|
|
379
|
+
return key + id;
|
|
380
|
+
}
|
|
381
|
+
resultSet.forEach((row) => {
|
|
382
|
+
for (const path in maps) {
|
|
383
|
+
const id = row[`${path}.id`];
|
|
384
|
+
// root level
|
|
385
|
+
if (!pathDetails[path]) {
|
|
386
|
+
if (!maps[path][id]) {
|
|
387
|
+
maps[path][id] = row[path] || undefined;
|
|
388
|
+
}
|
|
389
|
+
continue;
|
|
390
|
+
}
|
|
391
|
+
const { property, parents, parentPath } = pathDetails[path];
|
|
392
|
+
const referenceKey = buildReferenceKey(parents, id, row);
|
|
393
|
+
if (referenceMap[referenceKey]) {
|
|
394
|
+
continue;
|
|
395
|
+
}
|
|
396
|
+
maps[path][id] = row[path] || undefined;
|
|
397
|
+
const parentObj = maps[parentPath][row[`${parentPath}.id`]];
|
|
398
|
+
if (!parentObj) {
|
|
399
|
+
continue;
|
|
400
|
+
}
|
|
401
|
+
const isList = isListMap[parentPath + "." + property];
|
|
402
|
+
if (isList) {
|
|
403
|
+
parentObj[property] ??= [];
|
|
404
|
+
}
|
|
405
|
+
if (maps[path][id] !== undefined) {
|
|
406
|
+
if (isList) {
|
|
407
|
+
parentObj[property].push(maps[path][id]);
|
|
408
|
+
}
|
|
409
|
+
else {
|
|
410
|
+
parentObj[property] = maps[path][id];
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
referenceMap[referenceKey] = true;
|
|
414
|
+
}
|
|
415
|
+
});
|
|
416
|
+
return Object.values(maps[rootKey] ?? {});
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
exports.QueryBuilder = QueryBuilder;
|
|
420
|
+
//# sourceMappingURL=query-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-builder.js","sourceRoot":"","sources":["../../src/utils/query-builder.ts"],"names":[],"mappings":";;;AAGA,kDAAyE;AAE5D,QAAA,YAAY,GAAG;IAC1B,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;IACV,GAAG,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AAG,QAAQ,CAAC,CAAA;gBACrD,IAAI,MAAM,EAAE,CAAC;oBACX,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAA;gBAC5B,CAAC;gBAED,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,SAAS,EAAE,CAAC;oBACjC,IAAI,MAAM,EAAE,CAAC;wBACX,SAAS,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;oBAC1C,CAAC;yBAAM,CAAC;wBACN,SAAS,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAA;oBACtC,CAAC;gBACH,CAAC;gBAED,YAAY,CAAC,YAAY,CAAC,GAAG,IAAI,CAAA;YACnC,CAAC;QACH,CAAC,CAAC,CAAA;QAEF,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAA;IAC3C,CAAC;CACF;AAzlBD,oCAylBC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@etohq/index",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Eto Index module",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"!dist/**/__tests__",
|
|
10
|
+
"!dist/**/__mocks__",
|
|
11
|
+
"!dist/**/__fixtures__"
|
|
12
|
+
],
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=20"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/etohq/eto",
|
|
19
|
+
"directory": "packages/index"
|
|
20
|
+
},
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"author": "Eto",
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"scripts": {
|
|
27
|
+
"watch": "tsc --build --watch",
|
|
28
|
+
"watch:test": "tsc --build tsconfig.spec.json --watch",
|
|
29
|
+
"resolve:aliases": "tsc --showConfig -p tsconfig.json > tsconfig.resolved.json && tsc-alias -p tsconfig.resolved.json && rimraf tsconfig.resolved.json", "build": "rimraf dist && tsc --build && npm run resolve:aliases",
|
|
30
|
+
"test": "jest --passWithNoTests ./src",
|
|
31
|
+
"test:integration": "jest --runInBand --forceExit -- integration-tests/**/__tests__/**/*.ts",
|
|
32
|
+
"migration:initial": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts eto-mikro-orm migration:create --initial",
|
|
33
|
+
"migration:create": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts eto-mikro-orm migration:create",
|
|
34
|
+
"migration:up": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts eto-mikro-orm migration:up",
|
|
35
|
+
"orm:cache:clear": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts eto-mikro-orm cache:clear"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@etohq/framework": "^1.0.0",
|
|
39
|
+
"@etohq/test-utils": "^1.0.0",
|
|
40
|
+
"@mikro-orm/cli": "5.9.7",
|
|
41
|
+
"@mikro-orm/core": "5.9.7",
|
|
42
|
+
"@mikro-orm/knex": "5.9.7",
|
|
43
|
+
"@mikro-orm/migrations": "5.9.7",
|
|
44
|
+
"@mikro-orm/postgresql": "5.9.7",
|
|
45
|
+
"@swc/core": "^1.7.28",
|
|
46
|
+
"@swc/jest": "^0.2.36",
|
|
47
|
+
"@types/jest": "^29.5.14",
|
|
48
|
+
"jest": "^29.7.0",
|
|
49
|
+
"rimraf": "^5.0.2",
|
|
50
|
+
"tsc-alias": "^1.8.6",
|
|
51
|
+
"typescript": "^5.6.2"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@etohq/utils": "^1.0.0",
|
|
55
|
+
"awilix": "^8.0.1"
|
|
56
|
+
},
|
|
57
|
+
"peerDependencies": {
|
|
58
|
+
"@etohq/framework": "^1.0.0",
|
|
59
|
+
"@mikro-orm/core": "5.9.7",
|
|
60
|
+
"@mikro-orm/knex": "5.9.7",
|
|
61
|
+
"@mikro-orm/migrations": "5.9.7",
|
|
62
|
+
"@mikro-orm/postgresql": "5.9.7",
|
|
63
|
+
"awilix": "^8.0.1"
|
|
64
|
+
}
|
|
65
|
+
}
|