You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@mikro-orm/sql

Package Overview
Dependencies
Maintainers
1
Versions
272
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mikro-orm/sql - npm Package Compare versions

Comparing version
7.0.0-dev.222
to
7.0.0-dev.223
+2
-1
dialects/mysql/BaseMySqlPlatform.d.ts

@@ -1,2 +0,2 @@

import { type SimpleColumnMeta, type Type, type TransformContext, type IsolationLevel } from '@mikro-orm/core';
import { type SimpleColumnMeta, type Type, type TransformContext, type MikroORM, type IsolationLevel } from '@mikro-orm/core';
import { MySqlSchemaHelper } from './MySqlSchemaHelper.js';

@@ -19,2 +19,3 @@ import { MySqlExceptionConverter } from './MySqlExceptionConverter.js';

getDefaultCharset(): string;
init(orm: MikroORM): void;
getBeginTransactionSQL(options?: {

@@ -21,0 +22,0 @@ isolationLevel?: IsolationLevel;

@@ -22,2 +22,6 @@ import { Utils, QueryOrder, DecimalType, DoubleType, } from '@mikro-orm/core';

}
init(orm) {
super.init(orm);
orm.config.get('schemaGenerator').disableForeignKeysForClear ??= true;
}
getBeginTransactionSQL(options) {

@@ -24,0 +28,0 @@ if (options?.isolationLevel || options?.readOnly) {

{
"name": "@mikro-orm/sql",
"version": "7.0.0-dev.222",
"version": "7.0.0-dev.223",
"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.",

@@ -59,4 +59,4 @@ "type": "module",

"peerDependencies": {
"@mikro-orm/core": "7.0.0-dev.222"
"@mikro-orm/core": "7.0.0-dev.223"
}
}

@@ -67,2 +67,3 @@ import { type Connection, type Dictionary, RawQueryFragment } from '@mikro-orm/core';

disableForeignKeys?: boolean;
disableForeignKeysForClear?: boolean;
createForeignKeyConstraints?: boolean;

@@ -69,0 +70,0 @@ ignoreSchema?: string[];

@@ -9,2 +9,3 @@ import { AbstractSchemaGenerator, type ClearDatabaseOptions, type CreateSchemaOptions, type Dictionary, type DropSchemaOptions, type EnsureDatabaseOptions, type EntityMetadata, type ISchemaGenerator, type MikroORM, type Transaction, type UpdateSchemaOptions } from '@mikro-orm/core';

disableForeignKeys?: boolean;
disableForeignKeysForClear?: boolean;
createForeignKeyConstraints?: boolean;

@@ -11,0 +12,0 @@ ignoreSchema?: string[];

@@ -125,3 +125,5 @@ import { AbstractSchemaGenerator, CommitOrderCalculator, Utils, } from '@mikro-orm/core';

}
await this.execute(this.helper.disableForeignKeysSQL());
if (this.options.disableForeignKeysForClear) {
await this.execute(this.helper.disableForeignKeysSQL());
}
const schema = options?.schema ?? this.config.get('schema', this.platform.getDefaultSchemaName());

@@ -134,3 +136,5 @@ for (const meta of this.getOrderedMetadata(schema).reverse()) {

}
await this.execute(this.helper.enableForeignKeysSQL());
if (this.options.disableForeignKeysForClear) {
await this.execute(this.helper.enableForeignKeysSQL());
}
if (options?.clearIdentityMap ?? true) {

@@ -137,0 +141,0 @@ this.clearIdentityMap();

Sorry, the diff of this file is not supported yet