-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support snowflake input option (#38)
* support snowflake input option * support output snowflake * go generate * fix some bug * go generate * run linter * rename import name * capitalized and snowflake input option Set schema defaults. * change generic type
- Loading branch information
1 parent
71d90a3
commit 38f35e9
Showing
26 changed files
with
975 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
23 changes: 23 additions & 0 deletions
23
internal/client/entity/job_definition/input_option/snowflake.go
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,23 @@ | ||
package input_option | ||
|
||
import ( | ||
"terraform-provider-trocco/internal/client/entity" | ||
) | ||
|
||
type SnowflakeInputOption struct { | ||
Warehouse string `json:"warehouse"` | ||
Database string `json:"database"` | ||
Schema string `json:"schema"` | ||
Query string `json:"query"` | ||
FetchRows *int64 `json:"fetch_rows"` | ||
ConnectTimeout *int64 `json:"connect_timeout"` | ||
SocketTimeout *int64 `json:"socket_timeout"` | ||
SnowflakeConnectionID int64 `json:"snowflake_connection_id"` | ||
InputOptionColumns []SnowflakeInputOptionColumn `json:"input_option_columns"` | ||
CustomVariableSettings *[]entity.CustomVariableSetting `json:"custom_variable_settings"` | ||
} | ||
|
||
type SnowflakeInputOptionColumn struct { | ||
Name string `json:"name"` | ||
Type string `json:"type"` | ||
} |
32 changes: 32 additions & 0 deletions
32
internal/client/entity/job_definition/output_option/snowflake.go
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,32 @@ | ||
package output_option | ||
|
||
import ( | ||
"terraform-provider-trocco/internal/client/entity" | ||
) | ||
|
||
type SnowflakeOutputOption struct { | ||
Warehouse string `json:"warehouse"` | ||
Database string `json:"database"` | ||
Schema string `json:"schema"` | ||
Table string `json:"table"` | ||
Mode *string `json:"mode"` | ||
EmptyFieldAsNull *bool `json:"empty_field_as_null"` | ||
DeleteStageOnError *bool `json:"delete_stage_on_error"` | ||
BatchSize *int64 `json:"batch_size"` | ||
RetryLimit *int64 `json:"retry_limit"` | ||
RetryWait *int64 `json:"retry_wait"` | ||
MaxRetryWait *int64 `json:"max_retry_wait"` | ||
DefaultTimeZone *string `json:"default_time_zone"` | ||
SnowflakeConnectionId int64 `json:"snowflake_connection_id"` | ||
SnowflakeOutputOptionColumnOptions []SnowflakeOutputOptionColumnOption `json:"snowflake_output_option_column_options"` | ||
SnowflakeOutputOptionMergeKeys []string `json:"snowflake_output_option_merge_keys"` | ||
CustomVariableSettings *[]entity.CustomVariableSetting `json:"custom_variable_settings"` | ||
} | ||
|
||
type SnowflakeOutputOptionColumnOption struct { | ||
Name string `json:"name"` | ||
Type string `json:"type"` | ||
ValueType *string `json:"value_type"` | ||
TimestampFormat *string `json:"timestamp_format"` | ||
Timezone *string `json:"timezone"` | ||
} |
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
36 changes: 36 additions & 0 deletions
36
internal/client/parameter/job_definition/input_option/snowflake.go
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,36 @@ | ||
package input_options | ||
|
||
import ( | ||
"terraform-provider-trocco/internal/client/parameter" | ||
) | ||
|
||
type SnowflakeInputOptionInput struct { | ||
Warehouse string `json:"warehouse"` | ||
Database string `json:"database"` | ||
Schema *parameter.NullableString `json:"schema"` | ||
Query string `json:"query"` | ||
FetchRows *parameter.NullableInt64 `json:"fetch_rows,omitempty"` | ||
ConnectTimeout *parameter.NullableInt64 `json:"connect_timeout,omitempty"` | ||
SocketTimeout *parameter.NullableInt64 `json:"socket_timeout,omitempty"` | ||
SnowflakeConnectionID int64 `json:"snowflake_connection_id"` | ||
InputOptionColumns []SnowflakeInputOptionColumn `json:"input_option_columns"` | ||
CustomVariableSettings *[]parameter.CustomVariableSettingInput `json:"custom_variable_settings,omitempty"` | ||
} | ||
|
||
type UpdateSnowflakeInputOptionInput struct { | ||
Warehouse *string `json:"warehouse,omitempty"` | ||
Database *string `json:"database,omitempty"` | ||
Schema *parameter.NullableString `json:"schema,omitempty"` | ||
Query *string `json:"query,omitempty"` | ||
FetchRows *parameter.NullableInt64 `json:"fetch_rows,omitempty"` | ||
ConnectTimeout *parameter.NullableInt64 `json:"connect_timeout,omitempty"` | ||
SocketTimeout *parameter.NullableInt64 `json:"socket_timeout,omitempty"` | ||
SnowflakeConnectionID *int64 `json:"snowflake_connection_id,omitempty"` | ||
InputOptionColumns []SnowflakeInputOptionColumn `json:"input_option_columns,omitempty"` | ||
CustomVariableSettings *[]parameter.CustomVariableSettingInput `json:"custom_variable_settings,omitempty"` | ||
} | ||
|
||
type SnowflakeInputOptionColumn struct { | ||
Name string `json:"name"` | ||
Type string `json:"type"` | ||
} |
51 changes: 51 additions & 0 deletions
51
internal/client/parameter/job_definition/output_option/snowflake.go
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,51 @@ | ||
package output_options | ||
|
||
import ( | ||
"terraform-provider-trocco/internal/client/parameter" | ||
) | ||
|
||
type SnowflakeOutputOptionInput struct { | ||
Warehouse string `json:"warehouse"` | ||
Database string `json:"database"` | ||
Schema string `json:"schema"` | ||
Table string `json:"table"` | ||
Mode *parameter.NullableString `json:"mode,omitempty"` | ||
EmptyFieldAsNull *parameter.NullableBool `json:"empty_field_as_null,omitempty"` | ||
DeleteStageOnError *parameter.NullableBool `json:"delete_stage_on_error,omitempty"` | ||
BatchSize *parameter.NullableInt64 `json:"batch_size,omitempty"` | ||
RetryLimit *parameter.NullableInt64 `json:"retry_limit,omitempty"` | ||
RetryWait *parameter.NullableInt64 `json:"retry_wait,omitempty"` | ||
MaxRetryWait *parameter.NullableInt64 `json:"max_retry_wait,omitempty"` | ||
DefaultTimeZone *parameter.NullableString `json:"default_time_zone,omitempty"` | ||
SnowflakeConnectionId int64 `json:"snowflake_connection_id"` | ||
SnowflakeOutputOptionColumnOptions *parameter.NullableObjectList[SnowflakeOutputOptionColumnOptionInput] `json:"snowflake_output_option_column_options,omitempty"` | ||
SnowflakeOutputOptionMergeKeys *parameter.NullableObjectList[string] `json:"snowflake_output_option_merge_keys,omitempty"` | ||
CustomVariableSettings *[]parameter.CustomVariableSettingInput `json:"custom_variable_settings,omitempty"` | ||
} | ||
|
||
type UpdateSnowflakeOutputOptionInput struct { | ||
Warehouse *string `json:"warehouse,omitempty"` | ||
Database *string `json:"database,omitempty"` | ||
Schema *string `json:"schema,omitempty"` | ||
Table *string `json:"table,omitempty"` | ||
Mode *parameter.NullableString `json:"mode,omitempty"` | ||
EmptyFieldAsNull *parameter.NullableBool `json:"empty_field_as_null,omitempty"` | ||
DeleteStageOnError *parameter.NullableBool `json:"delete_stage_on_error,omitempty"` | ||
BatchSize *parameter.NullableInt64 `json:"batch_size,omitempty"` | ||
RetryLimit *parameter.NullableInt64 `json:"retry_limit,omitempty"` | ||
RetryWait *parameter.NullableInt64 `json:"retry_wait,omitempty"` | ||
MaxRetryWait *parameter.NullableInt64 `json:"max_retry_wait,omitempty"` | ||
DefaultTimeZone *parameter.NullableString `json:"default_time_zone,omitempty"` | ||
SnowflakeConnectionId *int64 `json:"snowflake_connection_id,omitempty"` | ||
SnowflakeOutputOptionColumnOptions *parameter.NullableObjectList[SnowflakeOutputOptionColumnOptionInput] `json:"snowflake_output_option_column_options,omitempty"` | ||
SnowflakeOutputOptionMergeKeys *parameter.NullableObjectList[string] `json:"snowflake_output_option_merge_keys,omitempty"` | ||
CustomVariableSettings *[]parameter.CustomVariableSettingInput `json:"custom_variable_settings,omitempty"` | ||
} | ||
|
||
type SnowflakeOutputOptionColumnOptionInput struct { | ||
Name string `json:"name"` | ||
Type string `json:"type"` | ||
ValueType *string `json:"value_type,omitempty"` | ||
TimestampFormat *string `json:"timestamp_format,omitempty"` | ||
Timezone *string `json:"timezone,omitempty"` | ||
} |
Oops, something went wrong.