Skip to main content

Crate nexql_tools

Crate nexql_tools 

Source
Expand description

Tool catalog and executors.

Tools return typed results; the protocol layer serializes them. This crate must NOT depend on nexql-proto.

Re-exports§

pub use completions::CompletionResult;
pub use completions::CompletionsProvider;
pub use detect::ConnectionDetector;
pub use detect::DetectedCandidate;
pub use error::ToolError;
pub use exec::ToolOutcome;
pub use exec::ToolRouter;
pub use prompts::PromptCatalog;
pub use prompts::PromptError;
pub use prompts::PromptGetResult;
pub use prompts::PromptInfo;
pub use registry::ToolName;
pub use registry::ToolProfile;
pub use resources::McpResource;
pub use resources::ResourceError;
pub use resources::ResourceListResult;
pub use resources::ResourceProvider;
pub use resources::ResourceReadResult;
pub use resources::decode_cursor;
pub use resources::encode_cursor_state;
pub use resources::parse_uri;
pub use schema::ToolSpec;
pub use schema::active_tools;
pub use schema::generate_mermaid_diagram_for_path;
pub use schema::generate_mermaid_erd_for_object;
pub use schema::phase2_catalog_tools;
pub use schema::phase3_index_tools;
pub use schema::phase4_tools;
pub use schema::phase4b_tools;
pub use schema::phase9_write_tools;
pub use schema::tools_for_profile;
pub use session::ConnectionInfo;
pub use session::ConnectionPolicy;
pub use session::ToolSession;
pub use session::default_index_root;
pub use session::policy_from_profile;

Modules§

cell_json
Typed Postgres cell → JSON conversion shared by read and write tools.
completions
Minimal completions/complete for ref tool arguments from the schema index.
dba_guard
DDL migration safety inspection rules for locking risk assessment.
detect
Auto-detection of Postgres connection candidates from environment, workspace files, and local settings.
error
exec
Tool dispatch for catalog (Phase 2) + index (Phase 3) + Phase 4 surfaces.
export
Result formatting for export_query (CSV / JSON / SQL-INSERT). Ported from core CoreHandlers.rowsToCsv / rowsToSqlInsert.
plan
EXPLAIN JSON plan metrics — port of QueryPerformanceAnalyzer.extractPlanMetrics.
prompts
Static MCP prompts — canned diagnostic workflows.
registry
Tool name catalog for the MCP surface.
resources
MCP resources backed by the on-disk schema index (dbindex).
schema
Tool descriptors for the active MCP surface (Phase 2–4).
schema_diff
Schema snapshot load + pure diff/migration (ported from core SchemaDiffEngine).
session
Session state: resolved profiles + active pool + optional schema index.
sql
SQL builders for Phase 4 monitoring / DDL tools. Ported from pro/.../ToolExecutor.ts + core/commands/sql/{profile,monitoring}.ts.
write
Write/admin MCP tool executors (Phase 9).