@mikro-orm/sql
Advanced tools
@@ -129,2 +129,7 @@ import { ALIAS_REPLACEMENT, ARRAY_OPERATORS, raw, RawQueryFragment, Type, Utils, } from '@mikro-orm/core'; | ||
| } | ||
| // postgis reports the typmod without spaces (`geometry(point,4326)`) — collapse any | ||
| // user-supplied spacing so the metadata and introspection forms compare equal | ||
| if (['geometry', 'geography'].includes(simpleType)) { | ||
| return type.toLowerCase().replace(/\s+/g, ''); | ||
| } | ||
| // TimeType.getColumnType drops the timezone qualifier, so detect tz aliases from the original column type. | ||
@@ -131,0 +136,0 @@ const originalType = options.columnTypes?.[0]?.toLowerCase() ?? type; |
@@ -373,2 +373,3 @@ import { DeferMode, EnumType, Type, Utils, } from '@mikro-orm/core'; | ||
| udt_schema, | ||
| pg_catalog.format_type(pga.atttypid, pga.atttypmod) format_type, | ||
| coalesce(datetime_precision, character_maximum_length) length, | ||
@@ -408,2 +409,7 @@ atttypmod custom_length, | ||
| } | ||
| // postgis stores the geometry/geography typmod (`geometry(point,4326)`) in atttypmod, which | ||
| // information_schema does not expose — recover the full type via format_type so it round-trips | ||
| if ((col.udt_name === 'geometry' || col.udt_name === 'geography') && col.format_type) { | ||
| type = col.format_type; | ||
| } | ||
| if (type === 'vector' && col.length == null && col.custom_length != null && col.custom_length !== -1) { | ||
@@ -410,0 +416,0 @@ col.length = col.custom_length; |
+2
-2
| { | ||
| "name": "@mikro-orm/sql", | ||
| "version": "7.1.2-dev.13", | ||
| "version": "7.1.2-dev.14", | ||
| "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.2-dev.13" | ||
| "@mikro-orm/core": "7.1.2-dev.14" | ||
| }, | ||
@@ -59,0 +59,0 @@ "engines": { |
@@ -236,3 +236,5 @@ import { ReferenceKind, isRaw, } from '@mikro-orm/core'; | ||
| table.addCheck({ | ||
| name: check.name, | ||
| // the engine truncates identifiers past its limit (postgres 63 bytes) on storage, so | ||
| // mirror that here — otherwise the introspected (truncated) name never matches metadata | ||
| name: check.name.substring(0, platform.getMaxIdentifierLength()), | ||
| expression, | ||
@@ -239,0 +241,0 @@ definition: `check (${expression})`, |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
1036723
0.1%21767
0.06%