import { ISDL, DatabaseType } from 'prisma-datamodel'; import { DocumentIntrospectionResult } from './documentIntrospectionResult'; import { IDocumentConnector, ICollectionDescription, SamplingStrategy, IDataIterator, TypeInfo } from './documentConnector'; import { DatabaseMetadata } from '../../common/introspectionResult'; /** * Base implementation of a DocumentConnector, holding all logic which should be equal for all * Document databases. For a documentation of abstract members, please see IDocumentConnector. */ export declare abstract class DocumentConnector implements IDocumentConnector { abstract getDatabaseType(): DatabaseType; abstract getMetadata(schemaName: string): Promise; abstract listSchemas(): Promise; abstract getInternalCollections(schema: string): Promise[]>; abstract getInternalCollection(schema: string, collection: string): Promise; abstract exists(collection: InternalCollectionType, id: any): Promise; /** * Samples a single document from the given collection. */ protected abstract sampleOne(collection: InternalCollectionType): Promise; /** * Samples a number of documents from the given collection. The documents are randomly picked and * can be duplicates. */ protected abstract sampleMany(collection: InternalCollectionType, limit: number): Promise; /** * Samples all documents from a collection. */ protected abstract sampleAll(collection: InternalCollectionType): Promise; /** * Calls `listModels` and wraps the result. */ introspect(schema: string): Promise; sample(collection: InternalCollectionType, samplingStrategy: SamplingStrategy): Promise; listModels(schemaName: string, modelSamplingStrategy?: SamplingStrategy, relationSamplingStrategy?: SamplingStrategy): Promise; /** * Infers the primitive type for an array. Uses inferType internally. */ private inferArrayType; /** * Infers the type of a primitive value. * * This method should be overridden accordingly for each Connector implementation. */ inferType(value: any): TypeInfo; }