simple-ddl-parser
simple-ddl-parser copied to clipboard
support for Snowflake Terraform provider column(?) format generation
Is your feature request related to a problem? Please describe.
Many DB tools generate DDL (with various extensions) and looking for conversion into Snowflake Terraform format
Describe the solution you'd like
Support https://registry.terraform.io/providers/chanzuckerberg/snowflake/latest/docs/resources/table#nested-schema-for-column
Example syntax:
column {
name = "data"
type = "text"
nullable = false
}
or maybe support for snowflake_table although snowflake_table would likely refer to other components/variables in the TF files
Additional context
https://github.com/chanzuckerberg/terraform-provider-snowflake/discussions/685
@gliptak I can create a separate tool for this. I pretty sure that it must be a separate from parser. I can do it on this weekends. Something like ddl-to-tf-snowflake-table. I have already table-meta(https://github.com/xnuinside/table-meta ) that map in simple way output from ddl parser, so only one thing that I should do - it's create a mapping between table-meta columns and expected format of terraform-provider-snowflake config
@xnuinside thank you for the pointer to https://github.com/xnuinside/table-meta. I will review
If snowflake_table is targeted for generation (with hardcoded values), than it is full cycle (can go DDL -> TF -> DDL).
If it is snowflake_table_column only, might fit better with table-meta. For my usecase, I'm thinking of substituting only a columns into a TF maintained separately
did not have a chance to start working on this last weekends ( sorry
@xnuinside no worries. please let me know if/how I might help out