Skip to content
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

Destination postgres: add option for cascade drop #36974

Merged
merged 10 commits into from
Apr 11, 2024
Merged

Conversation

edgao
Copy link
Contributor

@edgao edgao commented Apr 10, 2024

closes #35386

  • AbstractJdbcDestinations.getSqlGenerator now accepts config: JsonNode
  • JdbcSqlGenerator now accepts cascadeDrop: Boolean = false, and adds cascade() to its drop table statements
    • there are three of these; I only modified two of them (the ones that drop the final table). The v1v2 migration drops the v2 raw table if it already exists, which IMO if we need to cascade drop, then something is wrong. The v1v2 migration shouldn't even be triggering if the user is already building stuff on top of v2 tables, because it should only run if the v2 tables don't exist.
  • Add a testcase to the postgres sqlgenerator integration test to verify cascade works (tested locally to verify that the old code fails the test)

I didn't do any manual syncs/etc, lmk if you want that, or e.g. want a screenshot of the config option, etc

@edgao edgao requested a review from a team as a code owner April 10, 2024 18:38
Copy link

vercel bot commented Apr 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
airbyte-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 11, 2024 6:30pm

Copy link
Contributor

@gisripa gisripa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.

Add a doc update in postgres.md with big :::caution 😅

@octavia-squidington-iii octavia-squidington-iii added the area/documentation Improvements or additions to documentation label Apr 11, 2024
@edgao edgao requested a review from a team as a code owner April 11, 2024 18:04
@edgao
Copy link
Contributor Author

edgao commented Apr 11, 2024

/publish-java-cdk

🕑 https://github.com/airbytehq/airbyte/actions/runs/8651263369
✅ Successfully published Java CDK version=0.30.0!

@edgao edgao enabled auto-merge (squash) April 11, 2024 18:25
@edgao edgao merged commit 9ac5233 into master Apr 11, 2024
29 checks passed
@edgao edgao deleted the edgao/postgres/cascade branch April 11, 2024 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation CDK Connector Development Kit connectors/destination/postgres connectors/destination/postgres-strict-encrypt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[destination-postgres] Dv2 does not use CASCADE when deleting tables
4 participants