dsh-sql: DSH Database Plugin Covering Connections, Read-only Queries, Write Approvals, and Structure Exploration

dsh-sql is an engineering-grade database plugin for DSH, designed to securely interface with SQLite, MySQL, and PostgreSQL. It delineates operational boundaries through four core tools: `sql_list` for connection management and connectivity testing; `sql_query` for executing restricted read-only queries with enforced whitelist validation; `sql_exec` for handling write operations or DDL, governed by approval gates and read-only policies; and `sql_schema` for inspecting table structures and schemas. The plugin supports multi-connection configurations and includes built-in row limits, timeout restrictions, and security mechanisms. Passwords are managed via environment variables to avoid plaintext configuration. Its design focuses on mitigating the risk of models executing arbitrary SQL directly, ensuring that read access remains stable while write access requires approval. It is applicable to scenarios requiring database integration into DSH with strict access control.

Read More