37 lines
999 B
TypeScript
37 lines
999 B
TypeScript
import {
|
|
type Dictionary,
|
|
type EntityMetadata,
|
|
type EntityProperty,
|
|
type Primary,
|
|
type Transaction,
|
|
} from '@mikro-orm/core';
|
|
import { type AbstractSqlDriver } from './AbstractSqlDriver.js';
|
|
export declare class PivotCollectionPersister<Entity extends object> {
|
|
#private;
|
|
constructor(
|
|
meta: EntityMetadata<Entity>,
|
|
driver: AbstractSqlDriver,
|
|
ctx?: Transaction,
|
|
schema?: string,
|
|
loggerContext?: Dictionary,
|
|
);
|
|
enqueueUpdate(
|
|
prop: EntityProperty<Entity>,
|
|
insertDiff: Primary<Entity>[][],
|
|
deleteDiff: Primary<Entity>[][] | boolean,
|
|
pks: Primary<Entity>[],
|
|
isInitialized?: boolean,
|
|
): void;
|
|
private enqueueInsert;
|
|
private enqueueUpsert;
|
|
private createInsertStatement;
|
|
private enqueueDelete;
|
|
/**
|
|
* Build the keys and data arrays for pivot table operations.
|
|
* Handles polymorphic M:N by prepending the discriminator column/value.
|
|
*/
|
|
private buildPivotKeysAndData;
|
|
private collectStatements;
|
|
execute(): Promise<void>;
|
|
}
|