@ronin/compiler 0.12.6 → 0.12.7

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 +5 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -162,8 +162,8 @@ var splitQuery = (query) => {
162
162
  var prepareStatementValue = (statementParams, value) => {
163
163
  if (value === null) return "NULL";
164
164
  if (!statementParams) {
165
- const valueString = typeof value === "object" ? JSON.stringify(value) : value.toString();
166
- return `'${valueString}'`;
165
+ const valueString = typeof value === "object" ? `json('${JSON.stringify(value)}')` : `'${value.toString()}'`;
166
+ return valueString;
167
167
  }
168
168
  let formattedValue = value;
169
169
  if (Array.isArray(value) || isObject(value)) {
@@ -910,9 +910,9 @@ var transformMetaQuery = (models, dependencyStatements, statementParams, query)
910
910
  parentModel: existingModel
911
911
  }).main.statement;
912
912
  });
913
- if (effectStatements.length > 1) statementParts.push("BEGIN");
914
- statementParts.push(effectStatements.join("; "));
915
- if (effectStatements.length > 1) statementParts.push("END");
913
+ statementParts.push("BEGIN");
914
+ statementParts.push(`${effectStatements.join("; ")};`);
915
+ statementParts.push("END");
916
916
  statement += ` ${statementParts.join(" ")}`;
917
917
  }
918
918
  dependencyStatements.push({ statement, params });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ronin/compiler",
3
- "version": "0.12.6",
3
+ "version": "0.12.7",
4
4
  "type": "module",
5
5
  "description": "Compiles RONIN queries to SQL statements.",
6
6
  "publishConfig": {