@frank-x/dsh-tool-dm
v0.1.0-alpha.1
Published
Model-facing DM (达梦) database tool for SQL queries and schema management
Readme
@frank-x/dsh-tool-dm
Model-facing DM (达梦) database tool for SQL queries and schema management.
Overview
This package registers the dm_sql tool for executing SQL queries against DM databases. It provides formatted table output for SELECT queries and affected row counts for DML operations.
Installation
npm install @frank-x/dsh-tool-dmConfiguration
plugins:
tool-dm:
# Maximum rows to return from SELECT queries (optional, default: 1000)
maxRows: 1000
# Default query timeout in milliseconds (optional, default: 30000)
defaultTimeoutMs: 30000Usage
Once loaded, the dm_sql tool is available for model use:
dm_sql(connection: "mydb", sql: "SELECT * FROM users")Parameters
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| connection | string | Yes | Name of the pre-configured database connection |
| sql | string | Yes | SQL statement to execute |
| timeoutMs | number | No | Query timeout in milliseconds |
Output Format
SELECT Queries
id | name | email
---+-------+------------------
1 | Alice | [email protected]
2 | Bob | [email protected]
(2 rows)
Execution time: 15msDML Operations
Affected rows: 5
Execution time: 10msDependencies
@frank-x/dsh-dm- Service Definition@frank-x/dsh-dm-jdbc- JDBC Provider (must be loaded)@deepseek-ai/dsh-tools- Tool runtime@deepseek-ai/dsh-system-prompt- System prompt integration
License
MIT
