add_database
Configure a new database source in the configuration file, including optional connection testing. Supports SQL Server and Snowflake via linked server.
Instructions
Add a new database source to config.yaml and optionally test the connection.
db_type='sqlserver': url (required) -- SQLAlchemy connection URL, e.g.: "mssql+pyodbc:///?odbc_connect=DRIVER=ODBC Driver 17 for SQL Server; Server=myserver;Database=MyDB;Trusted_Connection=Yes;"
db_type='snowflake' (via SQL Server linked server + OPENQUERY): sqlserver_url (required) -- SQLAlchemy URL for the gateway SQL Server linked_server (required) -- Linked server name (e.g. "SNOWFLAKE") snowflake_database (required) -- Snowflake database (e.g. "MY_DB")
Common: include_schemas -- ["*"] for all (default), or explicit list exclude_schemas -- defaults to system schemas for the db_type test_connection -- set False to skip the live connection test
After adding, call refresh_metadata(source='') to populate the cache.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | ||
| name | Yes | ||
| db_type | Yes | ||
| linked_server | No | ||
| sqlserver_url | No | ||
| exclude_schemas | No | ||
| include_schemas | No | ||
| test_connection | No | ||
| snowflake_database | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||