-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
postgres relations add foreign_tables #6950
Conversation
Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA. In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, please reach out through a comment on this PR. CLA has not been signed by users: @lialzm |
This PR has been marked as Stale because it has been open with no activity as of late. If you would like the PR to remain open, please comment on the PR or else it will be closed in 7 days. |
I submitted the cla agreement, but there seems to be no feedback |
Thanks for opening this PR @lialzm ! Sorry for the delay here, I see this PR is missing an associated issue - that's typically where we give product/dx feedback. Could you do the following?
|
Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide. |
1 similar comment
Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide. |
This looks like it would resolve dbt-labs/dbt-postgres#53, and I've added 1. is taken care of -- no need to create a new issue. You'd still need to do: 2. create a changelog entry (via |
select | ||
'{{ schema_relation.database }}' as database, | ||
foreign_table_name as name, | ||
foreign_table_schema as schema, | ||
'table' as type | ||
from information_schema.foreign_tables | ||
where foreign_table_schema ilike '{{ schema_relation.schema }}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lialzm could you take a look at the prototype version of this macro here?
Key thing
The key thing is that it uses external
as the type rather than table
. I don't know for certain, but I'm guessing that we'll want to to be external
.
i.e., we want it to be the same as dbt_utils.get_table_types_sql
here.
Something else to consider
I don't have strong opinions on using the information_schema.foreign_tables
view versus the information_schema.tables
view. Using information_schema.foreign_tables
is a little more simple since it doesn't need an extra filter in the where clause.
@cla-bot check |
The cla-bot has been summoned, and re-checked this pull request! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main dbt-labs/dbt-core#6950 +/- ##
=======================================
Coverage ? 86.59%
=======================================
Files ? 179
Lines ? 26564
Branches ? 0
=======================================
Hits ? 23004
Misses ? 3560
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Thanks for taking the time to open this PR @lialzm! Since opening, we've decoupled dbt Adapters from dbt Core, and this code now lives in a separate repo: dbt-postgres. A consequence of the decoupling is that PR can't be merged anymore as is, so we're closing it. For more context see #9171. The linked issue has already been transferred. Please don't hesitate to re-open your proposed code changes within this PR in the dbt-postgres repo. |
resolves dbt-labs/dbt-postgres#53
When using incremental mode, if it is a remote table, data cannot be inserted