import { EntityManagerType, FindOneOptions, FindOptions, IDatabaseDriver } from './IDatabaseDriver'; import { EntityData, EntityMetadata, EntityProperty, FilterQuery, AnyEntity, Dictionary, Primary, PopulateOptions } from '../typings'; import { MetadataStorage } from '../metadata'; import { Connection, QueryResult, Transaction } from '../connections'; import { Configuration, ConnectionOptions } from '../utils'; import { LockMode, QueryOrderMap } from '../enums'; import { Platform } from '../platforms'; import { Collection } from '../entity'; import { EntityManager } from '../EntityManager'; import { DriverException } from '../exceptions'; export declare abstract class DatabaseDriver implements IDatabaseDriver { protected readonly config: Configuration; protected readonly dependencies: string[]; [EntityManagerType]: EntityManager; protected readonly connection: C; protected readonly replicas: C[]; protected readonly platform: Platform; protected readonly logger: import("../utils").Logger; protected metadata: MetadataStorage; protected constructor(config: Configuration, dependencies: string[]); abstract find>(entityName: string, where: FilterQuery, options?: FindOptions, ctx?: Transaction): Promise; abstract findOne>(entityName: string, where: FilterQuery, options?: FindOneOptions, ctx?: Transaction): Promise; abstract nativeInsert>(entityName: string, data: EntityData, ctx?: Transaction): Promise; abstract nativeInsertMany>(entityName: string, data: EntityData[], ctx?: Transaction): Promise; abstract nativeUpdate>(entityName: string, where: FilterQuery, data: EntityData, ctx?: Transaction): Promise; abstract nativeDelete>(entityName: string, where: FilterQuery, ctx?: Transaction): Promise; abstract count>(entityName: string, where: FilterQuery, ctx?: Transaction): Promise; createEntityManager(useContext?: boolean): D[typeof EntityManagerType]; aggregate(entityName: string, pipeline: any[]): Promise; loadFromPivotTable, O extends AnyEntity>(prop: EntityProperty, owners: Primary[][], where?: FilterQuery, orderBy?: QueryOrderMap, ctx?: Transaction): Promise>; syncCollection, O extends AnyEntity>(coll: Collection, ctx?: Transaction): Promise; mapResult>(result: EntityData, meta: EntityMetadata, populate?: PopulateOptions[]): T | null; connect(): Promise; reconnect(): Promise; getConnection(type?: 'read' | 'write'): C; close(force?: boolean): Promise; getPlatform(): Platform; setMetadata(metadata: MetadataStorage): void; getDependencies(): string[]; ensureIndexes(): Promise; protected inlineEmbeddables(meta: EntityMetadata, data: T): void; protected getPivotOrderBy(prop: EntityProperty, orderBy?: QueryOrderMap): QueryOrderMap; protected getPrimaryKeyFields(entityName: string): string[]; protected getPivotInverseProperty(prop: EntityProperty): EntityProperty; protected createReplicas(cb: (c: ConnectionOptions) => C): C[]; lockPessimistic>(entity: T, mode: LockMode, ctx?: Transaction): Promise; protected shouldHaveColumn>(prop: EntityProperty, populate: PopulateOptions[], includeFormulas?: boolean): boolean; /** * @inheritDoc */ convertException(exception: Error): DriverException; protected rethrow(promise: Promise): Promise; }