@mikro-orm/sql 7.1.5-dev.23 → 7.1.5-dev.25
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.
|
@@ -603,7 +603,8 @@ export class PostgreSqlSchemaHelper extends SchemaHelper {
|
|
|
603
603
|
.map(p => {
|
|
604
604
|
const dir = p.direction === 'in' ? '' : `${p.direction.toUpperCase()} `;
|
|
605
605
|
const def = p.defaultRaw ? ` default ${p.defaultRaw}` : '';
|
|
606
|
-
|
|
606
|
+
const name = p.name ? `${this.platform.quoteIdentifier(p.name)} ` : '';
|
|
607
|
+
return `${dir}${name}${p.type}${def}`;
|
|
607
608
|
})
|
|
608
609
|
.join(', ');
|
|
609
610
|
}
|
|
@@ -614,15 +615,16 @@ export class PostgreSqlSchemaHelper extends SchemaHelper {
|
|
|
614
615
|
return signature.split(/,(?![^()]*\))/).map(part => {
|
|
615
616
|
const trimmed = part.trim();
|
|
616
617
|
// INOUT before IN/OUT, with required trailing space so identifiers like `input` aren't
|
|
617
|
-
// mis-parsed as a direction keyword.
|
|
618
|
-
|
|
618
|
+
// mis-parsed as a direction keyword. The name is optional — `pg_get_function_arguments`
|
|
619
|
+
// omits it for unnamed parameters (e.g. `text`), leaving just the type.
|
|
620
|
+
const match = /^(?:(INOUT|VARIADIC|IN|OUT)\s+)?(?:(?:"((?:[^"]|"")+)"|([\w$]+))\s+)?(.+?)(?:\s+default\s+.+)?$/i.exec(trimmed);
|
|
619
621
|
/* v8 ignore next 3: defensive guard for unexpected `pg_get_function_arguments` output shapes */
|
|
620
622
|
if (!match) {
|
|
621
623
|
throw new Error(`Could not parse PostgreSQL routine parameter signature: ${JSON.stringify(trimmed)}`);
|
|
622
624
|
}
|
|
623
625
|
const dirRaw = (match[1] ?? 'in').toLowerCase();
|
|
624
626
|
const direction = dirRaw === 'inout' ? 'inout' : dirRaw === 'out' ? 'out' : 'in';
|
|
625
|
-
const name = match[2] != null ? match[2].replaceAll('""', '"') : match[3];
|
|
627
|
+
const name = match[2] != null ? match[2].replaceAll('""', '"') : (match[3] ?? '');
|
|
626
628
|
return {
|
|
627
629
|
name,
|
|
628
630
|
type: match[4].trim(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/sql",
|
|
3
|
-
"version": "7.1.5-dev.
|
|
3
|
+
"version": "7.1.5-dev.25",
|
|
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.1.4"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@mikro-orm/core": "7.1.5-dev.
|
|
56
|
+
"@mikro-orm/core": "7.1.5-dev.25"
|
|
57
57
|
},
|
|
58
58
|
"engines": {
|
|
59
59
|
"node": ">= 22.17.0"
|