sequelae-mcp
Version:
Let Claude, Cursor, and other AI agents run real SQL queries on live Postgres databases. No more copy-pasting SQL, stale schema docs, or hallucinated DB adapters — just raw, real-time access. Now with MCP support!
52 lines • 2.49 kB
TypeScript
import { Pool } from 'pg';
export declare function handleVersion(jsonMode: boolean): string;
export declare function handleHelp(jsonMode: boolean): string;
export declare function formatError(error: string, jsonMode: boolean, hint?: string): string;
export declare function handleExit(jsonMode: boolean): string;
export interface ParsedArguments {
jsonMode: boolean;
allSchemas: boolean;
noTransaction: boolean;
timeout?: number;
filteredArgs: string[];
}
export declare function parseArguments(args: string[]): ParsedArguments;
export declare function validateDatabaseUrl(databaseUrl: string | undefined, jsonMode: boolean): string | null;
export declare function createPool(connectionString: string): Pool;
export interface CommandInfo {
command: string;
needsArgument: boolean;
argumentName?: string;
}
export declare function getCommandInfo(command: string): CommandInfo | null;
export declare function validateCommandArgument(commandInfo: CommandInfo, argument: string | undefined, jsonMode: boolean): string | null;
export declare function validateFile(filepath: string, jsonMode: boolean): string | null;
export declare function readSqlFile(filepath: string): string;
export interface QueryResult {
command?: string;
rowCount?: number;
rows?: Record<string, unknown>[];
duration?: number;
}
export declare function formatQueryResultsJson(result: QueryResult, duration: number): string;
export interface SqlError extends Error {
position?: number;
}
export declare class SqlAgentError extends Error {
readonly code: string;
readonly hint?: string | undefined;
constructor(message: string, code: string, hint?: string | undefined);
}
export declare function createNoCommandError(): SqlAgentError;
export declare function createNoSqlQueryError(): SqlAgentError;
export declare function createNoFilePathError(): SqlAgentError;
export declare function createFileNotFoundError(filepath: string): SqlAgentError;
export declare function formatSqlError(error: SqlError, jsonMode: boolean): string;
export declare function formatCommandResult(command: string, rowCount: number | null, duration: number): string;
export declare function buildSchemaCondition(allSchemas: boolean): string;
export declare function buildTableList(tables: string): string[];
export declare function isDirectSqlCommand(command: string): boolean;
declare function main(): Promise<void>;
export { main };
//# sourceMappingURL=cli.d.ts.map