UNPKG

@dataql/node

Version:

DataQL core SDK for unified data management with MongoDB and GraphQL - Production Multi-Cloud Ready

52 lines (51 loc) 1.48 kB
import { MongoClient } from "mongodb"; import { DatabaseIntrospector } from "./DatabaseIntrospector.js"; import { DatabaseConnection, IntrospectionOptions, IntrospectionResult, CollectionIntrospection } from "./types.js"; /** * MongoDB-specific database introspector */ export declare class MongoDBIntrospector extends DatabaseIntrospector { private client?; private db?; constructor(connection: DatabaseConnection, options?: IntrospectionOptions); /** * Introspect the MongoDB database */ introspect(): Promise<IntrospectionResult>; /** * Connect to MongoDB */ protected connect(): Promise<MongoClient>; /** * Disconnect from MongoDB */ protected disconnect(): Promise<void>; /** * Get list of collections */ protected getCollections(): Promise<string[]>; /** * Introspect a specific collection */ protected introspectCollection(name: string): Promise<CollectionIntrospection>; /** * Analyze documents to extract field information */ private analyzeDocuments; /** * Extract fields from a document recursively */ private extractFields; /** * Get collection indexes */ private getCollectionIndexes; /** * Extract database name from connection URL */ private extractDatabaseName; /** * Override field type detection for MongoDB-specific types */ protected getValueType(value: any): string; }