@ronin/compiler 0.17.11 → 0.17.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.
Files changed (2) hide show
  1. package/dist/index.js +8 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2124,7 +2124,6 @@ var Transaction = class {
2124
2124
  );
2125
2125
  });
2126
2126
  }
2127
- this.#internalQueries[index].models = modelList;
2128
2127
  return modelList.map((model) => {
2129
2128
  const instructions = Object.assign(
2130
2129
  {},
@@ -2151,10 +2150,8 @@ var Transaction = class {
2151
2150
  const postDependencies = dependencies.map(({ after, ...rest }) => after ? rest : null).filter((item) => item != null);
2152
2151
  const subStatements = [...preDependencies, main, ...postDependencies];
2153
2152
  this.statements.push(...subStatements);
2154
- this.#internalQueries[index].selectedFields = selectedFields;
2155
- if (this.#internalQueries[index].models.length === 0) {
2156
- this.#internalQueries[index].models = [model];
2157
- }
2153
+ this.#internalQueries[index].selectedFields.push(selectedFields);
2154
+ this.#internalQueries[index].models.push(model);
2158
2155
  }
2159
2156
  this.models = modelsWithPresets;
2160
2157
  return statements;
@@ -2319,7 +2316,9 @@ var Transaction = class {
2319
2316
  if (queryModel === "all") {
2320
2317
  const models = {};
2321
2318
  const { on: onInstruction, ...restInstructions } = queryInstructions || {};
2322
- for (const model of affectedModels) {
2319
+ for (let index = 0; index < affectedModels.length; index++) {
2320
+ const model = affectedModels[index];
2321
+ const fields = selectedFields[index];
2323
2322
  const instructions = Object.assign(
2324
2323
  {},
2325
2324
  restInstructions,
@@ -2330,7 +2329,7 @@ var Transaction = class {
2330
2329
  instructions,
2331
2330
  model,
2332
2331
  absoluteResults[resultIndex++],
2333
- selectedFields,
2332
+ fields,
2334
2333
  false
2335
2334
  );
2336
2335
  models[model.pluralSlug] = result;
@@ -2338,12 +2337,13 @@ var Transaction = class {
2338
2337
  finalResults.push({ models });
2339
2338
  } else {
2340
2339
  const model = affectedModels[0];
2340
+ const fields = selectedFields[0];
2341
2341
  const result = this.formatIndividualResult(
2342
2342
  queryType,
2343
2343
  queryInstructions,
2344
2344
  model,
2345
2345
  absoluteResults[resultIndex++],
2346
- selectedFields,
2346
+ fields,
2347
2347
  queryModel !== model.pluralSlug
2348
2348
  );
2349
2349
  finalResults.push(result);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ronin/compiler",
3
- "version": "0.17.11",
3
+ "version": "0.17.12",
4
4
  "type": "module",
5
5
  "description": "Compiles RONIN queries to SQL statements.",
6
6
  "publishConfig": {