Documentation ¶
Index ¶
- Constants
- func ConcatSlices[T any](slices ...[]T) []T
- func ContainsIdentifierIgnoringQuotes(ids []string, id string) bool
- func DecodeSnowflakeAccountIdentifier(identifier string) (sdk.AccountIdentifier, error)
- func DecodeSnowflakeID(id string) sdk.ObjectIdentifier
- func DecodeSnowflakeParameterID(identifier string) (sdk.ObjectIdentifier, error)
- func EncodeResourceIdentifier[...](parts ...T) string
- func EncodeSnowflakeID(attributes ...interface{}) string
- func ListContentToString(listString string) string
- func ParseResourceIdentifier(identifier string) []string
- func ParseRootLocation(location string) (sdk.SchemaObjectIdentifier, string, error)
- func RandomBool() bool
- func RandomIntRange(min, max int) int
- func RandomString() string
- func RandomStringRange(min, max int) string
- func StringToBool(s string) bool
- type ParsedExternalVolumeDescribed
- type StorageLocation
Constants ¶
const (
IDDelimiter = "|"
)
const ResourceIdDelimiter = '|'
Variables ¶
This section is empty.
Functions ¶
func ConcatSlices ¶ added in v0.93.0
func ConcatSlices[T any](slices ...[]T) []T
ConcatSlices is a temporary replacement for slices.Concat that will be available after we migrate to Go 1.22. TODO [SNOW-1844769]: use slices.Concat
func ContainsIdentifierIgnoringQuotes ¶ added in v0.94.0
ContainsIdentifierIgnoringQuotes takes ids (a slice of Snowflake identifiers represented as strings), and id (a string representing Snowflake id). It checks if id is contained within ids ignoring quotes around identifier parts.
The original quoting should be retrieved to avoid situations like "object" == "\"object\"" (true) where that should not be a truthful comparison (different ids). Right now, we assume this case won't happen because the quoting difference would only appear in cases where the identifier parts are upper-cased and returned without quotes by snowflake, e.g. "OBJECT" == "\"OBJECT\"" (true) which is correct (the same ids).
func DecodeSnowflakeAccountIdentifier ¶ added in v0.93.0
func DecodeSnowflakeAccountIdentifier(identifier string) (sdk.AccountIdentifier, error)
DecodeSnowflakeAccountIdentifier decodes account identifier (usually passed as one of the parameter in tf configuration) into sdk.AccountIdentifier. Check more in https://docs.snowflake.com/en/sql-reference/sql/create-account#required-parameters.
func DecodeSnowflakeID ¶ added in v0.64.0
func DecodeSnowflakeID(id string) sdk.ObjectIdentifier
func DecodeSnowflakeParameterID ¶ added in v0.75.0
func DecodeSnowflakeParameterID(identifier string) (sdk.ObjectIdentifier, error)
DecodeSnowflakeParameterID decodes identifier (usually passed as one of the parameter in tf configuration) into sdk.ObjectIdentifier. identifier can be specified in two ways: quoted and unquoted, e.g.
quoted { "some_identifier": "\"database.name\".\"schema.name\".\"test.name\" } (note that here dots as part of the name are allowed)
unquoted { "some_identifier": "database_name.schema_name.test_name" } (note that here dots as part of the name are NOT allowed, because they're treated in this case as dividers)
The following configuration { "some_identifier": "db.name" } will be parsed as an object called "name" that lives inside database called "db", not a database called "db.name". In this case quotes should be used.
func EncodeResourceIdentifier ¶ added in v0.95.0
func EncodeResourceIdentifier[T sdk.AccountObjectIdentifier | sdk.DatabaseObjectIdentifier | sdk.SchemaObjectIdentifier | sdk.SchemaObjectIdentifierWithArguments | sdk.TableColumnIdentifier | sdk.ExternalObjectIdentifier | sdk.AccountIdentifier | string](parts ...T) string
func EncodeSnowflakeID ¶ added in v0.64.0
func EncodeSnowflakeID(attributes ...interface{}) string
EncodeSnowflakeID generates a unique ID for a resource.
func ListContentToString ¶ added in v0.36.0
ListContentToString strips list elements of double quotes or brackets.
func ParseResourceIdentifier ¶ added in v0.95.0
func ParseRootLocation ¶ added in v0.94.0
func ParseRootLocation(location string) (sdk.SchemaObjectIdentifier, string, error)
TODO(SNOW-1569530): address during identifiers rework follow-up
func RandomBool ¶ added in v0.64.0
func RandomBool() bool
func RandomIntRange ¶ added in v0.64.0
func RandomString ¶ added in v0.64.0
func RandomString() string
func RandomStringRange ¶ added in v0.64.0
func StringToBool ¶ added in v0.62.0
StringToBool converts a string to a bool.
Types ¶
type ParsedExternalVolumeDescribed ¶ added in v0.98.0
type ParsedExternalVolumeDescribed struct { StorageLocations []StorageLocation Active string Comment string AllowWrites string }
func ParseExternalVolumeDescribed ¶ added in v0.98.0
func ParseExternalVolumeDescribed(props []sdk.ExternalVolumeProperty) (ParsedExternalVolumeDescribed, error)
type StorageLocation ¶ added in v0.98.0
type StorageLocation struct { Name string `json:"NAME"` StorageProvider string `json:"STORAGE_PROVIDER"` StorageBaseUrl string `json:"STORAGE_BASE_URL"` StorageAwsRoleArn string `json:"STORAGE_AWS_ROLE_ARN"` StorageAwsExternalId string `json:"STORAGE_AWS_EXTERNAL_ID"` EncryptionType string `json:"ENCRYPTION_TYPE"` EncryptionKmsKeyId string `json:"ENCRYPTION_KMS_KEY_ID"` AzureTenantId string `json:"AZURE_TENANT_ID"` }