Switch Database Connection
switch_database_connectionConnect to a different DuckDB or MotherDuck database. Use absolute paths for local files, or :memory:, md:, or s3:// paths, and optionally create missing local files.
Instructions
Switch to a different database connection. For local files, use absolute paths only. The new connection respects the server's read-only/read-write mode. For local files, the file must exist unless create_if_not_exists=True (requires read-write mode).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Database path. For local files, must be an absolute path. Also accepts :memory:, md:database_name, or s3:// paths. | |
| create_if_not_exists | No | If True, create the database file if it doesn't exist. Only works in read-write mode. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |