Skip to content

Commit

Permalink
changes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-jcieslak committed Dec 12, 2023
1 parent d23b209 commit 10ebec8
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 36 deletions.
36 changes: 18 additions & 18 deletions pkg/sdk/external_tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ type CreateExternalTableOptions struct {
// RawFileFormat was introduced, because of the decision taken during https://github.com/Snowflake-Labs/terraform-provider-snowflake/pull/2228
// that for now the snowflake_external_table resource should continue on using raw file format, which wasn't previously supported by the new SDK.
// In the future it should most likely be replaced by a more structured version FileFormat
RawFileFormat *RawFileFormat `ddl:"list,parentheses" sql:"FILE_FORMAT ="`
AwsSnsTopic *string `ddl:"parameter,single_quotes" sql:"AWS_SNS_TOPIC"`
CopyGrants *bool `ddl:"keyword" sql:"COPY GRANTS"`
Comment *string `ddl:"parameter,single_quotes" sql:"COMMENT"`
RawFileFormat *RawFileFormat `ddl:"list,parentheses" sql:"FILE_FORMAT ="`
AwsSnsTopic *string `ddl:"parameter,single_quotes" sql:"AWS_SNS_TOPIC"`
CopyGrants *bool `ddl:"keyword" sql:"COPY GRANTS"`
Comment *string `ddl:"parameter,single_quotes" sql:"COMMENT"`
RowAccessPolicy *TableRowAccessPolicy `ddl:"keyword"`
Tag []TagAssociation `ddl:"keyword,parentheses" sql:"TAG"`
Tag []TagAssociation `ddl:"keyword,parentheses" sql:"TAG"`
}

type ExternalTableColumn struct {
Expand Down Expand Up @@ -216,11 +216,11 @@ type CreateWithManualPartitioningExternalTableOptions struct {
// RawFileFormat was introduced, because of the decision taken during https://github.com/Snowflake-Labs/terraform-provider-snowflake/pull/2228
// that for now the snowflake_external_table resource should continue on using raw file format, which wasn't previously supported by the new SDK.
// In the future it should most likely be replaced by a more structured version FileFormat
RawFileFormat *RawFileFormat `ddl:"list,parentheses" sql:"FILE_FORMAT ="`
CopyGrants *bool `ddl:"keyword" sql:"COPY GRANTS"`
Comment *string `ddl:"parameter,single_quotes" sql:"COMMENT"`
RawFileFormat *RawFileFormat `ddl:"list,parentheses" sql:"FILE_FORMAT ="`
CopyGrants *bool `ddl:"keyword" sql:"COPY GRANTS"`
Comment *string `ddl:"parameter,single_quotes" sql:"COMMENT"`
RowAccessPolicy *TableRowAccessPolicy `ddl:"keyword"`
Tag []TagAssociation `ddl:"keyword,parentheses" sql:"TAG"`
Tag []TagAssociation `ddl:"keyword,parentheses" sql:"TAG"`
}

// CreateDeltaLakeExternalTableOptions based on https://docs.snowflake.com/en/sql-reference/sql/create-external-table
Expand All @@ -241,12 +241,12 @@ type CreateDeltaLakeExternalTableOptions struct {
// RawFileFormat was introduced, because of the decision taken during https://github.com/Snowflake-Labs/terraform-provider-snowflake/pull/2228
// that for now the snowflake_external_table resource should continue on using raw file format, which wasn't previously supported by the new SDK.
// In the future it should most likely be replaced by a more structured version FileFormat
RawFileFormat *RawFileFormat `ddl:"list,parentheses" sql:"FILE_FORMAT ="`
DeltaTableFormat *bool `ddl:"keyword" sql:"TABLE_FORMAT = DELTA"`
CopyGrants *bool `ddl:"keyword" sql:"COPY GRANTS"`
Comment *string `ddl:"parameter,single_quotes" sql:"COMMENT"`
RawFileFormat *RawFileFormat `ddl:"list,parentheses" sql:"FILE_FORMAT ="`
DeltaTableFormat *bool `ddl:"keyword" sql:"TABLE_FORMAT = DELTA"`
CopyGrants *bool `ddl:"keyword" sql:"COPY GRANTS"`
Comment *string `ddl:"parameter,single_quotes" sql:"COMMENT"`
RowAccessPolicy *TableRowAccessPolicy `ddl:"keyword"`
Tag []TagAssociation `ddl:"keyword,parentheses" sql:"TAG"`
Tag []TagAssociation `ddl:"keyword,parentheses" sql:"TAG"`
}

// CreateExternalTableUsingTemplateOptions based on https://docs.snowflake.com/en/sql-reference/sql/create-external-table#variant-syntax
Expand All @@ -267,11 +267,11 @@ type CreateExternalTableUsingTemplateOptions struct {
// RawFileFormat was introduced, because of the decision taken during https://github.com/Snowflake-Labs/terraform-provider-snowflake/pull/2228
// that for now the snowflake_external_table resource should continue on using raw file format, which wasn't previously supported by the new SDK.
// In the future it should most likely be replaced by a more structured version FileFormat
RawFileFormat *RawFileFormat `ddl:"list,parentheses" sql:"FILE_FORMAT ="`
AwsSnsTopic *string `ddl:"parameter,single_quotes" sql:"AWS_SNS_TOPIC"`
Comment *string `ddl:"parameter,single_quotes" sql:"COMMENT"`
RawFileFormat *RawFileFormat `ddl:"list,parentheses" sql:"FILE_FORMAT ="`
AwsSnsTopic *string `ddl:"parameter,single_quotes" sql:"AWS_SNS_TOPIC"`
Comment *string `ddl:"parameter,single_quotes" sql:"COMMENT"`
RowAccessPolicy *TableRowAccessPolicy `ddl:"keyword"`
Tag []TagAssociation `ddl:"keyword,parentheses" sql:"TAG"`
Tag []TagAssociation `ddl:"keyword,parentheses" sql:"TAG"`
}

// AlterExternalTableOptions based on https://docs.snowflake.com/en/sql-reference/sql/alter-external-table
Expand Down
36 changes: 18 additions & 18 deletions pkg/sdk/external_tables_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ func TestExternalTablesCreate(t *testing.T) {
Name: "column",
Type: "varchar",
AsExpression: []string{"value::column::varchar"},
NotNull: Bool(true),
InlineConstraint: &ColumnInlineConstraint{
Name: String("my_constraint"),
NotNull: Bool(true),
Type: &ColumnConstraintTypeUnique,
Name: String("my_constraint"),
Type: ColumnConstraintTypeUnique,
},
},
},
Expand All @@ -124,10 +124,10 @@ func TestExternalTablesCreate(t *testing.T) {
Name: "column",
Type: "varchar",
AsExpression: []string{"value::column::varchar"},
NotNull: Bool(true),
InlineConstraint: &ColumnInlineConstraint{
Name: String("my_constraint"),
NotNull: Bool(true),
Type: &ColumnConstraintTypeUnique,
Name: String("my_constraint"),
Type: ColumnConstraintTypeUnique,
},
},
},
Expand Down Expand Up @@ -206,10 +206,10 @@ func TestExternalTablesCreateWithManualPartitioning(t *testing.T) {
Name: "column",
Type: "varchar",
AsExpression: []string{"value::column::varchar"},
NotNull: Bool(true),
InlineConstraint: &ColumnInlineConstraint{
Name: String("my_constraint"),
NotNull: Bool(true),
Type: &ColumnConstraintTypeUnique,
Name: String("my_constraint"),
Type: ColumnConstraintTypeUnique,
},
},
},
Expand All @@ -227,10 +227,10 @@ func TestExternalTablesCreateWithManualPartitioning(t *testing.T) {
Name: "column",
Type: "varchar",
AsExpression: []string{"value::column::varchar"},
NotNull: Bool(true),
InlineConstraint: &ColumnInlineConstraint{
Name: String("my_constraint"),
NotNull: Bool(true),
Type: &ColumnConstraintTypeUnique,
Name: String("my_constraint"),
Type: ColumnConstraintTypeUnique,
},
},
},
Expand Down Expand Up @@ -307,10 +307,10 @@ func TestExternalTablesCreateDeltaLake(t *testing.T) {
Name: "column",
Type: "varchar",
AsExpression: []string{"value::column::varchar"},
NotNull: Bool(true),
InlineConstraint: &ColumnInlineConstraint{
Name: String("my_constraint"),
NotNull: Bool(true),
Type: &ColumnConstraintTypeUnique,
Name: String("my_constraint"),
Type: ColumnConstraintTypeUnique,
},
},
},
Expand All @@ -328,10 +328,10 @@ func TestExternalTablesCreateDeltaLake(t *testing.T) {
Name: "column",
Type: "varchar",
AsExpression: []string{"value::column::varchar"},
NotNull: Bool(true),
InlineConstraint: &ColumnInlineConstraint{
Name: String("my_constraint"),
NotNull: Bool(true),
Type: &ColumnConstraintTypeUnique,
Name: String("my_constraint"),
Type: ColumnConstraintTypeUnique,
},
},
},
Expand Down

0 comments on commit 10ebec8

Please sign in to comment.