Replies: 4 comments 2 replies
-
Could you give a specific example of possible color formatting for SnowDDL output? It should be possible to implement, but maybe it should take form of some additional command on top. If you have too many objects, you would probably want to use scripts and some kind of automation to read logs for you. Reading very long logs in terminal might not be as productive even with better colors. Thank you. |
Beta Was this translation helpful? Give feedback.
-
All good points. Thank you. We are using SnowDDL in two different modes. The first mode is to develop. The second is deployment. Colordiff would be useful for development and normal diff without color would be good for logging in automation like deployment. We're forced to use singledb mode because the admins of our snowflake lock it down very tightly. Here's the case I'm imagining: Suppose you have a table. Adding columns is an alter and not hard to spot in the info/debug/sql output. However, now suppose you make some small change that triggers table recreation. It's hard to spot the reason for this table recreation, and it would be so cool to see a diff of observed (at SF) vs. generated proposed SQL. In this way, we could see what exactly is the gap we introduced at yaml. Does that make sense? I don't know currently how to render SQL proposals to disk, but if that were possible, I could do colordiff out of band for sure. Thanks!! |
Beta Was this translation helpful? Give feedback.
-
Aha, now I see. Yes, it makes sense. It would not be easy to implement this feature specifically as "diff", since SQL generation is based on "blueprint" (config), but the actual state of table in Snowflake account is fetched and stored in a different structure. But it might be possible to list specific reasons which caused SnowDDL to suggest "REPLACE" instead of "ALTER". It should be really useful, especially for tables with a lot of columns. I'll think about it. |
Beta Was this translation helpful? Give feedback.
-
@josdotso , SnowDDL now adds SQL comments at the beginning of This feature is available since Hope it helps! |
Beta Was this translation helpful? Give feedback.
-
Hi. I am finding myself being by SnowDDL to replace things with SQL that were just applied. I'm guessing that this has a few contributing factors, but in any case, seeing a
colordiff -u
style difference similar to git of what the reason is would be most helpful. Thank you!Beta Was this translation helpful? Give feedback.
All reactions