@mikro-orm/sql
Advanced tools
@@ -38,7 +38,5 @@ import { type SimpleColumnMeta, type Type, type TransformContext, type MikroORM, type IsolationLevel } from '@mikro-orm/core'; | ||
| supportsUnsigned(): boolean; | ||
| /** | ||
| * Returns the default name of index for the given columns | ||
| * cannot go past 64 character length for identifiers in MySQL | ||
| */ | ||
| getIndexName(tableName: string, columns: string[], type: 'index' | 'unique' | 'foreign' | 'primary' | 'sequence'): string; | ||
| /** MySQL/MariaDB identifier limit. */ | ||
| getMaxIdentifierLength(): number; | ||
| getIndexName(tableName: string, columns: string[], type: 'index' | 'unique' | 'foreign' | 'primary' | 'sequence' | 'check'): string; | ||
| getDefaultPrimaryName(tableName: string, columns: string[]): string; | ||
@@ -45,0 +43,0 @@ supportsCreatingFullTextIndex(): boolean; |
@@ -1,2 +0,2 @@ | ||
| import { Utils, QueryOrder, DecimalType, DoubleType, } from '@mikro-orm/core'; | ||
| import { QueryOrder, DecimalType, DoubleType, } from '@mikro-orm/core'; | ||
| import { MySqlSchemaHelper } from './MySqlSchemaHelper.js'; | ||
@@ -89,6 +89,6 @@ import { MySqlExceptionConverter } from './MySqlExceptionConverter.js'; | ||
| } | ||
| /** | ||
| * Returns the default name of index for the given columns | ||
| * cannot go past 64 character length for identifiers in MySQL | ||
| */ | ||
| /** MySQL/MariaDB identifier limit. */ | ||
| getMaxIdentifierLength() { | ||
| return 64; | ||
| } | ||
| getIndexName(tableName, columns, type) { | ||
@@ -98,7 +98,3 @@ if (type === 'primary') { | ||
| } | ||
| const indexName = super.getIndexName(tableName, columns, type); | ||
| if (indexName.length > 64) { | ||
| return `${indexName.substring(0, 56 - type.length)}_${Utils.hash(indexName, 5)}_${type}`; | ||
| } | ||
| return indexName; | ||
| return super.getIndexName(tableName, columns, type); | ||
| } | ||
@@ -105,0 +101,0 @@ getDefaultPrimaryName(tableName, columns) { |
@@ -103,7 +103,4 @@ import { type EntityProperty, type IsolationLevel, RawQueryFragment, type SimpleColumnMeta, Type } from '@mikro-orm/core'; | ||
| getDefaultSchemaName(): string | undefined; | ||
| /** | ||
| * Returns the default name of index for the given columns | ||
| * cannot go past 63 character length for identifiers in MySQL | ||
| */ | ||
| getIndexName(tableName: string, columns: string[], type: 'index' | 'unique' | 'foreign' | 'primary' | 'sequence'): string; | ||
| /** Postgres identifier limit (NAMEDATALEN - 1). */ | ||
| getMaxIdentifierLength(): number; | ||
| getDefaultPrimaryName(tableName: string, columns: string[]): string; | ||
@@ -110,0 +107,0 @@ /** |
@@ -386,13 +386,5 @@ import { ALIAS_REPLACEMENT, ARRAY_OPERATORS, raw, RawQueryFragment, Type, Utils, } from '@mikro-orm/core'; | ||
| } | ||
| /** | ||
| * Returns the default name of index for the given columns | ||
| * cannot go past 63 character length for identifiers in MySQL | ||
| */ | ||
| getIndexName(tableName, columns, type) { | ||
| const indexName = super.getIndexName(tableName, columns, type); | ||
| if (indexName.length > 63) { | ||
| const suffix = type === 'primary' ? 'pkey' : type; | ||
| return `${indexName.substring(0, 55 - type.length)}_${Utils.hash(indexName, 5)}_${suffix}`; | ||
| } | ||
| return indexName; | ||
| /** Postgres identifier limit (NAMEDATALEN - 1). */ | ||
| getMaxIdentifierLength() { | ||
| return 63; | ||
| } | ||
@@ -399,0 +391,0 @@ getDefaultPrimaryName(tableName, columns) { |
@@ -66,3 +66,3 @@ import { type EntityProperty, type IsolationLevel } from '@mikro-orm/core'; | ||
| processDateProperty(value: unknown): string | number | Date; | ||
| getIndexName(tableName: string, columns: string[], type: 'index' | 'unique' | 'foreign' | 'primary' | 'sequence'): string; | ||
| getIndexName(tableName: string, columns: string[], type: 'index' | 'unique' | 'foreign' | 'primary' | 'sequence' | 'check'): string; | ||
| supportsDeferredUniqueConstraints(): boolean; | ||
@@ -69,0 +69,0 @@ /** |
+2
-2
| { | ||
| "name": "@mikro-orm/sql", | ||
| "version": "7.1.0-dev.35", | ||
| "version": "7.1.0-dev.36", | ||
| "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.0-dev.35" | ||
| "@mikro-orm/core": "7.1.0-dev.36" | ||
| }, | ||
@@ -59,0 +59,0 @@ "engines": { |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
142
-0.7%997396
-0.09%20995
-0.08%