@ronin/compiler 0.11.0-leo-ron-1083-experimental-228 → 0.11.1-leo-ron-1083-experimental-229
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/dist/index.js +6 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -20,6 +20,7 @@ var RONIN_MODEL_FIELD_REGEX = new RegExp(
|
|
20
20
|
`${QUERY_SYMBOLS.FIELD}[_a-zA-Z0-9.]+`,
|
21
21
|
"g"
|
22
22
|
);
|
23
|
+
var RAW_FIELD_TYPES = ["string", "number", "boolean"];
|
23
24
|
var composeIncludedTableAlias = (fieldSlug) => `including_${fieldSlug}`;
|
24
25
|
var MODEL_ENTITY_ERROR_CODES = {
|
25
26
|
field: "FIELD_NOT_FOUND",
|
@@ -1152,9 +1153,6 @@ var handleIncluding = (models, model, statementParams, instruction) => {
|
|
1152
1153
|
statement += `${joinType} JOIN ${relatedTableSelector} as ${tableAlias}`;
|
1153
1154
|
model.tableAlias = model.tableAlias || model.table;
|
1154
1155
|
if (joinType === "LEFT") {
|
1155
|
-
if (!single) {
|
1156
|
-
tableSubQuery = `SELECT * FROM "${model.table}" LIMIT 1`;
|
1157
|
-
}
|
1158
1156
|
const subStatement = composeConditions(
|
1159
1157
|
models,
|
1160
1158
|
{ ...relatedModel, tableAlias },
|
@@ -1167,6 +1165,7 @@ var handleIncluding = (models, model, statementParams, instruction) => {
|
|
1167
1165
|
);
|
1168
1166
|
statement += ` ON (${subStatement})`;
|
1169
1167
|
}
|
1168
|
+
if (!single) tableSubQuery = `SELECT * FROM "${model.table}" LIMIT 1`;
|
1170
1169
|
}
|
1171
1170
|
return { statement, tableSubQuery };
|
1172
1171
|
};
|
@@ -1249,6 +1248,10 @@ var handleSelecting = (models, model, statementParams, instructions, options) =>
|
|
1249
1248
|
newValue = prepareStatementValue(statementParams, value);
|
1250
1249
|
}
|
1251
1250
|
instructions.including[key] = newValue;
|
1251
|
+
loadedFields.push({
|
1252
|
+
slug: key,
|
1253
|
+
type: RAW_FIELD_TYPES.includes(typeof value) ? typeof value : "string"
|
1254
|
+
});
|
1252
1255
|
}
|
1253
1256
|
}
|
1254
1257
|
const expandColumns = isJoining && options?.expandColumns;
|
package/package.json
CHANGED