postgres-mcp-tools
Version:
PostgreSQL-based memory system with vector search capabilities for AI applications, including MCP integration for Claude
38 lines (37 loc) • 1.27 kB
TypeScript
import pkg from 'pg';
type PoolClient = any;
/**
* Get a client from the pool
* @returns A database client
*/
export declare const getClient: () => Promise<PoolClient>;
/**
* Execute a query on the database
* @param text The SQL query
* @param params The query parameters
* @returns The query result
*/
export declare const query: (text: string, params?: any[]) => Promise<pkg.QueryResult<any>>;
/**
* Execute a transaction on the database
* @param callback The callback function to execute within the transaction
* @returns The result of the callback
*/
export declare const transaction: <T>(callback: (client: PoolClient) => Promise<T>) => Promise<T>;
/**
* Check the health of the database connection
* @returns True if the database is healthy, false otherwise
*/
export declare const healthCheck: () => Promise<boolean>;
/**
* Close the database connection pool
*/
export declare const closePool: () => Promise<void>;
declare const _default: {
query: (text: string, params?: any[]) => Promise<pkg.QueryResult<any>>;
getClient: () => Promise<PoolClient>;
transaction: <T>(callback: (client: PoolClient) => Promise<T>) => Promise<T>;
healthCheck: () => Promise<boolean>;
closePool: () => Promise<void>;
};
export default _default;