UNPKG

education-module-ai

Version:
33 lines (32 loc) 982 B
import { DatabaseAdapter } from "@elizaos/core"; /** * Generic module adapter interface * This allows any module to wrap a DatabaseAdapter without recreating connections */ export interface ModuleAdapterInterface<D> { /** * Get the underlying database instance */ getDatabase(): D; /** * Get the database adapter this module is using */ getDatabaseAdapter<T>(): DatabaseAdapter<T>; } /** * Base class for module-specific adapters * Modules can extend this to create specialized database access * without creating multiple database connections */ export declare abstract class ModuleAdapter<D> implements ModuleAdapterInterface<D> { protected databaseAdapter: DatabaseAdapter<D>; constructor(databaseAdapter: DatabaseAdapter<D>); /** * Get the underlying database instance */ getDatabase(): D; /** * Get the database adapter this module is using */ getDatabaseAdapter<T>(): DatabaseAdapter<T>; }