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 MergeMaps[M ~map[K]V, K comparable, V any](src ...M) M
- 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
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
TODO: use slices.Concat in Go 1.22
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 MergeMaps ¶ added in v0.93.0
func MergeMaps[M ~map[K]V, K comparable, V any](src ...M) M
TODO(SNOW-1479870): Test MergeMaps takes any number of maps (of the same type) and concatenates them. In case of key collision, the value will be selected from the map that is provided later in the src function parameter.
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 ¶
This section is empty.