rado 0.2.39 → 0.2.40

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.
@@ -440,7 +440,7 @@ class Formatter {
440
440
  const { stmt } = ctx;
441
441
  if (!groupBy)
442
442
  return stmt;
443
- stmt.addLine("GROUP BY");
443
+ stmt.addLine("GROUP BY").space();
444
444
  for (const expr of stmt.separate(groupBy))
445
445
  this.formatExprValue(ctx, expr);
446
446
  return stmt;
@@ -170,9 +170,12 @@ class Statement {
170
170
  return this.sql.replace(/\?/g, () => {
171
171
  const param = this.paramData[index];
172
172
  index++;
173
- if (param.type === ParamType.Named)
174
- throw new TypeError(`Missing parameter ${param.name}`);
175
- return this.sanitizer.escapeValue(param.value);
173
+ switch (param.type) {
174
+ case ParamType.Named:
175
+ return `?${param.name}`;
176
+ case ParamType.Value:
177
+ return this.sanitizer.escapeValue(param.value);
178
+ }
176
179
  });
177
180
  }
178
181
  toString() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rado",
3
- "version": "0.2.39",
3
+ "version": "0.2.40",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",