Features
- Single statements: Execute a single SQL query or command
- Multiple statements: Separate multiple statements with semicolons (
;) - Transactions: Wrap operations in
BEGIN/COMMITblocks for atomic execution - Read-only mode: When enabled with
--readonlyflag, only SELECT and read-only operations are allowed - Row limiting: Configure
--max-rowsto limit SELECT query results
Single Query
Execute a single SELECT, INSERT, UPDATE, or DELETE statement.Multiple Statements
Execute multiple SQL statements in sequence by separating them with semicolons.Each statement is executed sequentially. If one statement fails, subsequent statements may not be executed depending on the database error handling.
Transactions
Wrap multiple operations in a transaction to ensure atomicity. UseBEGIN/COMMIT for successful transactions or ROLLBACK to undo changes.
DDL Operations
Create, alter, or drop database objects.Read-Only Mode
Restrict SQL execution to safe, read-only operations by configuring theexecute_sql tool with readonly = true:
SELECTqueriesSHOWcommandsDESCRIBEcommandsEXPLAINqueries- Other read-only operations
Row Limiting
Limit the number of rows returned from SELECT queries to prevent accidentally retrieving too much data:- Only applied to SELECT statements, not INSERT/UPDATE/DELETE
- If your query already has a
LIMITorTOPclause, DBHub uses the smaller value - Can be configured per-tool in TOML configuration
Selective Tool Exposure
Control which tools are available for each database source. By default, bothexecute_sql and search_objects are enabled. You can:
- Disable built-in tools entirely
- Configure specific tools with custom settings
- Expose only custom tools for restricted access
If no
[[tools]] entries are defined for a source, both execute_sql and search_objects are enabled by default for backward compatibility.