Skip to main content
Glama
dbhub.toml.example6.15 kB
# DBHub Multi-Database Configuration # # Documentation: https://dbhub.ai/config/multi-database # # Quick Start: # 1. Copy this file to 'dbhub.toml' in your project directory # 2. Uncomment and edit the sources you need # 3. Delete or comment out sources you don't need # # Usage: # pnpm run dev # Uses ./dbhub.toml # pnpm run dev -- --config=/path/to/config.toml # ============================================================================ # POSTGRESQL EXAMPLES (Local → Dev → Prod progression) # ============================================================================ # Local PostgreSQL - DSN format (typical Docker/local dev setup) [[sources]] id = "local_pg" dsn = "postgres://postgres:postgres@localhost:5432/myapp" # Local PostgreSQL - Individual parameters (use when password contains special characters like @, :, /) # [[sources]] # id = "local_pg" # type = "postgres" # host = "localhost" # port = 5432 # database = "myapp" # user = "postgres" # password = "p@ss:word/123" # Development PostgreSQL (shared dev server) # [[sources]] # id = "dev_pg" # dsn = "postgres://dev_user:dev_password@dev-db.internal.company.com:5432/myapp_dev?sslmode=require" # connection_timeout = 30 # Production PostgreSQL (behind SSH bastion) # [[sources]] # id = "prod_pg" # dsn = "postgres://app_user:secure_password@10.0.1.100:5432/myapp_prod?sslmode=require" # connection_timeout = 30 # # SSH tunnel configuration # ssh_host = "bastion.company.com" # ssh_port = 22 # ssh_user = "deploy" # ssh_key = "~/.ssh/id_ed25519" # # ssh_passphrase = "your_key_passphrase" # If key is encrypted # ============================================================================ # MYSQL (Local development) # ============================================================================ # [[sources]] # id = "local_mysql" # dsn = "mysql://root:mysql@localhost:3306/myapp" # ============================================================================ # MARIADB (Local development) # ============================================================================ # [[sources]] # id = "local_mariadb" # dsn = "mariadb://root:mariadb@localhost:3306/myapp" # ============================================================================ # SQL SERVER (Local development) # ============================================================================ # [[sources]] # id = "local_sqlserver" # dsn = "sqlserver://sa:YourStrong@Passw0rd@localhost:1433/myapp" # # For named instances, use: # # dsn = "sqlserver://sa:YourStrong@Passw0rd@localhost:1433/myapp?instanceName=SQLEXPRESS" # query_timeout = 60 # Query timeout in seconds (works for all databases except SQLite) # ============================================================================ # SQLITE (Local file or in-memory) # ============================================================================ # File-based SQLite # [[sources]] # id = "local_sqlite" # dsn = "sqlite:///path/to/database.db" # In-memory SQLite (great for testing) # [[sources]] # id = "memory_sqlite" # dsn = "sqlite:///:memory:" # ============================================================================ # TOOL CONFIGURATION (Optional) # ============================================================================ # # By default, all sources get 'execute_sql' and 'search_objects' tools enabled. # Use [[tools]] entries to customize behavior per source. # [[tools]] # name = "execute_sql" # source = "local_pg" # readonly = true # max_rows = 1000 # [[tools]] # name = "search_objects" # source = "local_pg" # ============================================================================ # CUSTOM TOOLS (Optional) # ============================================================================ # # Define reusable SQL queries as MCP tools. Great for common operations. # Example: Current department managers (PostgreSQL - no parameters) # [[tools]] # name = "current_managers" # description = "List all current department managers" # source = "local_pg" # statement = """ # SELECT e.emp_no, e.first_name, e.last_name, d.dept_name, dm.from_date # FROM dept_manager dm # JOIN employee e ON dm.emp_no = e.emp_no # JOIN department d ON dm.dept_no = d.dept_no # WHERE dm.to_date = '9999-01-01' # ORDER BY d.dept_name # """ # Example: Search employees by salary range (PostgreSQL - required + optional parameter) # [[tools]] # name = "salary_search" # description = "Find employees earning at least min_salary, optionally capped by max_salary" # source = "local_pg" # statement = """ # SELECT e.emp_no, e.first_name, e.last_name, s.amount as salary # FROM employee e # JOIN salary s ON e.emp_no = s.emp_no # WHERE s.amount >= $1 # AND ($2::int IS NULL OR s.amount <= $2) # AND s.to_date = '9999-01-01' # ORDER BY s.amount DESC # LIMIT 100 # """ # # [[tools.parameters]] # name = "min_salary" # type = "integer" # description = "Minimum salary (required)" # required = true # # [[tools.parameters]] # name = "max_salary" # type = "integer" # description = "Maximum salary (optional, defaults to no limit)" # required = false # ============================================================================ # QUICK REFERENCE # ============================================================================ # # DSN Formats: # PostgreSQL: postgres://user:pass@host:5432/database?sslmode=require # MySQL: mysql://user:pass@host:3306/database # MariaDB: mariadb://user:pass@host:3306/database # SQL Server: sqlserver://user:pass@host:1433/database # SQLite: sqlite:///path/to/file.db or sqlite:///:memory: # # Default Ports: # PostgreSQL: 5432 | MySQL/MariaDB: 3306 | SQL Server: 1433 # # SSH Tunnel Options: # ssh_host, ssh_port (default: 22), ssh_user # ssh_key (path to private key) OR ssh_password # ssh_passphrase (if key is encrypted) # # Tool Options: # readonly = true # Restrict to SELECT, SHOW, DESCRIBE, EXPLAIN # max_rows = 1000 # Limit result set size # # Parameter Placeholders by Database: # PostgreSQL: $1, $2, $3 # MySQL/MariaDB: ?, ?, ? # SQL Server: @p1, @p2, @p3 # SQLite: ?, ?, ?

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bytebase/dbhub'

If you have feedback or need assistance with the MCP directory API, please join our Discord server