Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

@mikro-orm/core

Package Overview
Dependencies
Maintainers
1
Versions
4082
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
7.0.0-dev.265
to
7.0.0-dev.266
+1
-1
entity/BaseEntity.d.ts

@@ -11,3 +11,3 @@ import { type Ref } from './Reference.js';

populated(populated?: boolean): void;
populate<Entity extends this = this, Hint extends string = never>(populate: AutoPath<Entity, Hint, PopulatePath.ALL>[] | false, options?: EntityLoaderOptions<Entity>): Promise<Loaded<Entity, Hint>>;
populate<Entity extends this = this, Hint extends string = never, Fields extends string = never>(populate: AutoPath<Entity, Hint, PopulatePath.ALL>[] | false, options?: EntityLoaderOptions<Entity, Fields>): Promise<Loaded<Entity, Hint>>;
toReference<Entity extends this = this>(): Ref<Entity> & LoadedReference<Loaded<Entity, AddEager<Entity>>>;

@@ -14,0 +14,0 @@ /**

@@ -1,11 +0,11 @@

import type { AnyEntity, ConnectionType, EntityName, EntityProperty, FilterQuery, PopulateOptions } from '../typings.js';
import type { AnyEntity, AutoPath, ConnectionType, EntityName, EntityProperty, FilterQuery, PopulateOptions } from '../typings.js';
import type { EntityManager } from '../EntityManager.js';
import { LoadStrategy, type LockMode, type PopulateHint, PopulatePath, type QueryOrderMap } from '../enums.js';
import type { EntityField, FilterOptions } from '../drivers/IDatabaseDriver.js';
import type { FilterOptions } from '../drivers/IDatabaseDriver.js';
import type { LoggingOptions } from '../logging/Logger.js';
export type EntityLoaderOptions<Entity, Fields extends string = PopulatePath.ALL, Excludes extends string = never> = {
export interface EntityLoaderOptions<Entity, Fields extends string = PopulatePath.ALL, Excludes extends string = never> {
fields?: readonly AutoPath<Entity, Fields, `${PopulatePath.ALL}`>[];
exclude?: readonly AutoPath<Entity, Excludes>[];
where?: FilterQuery<Entity>;
populateWhere?: PopulateHint | `${PopulateHint}`;
fields?: readonly EntityField<Entity, Fields>[];
exclude?: readonly EntityField<Entity, Excludes>[];
orderBy?: QueryOrderMap<Entity> | QueryOrderMap<Entity>[];

@@ -23,3 +23,3 @@ refresh?: boolean;

logging?: LoggingOptions;
};
}
export declare class EntityLoader {

@@ -26,0 +26,0 @@ private readonly em;

@@ -153,3 +153,3 @@ import type { PopulatePath } from '../enums.js';

*/
populate<Ent extends Entity | Entity[], Hint extends string = never, Naked extends FromEntityType<Entity> = FromEntityType<Entity>, Fields extends string = '*', Excludes extends string = never>(entities: Ent, populate: AutoPath<Naked, Hint, PopulatePath.ALL>[] | false, options?: EntityLoaderOptions<Naked, Fields, Excludes>): Promise<Ent extends object[] ? MergeLoaded<ArrayElement<Ent>, Naked, Hint, Fields, Excludes>[] : MergeLoaded<Ent, Naked, Hint, Fields, Excludes>>;
populate<Ent extends Entity | Entity[], Hint extends string = never, Naked extends FromEntityType<Entity> = FromEntityType<Entity>, Fields extends string = never, Excludes extends string = never>(entities: Ent, populate: AutoPath<Naked, Hint, PopulatePath.ALL>[] | false, options?: EntityLoaderOptions<Naked, Fields, Excludes>): Promise<Ent extends object[] ? MergeLoaded<ArrayElement<Ent>, Naked, Hint, Fields, Excludes>[] : MergeLoaded<Ent, Naked, Hint, Fields, Excludes>>;
/**

@@ -156,0 +156,0 @@ * Creates new instance of given entity and populates it with given data.

@@ -52,3 +52,3 @@ import type { PopulatePath } from '../enums.js';

init<Hint extends string = never, Fields extends string = '*', Excludes extends string = never>(options?: FindOneOptions<Entity, Hint, Fields, Excludes>): Promise<Loaded<Entity, Hint, Fields, Excludes> | null>;
populate<Hint extends string = never>(populate: AutoPath<Entity, Hint, PopulatePath.ALL>[] | false, options?: EntityLoaderOptions<Entity>): Promise<Loaded<Entity, Hint>>;
populate<Hint extends string = never, Fields extends string = never>(populate: AutoPath<Entity, Hint, PopulatePath.ALL>[] | false, options?: EntityLoaderOptions<Entity, Fields>): Promise<Loaded<Entity, Hint>>;
hasPrimaryKey(): boolean;

@@ -55,0 +55,0 @@ getPrimaryKey(convertCustomTypes?: boolean): Primary<Entity> | null;

@@ -459,3 +459,3 @@ import { type Configuration } from './utils/Configuration.js';

*/
populate<Entity extends object, Naked extends FromEntityType<UnboxArray<Entity>> = FromEntityType<UnboxArray<Entity>>, Hint extends string = never, Fields extends string = '*', Excludes extends string = never>(entities: Entity, populate: readonly AutoPath<Naked, Hint, PopulatePath.ALL>[] | false, options?: EntityLoaderOptions<Naked, Fields, Excludes>): Promise<Entity extends object[] ? MergeLoaded<ArrayElement<Entity>, Naked, Hint, Fields, Excludes>[] : MergeLoaded<Entity, Naked, Hint, Fields, Excludes>>;
populate<Entity extends object, Naked extends FromEntityType<UnboxArray<Entity>> = FromEntityType<UnboxArray<Entity>>, Hint extends string = never, Fields extends string = never, Excludes extends string = never>(entities: Entity, populate: readonly AutoPath<Naked, Hint, PopulatePath.ALL>[] | false, options?: EntityLoaderOptions<Naked, Fields, Excludes>): Promise<Entity extends object[] ? MergeLoaded<ArrayElement<Entity>, Naked, Hint, Fields, Excludes>[] : MergeLoaded<Entity, Naked, Hint, Fields, Excludes>>;
/**

@@ -462,0 +462,0 @@ * Returns new EntityManager instance with its own identity map

{
"name": "@mikro-orm/core",
"type": "module",
"version": "7.0.0-dev.265",
"version": "7.0.0-dev.266",
"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.",

@@ -6,0 +6,0 @@ "exports": {

@@ -61,6 +61,8 @@ import { helper, wrap } from '../entity/wrap.js';

const populated = root.isMarkedAsPopulated(meta.class, prop);
const partiallyLoaded = root.isPartiallyLoaded(meta.class, prop);
const isPrimary = includePrimaryKeys && meta.properties[prop].primary;
if (!partiallyLoaded && !populated && !isPrimary) {
continue;
if (!raw) {
const partiallyLoaded = root.isPartiallyLoaded(meta.class, prop);
const isPrimary = includePrimaryKeys && meta.properties[prop].primary;
if (!partiallyLoaded && !populated && !isPrimary) {
continue;
}
}

@@ -67,0 +69,0 @@ const cycle = root.visit(meta.class, prop);

@@ -250,3 +250,3 @@ import type { Transaction } from './connections/Connection.js';

populated(populated?: boolean): void;
populate<Hint extends string = never>(populate: readonly AutoPath<Entity, Hint, PopulatePath.ALL>[] | false, options?: EntityLoaderOptions<Entity>): Promise<Loaded<Entity, Hint>>;
populate<Hint extends string = never, Fields extends string = never>(populate: readonly AutoPath<Entity, Hint, PopulatePath.ALL>[] | false, options?: EntityLoaderOptions<Entity, Fields>): Promise<Loaded<Entity, Hint>>;
init<Hint extends string = never, Fields extends string = '*', Exclude extends string = never>(options?: FindOneOptions<Entity, Hint, Fields, Exclude>): Promise<Loaded<Entity, Hint, Fields, Exclude> | null>;

@@ -253,0 +253,0 @@ toReference(): Ref<Entity> & LoadedReference<Loaded<Entity, AddEager<Entity>>>;

@@ -126,3 +126,3 @@ import { clone } from './clone.js';

static PK_SEPARATOR = '~~~';
static #ORM_VERSION = '7.0.0-dev.265';
static #ORM_VERSION = '7.0.0-dev.266';
/**

@@ -129,0 +129,0 @@ * Checks if the argument is instance of `Object`. Returns false for arrays.