Support of TABLE RENAME and COLUMN RENAME #17
Replies: 1 comment
-
Thank you for the idea. I've contemplated the renaming problem since very early stages. In theory, it can be implemented, but it has a few potential problems and edge cases:
So it is possible to implement a basic renaming for trivial use cases. But it is really hard to make this feature complete and reliable for complex cases. I am still not sure how to make it work. On the flip side, we already know that some manual query execution by ACCOUNTADMIN is unavoidable due to Snowflake architecture. Renaming is currently a part of this manual execution. Also, if |
Beta Was this translation helpful? Give feedback.
-
Currently, I can handle table & column rename in a pre-deployment script via SnowSQL before the execution of SnowDDL.
However, I am wondering if there is a better way to support rename within SnowDDL YAML config.
What if there is a property such as former_name / aka that allows you to instruct rename behavior.
I understand this might also create some circular reference problem. But when use carefully, this would reduce the chance of data loss, and eliminate some pre- & post- deployment script needs.
Proposal
public/table/booking.yaml
Potentially generate the following scripts
OR, generate a better CREATE-SELECT statement during --apply-replace-table.
Beta Was this translation helpful? Give feedback.
All reactions