Is it possible to import a redshift table structure into a source definition (schema.yml)

June 2023 - I have a number of tables in a redshift database that I would like to add as sources in my project. Is there a way to import into my schema.yml file a table and its columns?

I know how to manually add a table as a source and how to manually add each column in the table, and this is fine if the table just has a few columns. However, some of my tables have a large number of columns and I dread the thought of having to manually add each column in the schema.yml file

I’m very new to dbt (less than a month) but am excited to continue to learn

Try the generate_source macro from the dbt-codegen package

1 Like

Duuuude… you’re the man! This solution was irie! THNXS bruv!


If it works for you I would appreciate if you could mark the answer as solution

Done! THNXS for the gentle reminder.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.