@mikro-orm/sql
Advanced tools
@@ -606,3 +606,4 @@ import { DeferMode, EnumType, Type, Utils, } from '@mikro-orm/core'; | ||
| const def = p.defaultRaw ? ` default ${p.defaultRaw}` : ''; | ||
| return `${dir}${this.platform.quoteIdentifier(p.name)} ${p.type}${def}`; | ||
| const name = p.name ? `${this.platform.quoteIdentifier(p.name)} ` : ''; | ||
| return `${dir}${name}${p.type}${def}`; | ||
| }) | ||
@@ -618,4 +619,5 @@ .join(', '); | ||
| // INOUT before IN/OUT, with required trailing space so identifiers like `input` aren't | ||
| // mis-parsed as a direction keyword. | ||
| const match = /^(?:(INOUT|VARIADIC|IN|OUT)\s+)?(?:"((?:[^"]|"")+)"|([\w$]+))\s+(.+?)(?:\s+default\s+.+)?$/i.exec(trimmed); | ||
| // mis-parsed as a direction keyword. The name is optional — `pg_get_function_arguments` | ||
| // omits it for unnamed parameters (e.g. `text`), leaving just the type. | ||
| const match = /^(?:(INOUT|VARIADIC|IN|OUT)\s+)?(?:(?:"((?:[^"]|"")+)"|([\w$]+))\s+)?(.+?)(?:\s+default\s+.+)?$/i.exec(trimmed); | ||
| /* v8 ignore next 3: defensive guard for unexpected `pg_get_function_arguments` output shapes */ | ||
@@ -627,3 +629,3 @@ if (!match) { | ||
| const direction = dirRaw === 'inout' ? 'inout' : dirRaw === 'out' ? 'out' : 'in'; | ||
| const name = match[2] != null ? match[2].replaceAll('""', '"') : match[3]; | ||
| const name = match[2] != null ? match[2].replaceAll('""', '"') : (match[3] ?? ''); | ||
| return { | ||
@@ -630,0 +632,0 @@ name, |
+2
-2
| { | ||
| "name": "@mikro-orm/sql", | ||
| "version": "7.1.5-dev.23", | ||
| "version": "7.1.5-dev.24", | ||
| "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.", | ||
@@ -56,3 +56,3 @@ "keywords": [ | ||
| "peerDependencies": { | ||
| "@mikro-orm/core": "7.1.5-dev.23" | ||
| "@mikro-orm/core": "7.1.5-dev.24" | ||
| }, | ||
@@ -59,0 +59,0 @@ "engines": { |
1048799
0.02%21959
0.01%