/** * Adapter Factory - Creates database-specific adapters * * This factory is responsible for instantiating the correct adapter * based on the database type. */ import { DatabaseType } from '../types/enums'; import { BaseAdapter } from './base.adapter'; /** * Factory class for creating database adapters */ export declare class AdapterFactory { /** Cache of adapter constructors for each database type */ private adapterConstructors; /** * Create a new adapter for the specified database type * * @param type Database type * @returns New adapter instance * @throws DatabaseError if database type is not supported * * @example * const factory = new AdapterFactory(); * const adapter = factory.create(DatabaseType.POSTGRESQL); */ create(type: DatabaseType): BaseAdapter; /** * Check if a database type is supported * * @param type Database type to check * @returns Whether the type is supported */ isSupported(type: DatabaseType | string): boolean; /** * Get list of supported database types * * @returns Array of supported database type strings */ getSupportedTypes(): DatabaseType[]; /** * Register a custom adapter for a database type * Allows extending the factory with custom adapters * * @param type Database type * @param AdapterConstructor Adapter class constructor * * @example * class CustomPostgresAdapter extends PostgreSQLAdapter { * // Custom implementation * } * * factory.registerAdapter(DatabaseType.POSTGRESQL, CustomPostgresAdapter); */ registerAdapter(type: DatabaseType, AdapterConstructor: new () => BaseAdapter): void; /** * Unregister an adapter for a database type * * @param type Database type to unregister * @returns Whether the adapter was unregistered */ unregisterAdapter(type: DatabaseType): boolean; }