/** * MikroORM implementation of Hikoutei's scalar persistence SPI. * * Hikoutei's Unit of Work is the only lifecycle authority. This adapter merely * schedules its provider-neutral row plan on a transaction-bound MikroORM * manager, runs the optional mapped canonical/outbox planner, and flushes the * entity statements in the same SQLite transaction. */ import type { ResolvedHikouteiEntityDescriptor } from "../../../../contracts/api/entity.js"; import type { ScalarEntityCountQuery, ScalarEntityFlushCoordinator, ScalarEntityPersistenceProvider, ScalarEntityQuery, ScalarEntityReader, ScalarEntityRow, ScalarEntityTransaction } from "../../../../contracts/storage/scalar.js"; import type { MikroOrmSqliteAdapter } from "../storage/MikroOrmSqliteAdapter.js"; import type { MappedEntityReference } from "../../../../contracts/sync-orm/mapping/contracts.js"; /** Internal mapping from a public descriptor to its generated MikroORM entity. */ export interface MikroOrmScalarEntityBinding { readonly descriptor: ResolvedHikouteiEntityDescriptor; /** Kept opaque so MikroORM types remain inside this adapter module. */ readonly entity: MappedEntityReference>; } /** * Adapts generated MikroORM entity bindings to the provider-neutral scalar * contract. A mapped coordinator, when supplied, runs before entity SQL and * shares the active manager's transaction-bound SQL executor. */ export declare class MikroOrmScalarPersistenceProvider implements ScalarEntityPersistenceProvider { private readonly storage; private readonly flushCoordinator?; private readonly bindings; private readonly bindingsByTable; constructor(storage: MikroOrmSqliteAdapter, bindings: readonly MikroOrmScalarEntityBinding[], flushCoordinator?: ScalarEntityFlushCoordinator | undefined); /** Reads through a clean manager without flushing another Unit of Work. */ read(query: ScalarEntityQuery): Promise; /** Counts rows through a clean manager without materializing entities. */ count(query: ScalarEntityCountQuery): Promise; /** Runs sequential reads through one consistent SQLite read transaction. */ readSnapshot(work: (reader: ScalarEntityReader) => Promise): Promise; /** Runs the common UoW plan and mapped work in one SQLite transaction. */ beginTransaction(work: (transaction: ScalarEntityTransaction) => Promise): Promise; /** Closes the one SQLite connection owned by this provider. */ close(): Promise; private requireBindingByTable; } //# sourceMappingURL=MikroOrmScalarPersistenceProvider.d.ts.map