duckdb / dbt-duckdb

dbt (http://getdbt.com) adapter for DuckDB (http://duckdb.org)
Apache License 2.0
816 stars 69 forks source link

Inconsistencies between the `path` and `database` properties lead to weird errors #194

Closed jwills closed 1 year ago

jwills commented 1 year ago

From the MotherDuck Slack, we had a user run into issues when they set their path to be md:?token=... and their database to motherduck_jaffles, which led to an inconsistency between what the DuckDB connection thought the default database was (my_db) and what dbt-duckdb thought the default database was (motherduck_jaffles) and weird behavior (e.g., dbt seed successfully creating the database tables but then failing to load them.) The fix was simply to adjust the path to be md:motherduck_jaffles?token=... so as to make the default database consistent.

We should detect these inconsistencies when parsing the DuckDBCredentials and throw an error since they can only cause mischief/confusion.