-
Notifications
You must be signed in to change notification settings - Fork 426
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply PR feedback on initialze/refresh_mode
* Add type and validations for DynamicTableInitialize options * Update type and add validations for DynamicTableRefreshMode options * Set default values for both initialize and refresh_mode * No longer use DiffSuppressFunc since the default values should match when not specified * Add separate test for initialize and refresh_mode in dynamic table integration test * Add additional steps in dynamic table acceptance test to show what happends when initialize and/or refresh_mode is changed after the dynamic table is already created. * To support the above, read the created_on date from existing dynamic tables as a way to test whether a step has replaced the dynamic table
- Loading branch information
Showing
12 changed files
with
275 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
pkg/resources/testdata/TestAcc_DynamicTable_basic/4/test.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
|
||
resource "snowflake_table" "t" { | ||
database = var.database | ||
schema = var.schema | ||
name = var.table_name | ||
change_tracking = true | ||
column { | ||
name = "id" | ||
type = "NUMBER(38,0)" | ||
} | ||
} | ||
|
||
resource "snowflake_dynamic_table" "dt" { | ||
depends_on = [snowflake_table.t] | ||
name = var.name | ||
database = var.database | ||
schema = var.schema | ||
target_lag { | ||
downstream = true | ||
} | ||
warehouse = var.warehouse | ||
query = var.query | ||
comment = var.comment | ||
refresh_mode = var.refresh_mode | ||
initialize = var.initialize | ||
} |
37 changes: 37 additions & 0 deletions
37
pkg/resources/testdata/TestAcc_DynamicTable_basic/4/variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
|
||
variable "name" { | ||
type = string | ||
} | ||
|
||
variable "database" { | ||
type = string | ||
} | ||
|
||
variable "schema" { | ||
type = string | ||
} | ||
|
||
variable "warehouse" { | ||
type = string | ||
} | ||
|
||
variable "query" { | ||
type = string | ||
} | ||
|
||
variable "comment" { | ||
type = string | ||
} | ||
|
||
variable "refresh_mode" { | ||
type = string | ||
} | ||
|
||
variable "initialize" { | ||
type = string | ||
} | ||
|
||
variable "table_name" { | ||
type = string | ||
} |
25 changes: 25 additions & 0 deletions
25
pkg/resources/testdata/TestAcc_DynamicTable_basic/5/test.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
|
||
resource "snowflake_table" "t" { | ||
database = var.database | ||
schema = var.schema | ||
name = var.table_name | ||
change_tracking = true | ||
column { | ||
name = "id" | ||
type = "NUMBER(38,0)" | ||
} | ||
} | ||
|
||
resource "snowflake_dynamic_table" "dt" { | ||
depends_on = [snowflake_table.t] | ||
name = var.name | ||
database = var.database | ||
schema = var.schema | ||
target_lag { | ||
downstream = true | ||
} | ||
warehouse = var.warehouse | ||
query = var.query | ||
comment = var.comment | ||
} |
29 changes: 29 additions & 0 deletions
29
pkg/resources/testdata/TestAcc_DynamicTable_basic/5/variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
|
||
variable "name" { | ||
type = string | ||
} | ||
|
||
variable "database" { | ||
type = string | ||
} | ||
|
||
variable "schema" { | ||
type = string | ||
} | ||
|
||
variable "warehouse" { | ||
type = string | ||
} | ||
|
||
variable "query" { | ||
type = string | ||
} | ||
|
||
variable "comment" { | ||
type = string | ||
} | ||
|
||
variable "table_name" { | ||
type = string | ||
} |
Oops, something went wrong.