dbt-labs / dbt-core

dbt enables data analysts and engineers to transform their data using the same practices that software engineers use to build applications.
https://getdbt.com
Apache License 2.0
9.25k stars 1.53k forks source link

How to read from db1 and write to db2 #10339

Closed han8435762 closed 1 week ago

han8435762 commented 1 week ago

Is this your first time submitting a feature request?

Describe the feature

db1: pgsql db2: duckdb

read data from db1,write to db2

Describe alternatives you've considered

No response

Who will this benefit?

No response

Are you interested in contributing this feature?

No response

Anything else?

No response

han8435762 commented 1 week ago

I tried to use the source module to bring in the pgsql table and then write to the default duckdb database but it gives me an error I've checked all the documentation, asked ChatGPT, but I can't find an answer.

b-per commented 1 week ago

dbt doesn't allow to read from a data warehouse and write to another one.

But, in your situation, DuckDB itself can read from Postgres. There are examples of what you are after in the dbt Slack Community (example here) leveraging the attach feature of dbt-duckdb