@ronin/compiler 0.10.1-leo-ron-1083-experimental-209 → 0.10.1-leo-ron-1083-experimental-210

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/dist/index.js +4 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1538,8 +1538,11 @@ var Transaction = class {
1538
1538
  });
1539
1539
  return relevantResults.map((result, index) => {
1540
1540
  const query = this.queries.at(-index);
1541
- const { queryModel, queryInstructions } = splitQuery(query);
1541
+ const { queryType, queryModel, queryInstructions } = splitQuery(query);
1542
1542
  const model = getModelBySlug(this.models, queryModel);
1543
+ if (queryType === "count") {
1544
+ return { amount: result[0]["COUNT(*)"] };
1545
+ }
1543
1546
  const single = queryModel !== model.pluralSlug;
1544
1547
  if (single) {
1545
1548
  return { record: this.formatRecord(model, result[0]) };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ronin/compiler",
3
- "version": "0.10.1-leo-ron-1083-experimental-209",
3
+ "version": "0.10.1-leo-ron-1083-experimental-210",
4
4
  "type": "module",
5
5
  "description": "Compiles RONIN queries to SQL statements.",
6
6
  "publishConfig": {