@mikro-orm/sql 7.2.10-dev.21 → 7.2.10-dev.22

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.
@@ -231,8 +231,9 @@ export class BasePostgreSqlPlatform extends AbstractSqlPlatform {
231
231
  return ['begin'];
232
232
  }
233
233
  marshallArray(values) {
234
- const quote = (v) => (v === '' || /["{},\\]/.exec(v) ? JSON.stringify(v) : v);
235
- return `{${values.map(v => quote('' + v)).join(',')}}`;
234
+ // Quote what Postgres would read differently unquoted: empty, `NULL`, delimiters and surrounding whitespace.
235
+ const quote = (v) => v === '' || /^null$/i.test(v) || /["{},\\]|^\s|\s$/.test(v) ? `"${v.replace(/["\\]/g, '\\$&')}"` : v;
236
+ return `{${values.map(v => (v === null ? 'NULL' : quote('' + v))).join(',')}}`;
236
237
  }
237
238
  /* v8 ignore next */
238
239
  unmarshallArray(value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/sql",
3
- "version": "7.2.10-dev.21",
3
+ "version": "7.2.10-dev.22",
4
4
  "description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
5
5
  "keywords": [
6
6
  "data-mapper",
@@ -53,7 +53,7 @@
53
53
  "@mikro-orm/core": "^7.2.9"
54
54
  },
55
55
  "peerDependencies": {
56
- "@mikro-orm/core": "7.2.10-dev.21"
56
+ "@mikro-orm/core": "7.2.10-dev.22"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">= 22.17.0"