Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mikro-orm/core

Package Overview
Dependencies
Maintainers
1
Versions
3197
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mikro-orm/core - npm Package Compare versions

Comparing version 6.3.14-dev.52 to 6.3.14-dev.53

2

decorators/ManyToOne.d.ts

@@ -18,2 +18,4 @@ import type { ReferenceOptions } from './Property';

joinColumns?: string[];
/** When a part of a composite column is shared in other properties, use this option to specify what columns are considered as owned by this property. This is useful when your composite property is nullable, but parts of it are not. */
ownColumns?: string[];
/** Override the default database column name on the target entity (see {@doclink naming-strategy | Naming Strategy}). This option is only for simple properties represented by a single column. */

@@ -20,0 +22,0 @@ referenceColumnName?: string;

2

drivers/DatabaseDriver.js

@@ -226,3 +226,3 @@ "use strict";

delete data[k];
prop.joinColumns.forEach((joinColumn, idx) => data[joinColumn] = null);
prop.ownColumns.forEach(joinColumn => data[joinColumn] = null);
return;

@@ -229,0 +229,0 @@ }

@@ -34,2 +34,3 @@ import { type Constructor, EntityMetadata } from '../typings';

private applyNamingStrategy;
private initOwnColumns;
private initFieldName;

@@ -36,0 +37,0 @@ private initManyToOneFieldName;

@@ -364,2 +364,18 @@ "use strict";

}
initOwnColumns(meta) {
meta.sync();
for (const prop of meta.props) {
if (!prop.joinColumns || prop.ownColumns) {
continue;
}
if (prop.joinColumns.length > 1) {
prop.ownColumns = prop.joinColumns.filter(col => {
return !meta.props.find(p => p.name !== prop.name && (!p.fieldNames || p.fieldNames.includes(col)));
});
}
if (!prop.ownColumns || prop.ownColumns.length === 0) {
prop.ownColumns = prop.joinColumns;
}
}
}
initFieldName(prop, object = false) {

@@ -473,2 +489,3 @@ if (prop.fieldNames && prop.fieldNames.length > 0) {

}
this.initOwnColumns(meta);
meta.simplePK = pks.length === 1 && pks[0].kind === enums_1.ReferenceKind.SCALAR && !pks[0].customType && pks[0].runtimeType !== 'Date';

@@ -475,0 +492,0 @@ meta.serializedPrimaryKey = this.platform.getSerializedPrimaryKeyField(meta.primaryKeys[0]);

{
"name": "@mikro-orm/core",
"version": "6.3.14-dev.52",
"version": "6.3.14-dev.53",
"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.",

@@ -67,5 +67,5 @@ "main": "index.js",

"globby": "11.1.0",
"mikro-orm": "6.3.14-dev.52",
"mikro-orm": "6.3.14-dev.53",
"reflect-metadata": "0.2.2"
}
}

@@ -368,2 +368,3 @@ import type { Transaction } from './connections';

joinColumns: string[];
ownColumns: string[];
inverseJoinColumns: string[];

@@ -370,0 +371,0 @@ referencedColumnNames: string[];

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc