@fastmcp-me/mcp-sqlew
Version:
MCP server for efficient context sharing between Claude Code sub-agents with 96% token reduction via action-based tools
50 lines • 1.43 kB
TypeScript
/**
* Schema initialization module
* Loads and executes SQL schema from docs/schema.sql
*/
import { Database } from 'better-sqlite3';
/**
* Initialize database schema
* Reads schema.sql and executes all CREATE and INSERT statements
*
* @param db - SQLite database connection
* @throws Error if schema initialization fails
*/
export declare function initializeSchema(db: Database): void;
/**
* Check if schema is already initialized
* Checks for existence of the m_agents table
*
* @param db - SQLite database connection
* @returns true if schema exists, false otherwise
*/
export declare function isSchemaInitialized(db: Database): boolean;
/**
* Get schema version information
* Returns counts of all master tables to verify schema integrity
*
* @param db - SQLite database connection
* @returns Object with table counts
*/
export declare function getSchemaInfo(db: Database): {
agents: number;
files: number;
context_keys: number;
layers: number;
tags: number;
scopes: number;
constraint_categories: number;
};
/**
* Verify schema integrity
* Checks that all required tables, indexes, views, and triggers exist
*
* @param db - SQLite database connection
* @returns Object with integrity check results
*/
export declare function verifySchemaIntegrity(db: Database): {
valid: boolean;
missing: string[];
errors: string[];
};
//# sourceMappingURL=schema.d.ts.map