Documentation ¶
Overview ¶
todo: remove this https://snowflakecomputing.atlassian.net/browse/SNOW-1205579
Index ¶
- func Contains(s []string, str string) bool
- func DropIntegration(db *sql.DB, name string) error
- func EscapeSnowflakeString(in string) string
- func EscapeString(in string) string
- func Exec(db *sql.DB, query string) error
- func ExecMulti(db *sql.DB, queries []string) error
- func Query(db *sql.DB, stmt string) (*sqlx.Rows, error)
- func QueryRow(db *sql.DB, stmt string) *sqlx.Row
- func QuoteStringList(instrings []string) []string
- func SystemGetPrivateLinkConfigQuery() string
- func SystemGetSnowflakePlatformInfoQuery() string
- func UnescapeSnowflakeString(in string) string
- type AWSSNSIAMPolicy
- type AlterPropertiesBuilder
- func (ab *AlterPropertiesBuilder) GetTagValueString() string
- func (ab *AlterPropertiesBuilder) SetBool(key string, value bool)
- func (ab *AlterPropertiesBuilder) SetFloat(key string, value float64)
- func (ab *AlterPropertiesBuilder) SetInt(key string, value int)
- func (ab *AlterPropertiesBuilder) SetRaw(rawStatement string)
- func (ab *AlterPropertiesBuilder) SetString(key, value string)
- func (ab *AlterPropertiesBuilder) SetStringList(key string, value []string)
- func (ab *AlterPropertiesBuilder) SetTags(tags []TagValue)
- func (ab *AlterPropertiesBuilder) Statement() string
- type AnyRoleMode
- type BaseManager
- type Builder
- type ColumnIdentifier
- type CreateBuilder
- func (b *CreateBuilder) GetTagValueString() string
- func (b *CreateBuilder) SetBool(key string, value bool)
- func (b *CreateBuilder) SetFloat(key string, value float64)
- func (b *CreateBuilder) SetInt(key string, value int)
- func (b *CreateBuilder) SetRaw(rawStatement string)
- func (b *CreateBuilder) SetString(key, value string)
- func (b *CreateBuilder) SetStringList(key string, value []string)
- func (b *CreateBuilder) SetTags(tags []TagValue)
- func (b *CreateBuilder) Statement() string
- type EntityType
- type ExternalOauthIntegration3
- type ExternalOauthIntegration3CreateInput
- type ExternalOauthIntegration3DeleteInput
- type ExternalOauthIntegration3Manager
- func (m *ExternalOauthIntegration3Manager) Create(x *ExternalOauthIntegration3CreateInput) (string, error)
- func (m *ExternalOauthIntegration3Manager) Delete(x *ExternalOauthIntegration3DeleteInput) (string, error)
- func (m *ExternalOauthIntegration3Manager) ParseDescribe(rows *sql.Rows) (*ExternalOauthIntegration3ReadOutput, error)
- func (m *ExternalOauthIntegration3Manager) ParseShow(row *sqlx.Row) (*ExternalOauthIntegration3ReadOutput, error)
- func (m *ExternalOauthIntegration3Manager) ReadDescribe(x *ExternalOauthIntegration3ReadInput) (string, error)
- func (m *ExternalOauthIntegration3Manager) ReadShow(x *ExternalOauthIntegration3ReadInput) (string, error)
- func (m *ExternalOauthIntegration3Manager) Unset(x *ExternalOauthIntegration3UpdateInput) (string, error)
- func (m *ExternalOauthIntegration3Manager) Update(x *ExternalOauthIntegration3UpdateInput) (string, error)
- type ExternalOauthIntegration3ReadInput
- type ExternalOauthIntegration3ReadOutput
- type ExternalOauthIntegration3UpdateInput
- type ExternalOauthType
- type Identifier
- type KeywordPosition
- type MaskingPolicyBuilder
- type OauthIntegration
- type ParamType
- type PlatformInfo
- type PrivateLinkConfig
- type RawPlatformInfo
- type RawPrivateLinkConfig
- type SCIMAccessToken
- type SCIMIntegration
- type SFUserMappingAttribute
- type SQLBuilder
- func (b *SQLBuilder) Alter(obj Identifier) (string, error)
- func (b *SQLBuilder) Create(obj Identifier) (string, error)
- func (b *SQLBuilder) Describe(obj Identifier) (string, error)
- func (b *SQLBuilder) Drop(obj Identifier) (string, error)
- func (b *SQLBuilder) ParseDescribe(rows *sql.Rows, obj Identifier) error
- func (b *SQLBuilder) ShowLike(obj Identifier) (string, error)
- func (b *SQLBuilder) Unset(obj Identifier) (string, error)
- type SQLBuilderConfig
- type SQLParameter
- type SamlIntegration
- type SchemaIdentifier
- type SchemaObjectIdentifier
- type SettingBuilder
- type StageBuilder
- func (sb *StageBuilder) AddTag(tag TagValue) string
- func (sb *StageBuilder) ChangeComment(c string) string
- func (sb *StageBuilder) ChangeCopyOptions(c string) string
- func (sb *StageBuilder) ChangeCredentials(c string) string
- func (sb *StageBuilder) ChangeEncryption(e string) string
- func (sb *StageBuilder) ChangeFileFormat(f string) string
- func (sb *StageBuilder) ChangeStorageIntegration(s string) string
- func (sb *StageBuilder) ChangeStorageIntegrationAndUrl(s string, url string) string
- func (sb *StageBuilder) ChangeTag(tag TagValue) string
- func (sb *StageBuilder) ChangeURL(u string) string
- func (sb *StageBuilder) Create() string
- func (sb *StageBuilder) QualifiedName() string
- func (sb *StageBuilder) RemoveComment() string
- func (sb *StageBuilder) Rename(newName string) string
- func (sb *StageBuilder) UnsetTag(tag TagValue) string
- func (sb *StageBuilder) WithComment(c string) *StageBuilder
- func (sb *StageBuilder) WithCopyOptions(c string) *StageBuilder
- func (sb *StageBuilder) WithCredentials(c string) *StageBuilder
- func (sb *StageBuilder) WithDirectory(d string) *StageBuilder
- func (sb *StageBuilder) WithEncryption(e string) *StageBuilder
- func (sb *StageBuilder) WithFileFormat(f string) *StageBuilder
- func (sb *StageBuilder) WithStorageIntegration(s string) *StageBuilder
- func (sb *StageBuilder) WithTags(tags []TagValue) *StageBuilder
- func (sb *StageBuilder) WithURL(u string) *StageBuilder
- type SystemGenerateSCIMAccessTokenBuilder
- type SystemGetAWSSNSIAMPolicyBuilder
- type TableColumn
- type TableColumnMaskingPolicyApplication
- type TableColumnMaskingPolicyApplicationCreateInput
- type TableColumnMaskingPolicyApplicationDeleteInput
- type TableColumnMaskingPolicyApplicationManager
- func (m *TableColumnMaskingPolicyApplicationManager) Create(x *TableColumnMaskingPolicyApplicationCreateInput) string
- func (m *TableColumnMaskingPolicyApplicationManager) Delete(x *TableColumnMaskingPolicyApplicationDeleteInput) string
- func (m *TableColumnMaskingPolicyApplicationManager) Parse(rows *sql.Rows, column string) (string, error)
- func (m *TableColumnMaskingPolicyApplicationManager) Read(x *TableColumnMaskingPolicyApplicationReadInput) string
- type TableColumnMaskingPolicyApplicationReadInput
- type Tag
- type TagBuilder
- type TagPolicyAttachment
- type TagValue
- type TopLevelIdentifier
- type ViewSelectStatementExtractor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EscapeSnowflakeString ¶ added in v0.34.0
EscapeSnowflakeString will escape single quotes with the SQL native double single quote.
func EscapeString ¶
EscapeString will escape only the ' character. Would prefer a more robust OSS solution, but this should prevent some dumb errors for now.
func Query ¶ added in v0.34.0
Query will run stmt against the db and return the rows. We use [DB.Unsafe](https://godoc.org/github.com/jmoiron/sqlx#DB.Unsafe) so that we can scan to structs without worrying about newly introduced columns.
func QueryRow ¶ added in v0.34.0
QueryRow will run stmt against the db and return the row. We use [DB.Unsafe](https://godoc.org/github.com/jmoiron/sqlx#DB.Unsafe) so that we can scan to structs without worrying about newly introduced columns.
func QuoteStringList ¶ added in v0.86.0
func SystemGetPrivateLinkConfigQuery ¶ added in v0.34.0
func SystemGetPrivateLinkConfigQuery() string
func SystemGetSnowflakePlatformInfoQuery ¶ added in v0.34.0
func SystemGetSnowflakePlatformInfoQuery() string
func UnescapeSnowflakeString ¶ added in v0.34.0
UnescapeSnowflakeString reverses EscapeSnowflakeString.
Types ¶
type AWSSNSIAMPolicy ¶ added in v0.54.0
type AWSSNSIAMPolicy struct {
Policy string `db:"policy"`
}
func ScanAWSSNSIAMPolicy ¶ added in v0.34.0
func ScanAWSSNSIAMPolicy(row *sqlx.Row) (*AWSSNSIAMPolicy, error)
ScanAWSSNSIAMPolicy convert a result into a.
type AlterPropertiesBuilder ¶ added in v0.3.0
type AlterPropertiesBuilder struct {
// contains filtered or unexported fields
}
func (*AlterPropertiesBuilder) GetTagValueString ¶ added in v0.34.0
func (ab *AlterPropertiesBuilder) GetTagValueString() string
func (*AlterPropertiesBuilder) SetBool ¶ added in v0.3.0
func (ab *AlterPropertiesBuilder) SetBool(key string, value bool)
func (*AlterPropertiesBuilder) SetFloat ¶ added in v0.34.0
func (ab *AlterPropertiesBuilder) SetFloat(key string, value float64)
func (*AlterPropertiesBuilder) SetInt ¶ added in v0.3.0
func (ab *AlterPropertiesBuilder) SetInt(key string, value int)
func (*AlterPropertiesBuilder) SetRaw ¶ added in v0.34.0
func (ab *AlterPropertiesBuilder) SetRaw(rawStatement string)
func (*AlterPropertiesBuilder) SetString ¶ added in v0.3.0
func (ab *AlterPropertiesBuilder) SetString(key, value string)
func (*AlterPropertiesBuilder) SetStringList ¶ added in v0.34.0
func (ab *AlterPropertiesBuilder) SetStringList(key string, value []string)
func (*AlterPropertiesBuilder) SetTags ¶ added in v0.34.0
func (ab *AlterPropertiesBuilder) SetTags(tags []TagValue)
func (*AlterPropertiesBuilder) Statement ¶ added in v0.3.0
func (ab *AlterPropertiesBuilder) Statement() string
type AnyRoleMode ¶ added in v0.62.0
type AnyRoleMode string
const ( Disable AnyRoleMode = "DISABLE" Enable AnyRoleMode = "ENABLE" EnableForPrivilege AnyRoleMode = "ENABLE_FOR_PRIVILEGE" )
type BaseManager ¶ added in v0.62.0
type BaseManager struct {
// contains filtered or unexported fields
}
func (*BaseManager) Ok ¶ added in v0.62.0
func (m *BaseManager) Ok(_ interface{}, ok bool) bool
type Builder ¶ added in v0.3.0
type Builder struct {
// contains filtered or unexported fields
}
func NewOAuthIntegrationBuilder ¶ added in v0.54.0
OAuthIntegration returns a pointer to a Builder that abstracts the DDL operations for an api integration.
Supported DDL operations are:
- CREATE SECURITY INTEGRATION
- ALTER SECURITY INTEGRATION
- DROP INTEGRATION
- SHOW INTEGRATIONS
- DESCRIBE INTEGRATION
[Snowflake Reference](https://docs.snowflake.com/en/sql-reference/ddl-user-security.html#security-integrations)
func NewSCIMIntegrationBuilder ¶ added in v0.54.0
NewSCIMIntegrationBuilder returns a pointer to a Builder that abstracts the DDL operations for an api integration.
Supported DDL operations are:
- CREATE SECURITY INTEGRATION
- ALTER SECURITY INTEGRATION
- DROP INTEGRATION
- SHOW INTEGRATIONS
- DESCRIBE INTEGRATION
[Snowflake Reference](https://docs.snowflake.com/en/sql-reference/ddl-user-security.html#security-integrations)
func NewSamlIntegrationBuilder ¶ added in v0.54.0
SamlIntegration returns a pointer to a Builder that abstracts the DDL operations for a SAML2 integration.
Supported DDL operations are:
- CREATE SECURITY INTEGRATION
- ALTER SECURITY INTEGRATION
- DROP INTEGRATION
- SHOW INTEGRATIONS
- DESCRIBE INTEGRATION
[Snowflake Reference](https://docs.snowflake.com/en/sql-reference/ddl-user-security.html#security-integrations)
func (*Builder) Alter ¶ added in v0.3.0
func (b *Builder) Alter() *AlterPropertiesBuilder
func (*Builder) Create ¶ added in v0.3.0
func (b *Builder) Create() *CreateBuilder
type ColumnIdentifier ¶ added in v0.63.0
type ColumnIdentifier struct { Database string Schema string ObjectName string `db:"NAME"` Column string }
func ColumnIdentifierFromQualifiedName ¶ added in v0.63.0
func ColumnIdentifierFromQualifiedName(name string) *ColumnIdentifier
func (*ColumnIdentifier) QualifiedName ¶ added in v0.63.0
func (i *ColumnIdentifier) QualifiedName() string
type CreateBuilder ¶ added in v0.3.0
type CreateBuilder struct {
// contains filtered or unexported fields
}
func (*CreateBuilder) GetTagValueString ¶ added in v0.34.0
func (b *CreateBuilder) GetTagValueString() string
func (*CreateBuilder) SetBool ¶ added in v0.3.0
func (b *CreateBuilder) SetBool(key string, value bool)
func (*CreateBuilder) SetFloat ¶ added in v0.34.0
func (b *CreateBuilder) SetFloat(key string, value float64)
func (*CreateBuilder) SetInt ¶ added in v0.3.0
func (b *CreateBuilder) SetInt(key string, value int)
func (*CreateBuilder) SetRaw ¶ added in v0.34.0
func (b *CreateBuilder) SetRaw(rawStatement string)
func (*CreateBuilder) SetString ¶ added in v0.3.0
func (b *CreateBuilder) SetString(key, value string)
func (*CreateBuilder) SetStringList ¶ added in v0.34.0
func (b *CreateBuilder) SetStringList(key string, value []string)
func (*CreateBuilder) SetTags ¶ added in v0.34.0
func (b *CreateBuilder) SetTags(tags []TagValue)
func (*CreateBuilder) Statement ¶ added in v0.3.0
func (b *CreateBuilder) Statement() string
type EntityType ¶ added in v0.3.0
type EntityType string
const (
SecurityIntegrationType EntityType = "SECURITY INTEGRATION"
)
type ExternalOauthIntegration3 ¶ added in v0.62.0
type ExternalOauthIntegration3 struct { TopLevelIdentifier Type string `pos:"parameter" db:"type"` TypeOk bool Enabled bool `pos:"parameter" db:"enabled"` EnabledOk bool ExternalOauthType ExternalOauthType `pos:"parameter" db:"EXTERNAL_OAUTH_TYPE"` ExternalOauthTypeOk bool ExternalOauthIssuer string `pos:"parameter" db:"EXTERNAL_OAUTH_ISSUER"` ExternalOauthIssuerOk bool ExternalOauthTokenUserMappingClaim []string `pos:"parameter" db:"EXTERNAL_OAUTH_TOKEN_USER_MAPPING_CLAIM"` ExternalOauthTokenUserMappingClaimOk bool ExternalOauthSnowflakeUserMappingAttribute SFUserMappingAttribute `pos:"parameter" db:"EXTERNAL_OAUTH_SNOWFLAKE_USER_MAPPING_ATTRIBUTE"` ExternalOauthSnowflakeUserMappingAttributeOk bool ExternalOauthJwsKeysURL []string `pos:"parameter" db:"EXTERNAL_OAUTH_JWS_KEYS_URL"` ExternalOauthJwsKeysURLOk bool ExternalOauthBlockedRolesList []string `pos:"parameter" db:"EXTERNAL_OAUTH_BLOCKED_ROLES_LIST"` ExternalOauthBlockedRolesListOk bool ExternalOauthAllowedRolesList []string `pos:"parameter" db:"EXTERNAL_OAUTH_ALLOWED_ROLES_LIST"` ExternalOauthAllowedRolesListOk bool ExternalOauthRsaPublicKey string `pos:"parameter" db:"EXTERNAL_OAUTH_RSA_PUBLIC_KEY"` ExternalOauthRsaPublicKeyOk bool ExternalOauthRsaPublicKey2 string `pos:"parameter" db:"EXTERNAL_OAUTH_RSA_PUBLIC_KEY_2"` ExternalOauthRsaPublicKey2Ok bool ExternalOauthAudienceList []string `pos:"parameter" db:"EXTERNAL_OAUTH_AUDIENCE_LIST"` ExternalOauthAudienceListOk bool ExternalOauthAnyRoleMode AnyRoleMode `pos:"parameter" db:"EXTERNAL_OAUTH_ANY_ROLE_MODE"` ExternalOauthAnyRoleModeOk bool ExternalOauthScopeDelimiter string `pos:"parameter" db:"EXTERNAL_OAUTH_SCOPE_DELIMITER"` ExternalOauthScopeDelimiterOk bool ExternalOauthScopeMappingAttribute string `pos:"parameter" db:"EXTERNAL_OAUTH_SCOPE_MAPPING_ATTRIBUTE"` ExternalOauthScopeMappingAttributeOk bool Comment sql.NullString `pos:"parameter" db:"comment"` CommentOk bool }
type ExternalOauthIntegration3CreateInput ¶ added in v0.62.0
type ExternalOauthIntegration3CreateInput struct { ExternalOauthIntegration3 OrReplace bool `pos:"beforeObjectType" value:"OR REPLACE"` OrReplaceOk bool IfNotExists bool `pos:"afterObjectType" value:"IF NOT EXISTS"` IfNotExistsOk bool }
type ExternalOauthIntegration3DeleteInput ¶ added in v0.62.0
type ExternalOauthIntegration3DeleteInput struct { TopLevelIdentifier IfExists bool `pos:"afterObjectType" value:"IF EXISTS"` IfExistsOk bool }
type ExternalOauthIntegration3Manager ¶ added in v0.62.0
type ExternalOauthIntegration3Manager struct {
BaseManager
}
func NewExternalOauthIntegration3Manager ¶ added in v0.62.0
func NewExternalOauthIntegration3Manager() (*ExternalOauthIntegration3Manager, error)
func (*ExternalOauthIntegration3Manager) Create ¶ added in v0.62.0
func (m *ExternalOauthIntegration3Manager) Create(x *ExternalOauthIntegration3CreateInput) (string, error)
func (*ExternalOauthIntegration3Manager) Delete ¶ added in v0.62.0
func (m *ExternalOauthIntegration3Manager) Delete(x *ExternalOauthIntegration3DeleteInput) (string, error)
func (*ExternalOauthIntegration3Manager) ParseDescribe ¶ added in v0.62.0
func (m *ExternalOauthIntegration3Manager) ParseDescribe(rows *sql.Rows) (*ExternalOauthIntegration3ReadOutput, error)
func (*ExternalOauthIntegration3Manager) ParseShow ¶ added in v0.62.0
func (m *ExternalOauthIntegration3Manager) ParseShow(row *sqlx.Row) (*ExternalOauthIntegration3ReadOutput, error)
func (*ExternalOauthIntegration3Manager) ReadDescribe ¶ added in v0.62.0
func (m *ExternalOauthIntegration3Manager) ReadDescribe(x *ExternalOauthIntegration3ReadInput) (string, error)
func (*ExternalOauthIntegration3Manager) ReadShow ¶ added in v0.62.0
func (m *ExternalOauthIntegration3Manager) ReadShow(x *ExternalOauthIntegration3ReadInput) (string, error)
func (*ExternalOauthIntegration3Manager) Unset ¶ added in v0.62.0
func (m *ExternalOauthIntegration3Manager) Unset(x *ExternalOauthIntegration3UpdateInput) (string, error)
func (*ExternalOauthIntegration3Manager) Update ¶ added in v0.62.0
func (m *ExternalOauthIntegration3Manager) Update(x *ExternalOauthIntegration3UpdateInput) (string, error)
type ExternalOauthIntegration3ReadInput ¶ added in v0.62.0
type ExternalOauthIntegration3ReadInput = TopLevelIdentifier
type ExternalOauthIntegration3ReadOutput ¶ added in v0.62.0
type ExternalOauthIntegration3ReadOutput = ExternalOauthIntegration3
type ExternalOauthIntegration3UpdateInput ¶ added in v0.62.0
type ExternalOauthIntegration3UpdateInput struct { ExternalOauthIntegration3 IfExists bool `pos:"afterObjectType" value:"IF EXISTS"` IfExistsOk bool }
type ExternalOauthType ¶ added in v0.62.0
type ExternalOauthType string
const ( Okta ExternalOauthType = "OKTA" Azure ExternalOauthType = "AZURE" PingFederate ExternalOauthType = "PING_FEDERATE" Custom ExternalOauthType = "CUSTOM" )
type Identifier ¶ added in v0.62.0
type Identifier interface {
QualifiedName() string
}
type KeywordPosition ¶ added in v0.62.0
type KeywordPosition = string
const ( BeforeObjectType KeywordPosition = "beforeObjectType" AfterObjectType KeywordPosition = "afterObjectType" PosParameter KeywordPosition = "parameter" )
type MaskingPolicyBuilder ¶ added in v0.34.0
type MaskingPolicyBuilder struct {
// contains filtered or unexported fields
}
MaskingPolicyBuilder abstracts the creation of SQL queries for a Snowflake Masking Policy.
func MaskingPolicy ¶ added in v0.34.0
func MaskingPolicy(name, db, schema string) *MaskingPolicyBuilder
MaskingPolicy returns a pointer to a Builder that abstracts the DDL operations for a masking policy.
Supported DDL operations are:
- CREATE MASKING POLICY
- ALTER MASKING POLICY
- DROP MASKING POLICY
- SHOW MASKING POLICIES
- DESCRIBE MASKING POLICY
[Snowflake Reference](https://docs.snowflake.com/en/user-guide/security-column-ddm.html)
func (*MaskingPolicyBuilder) QualifiedName ¶ added in v0.34.0
func (mpb *MaskingPolicyBuilder) QualifiedName() string
QualifiedName prepends the db and schema if set and escapes everything nicely.
type OauthIntegration ¶ added in v0.54.0
type OauthIntegration struct { Name sql.NullString `db:"name"` Category sql.NullString `db:"category"` IntegrationType sql.NullString `db:"type"` Enabled sql.NullBool `db:"enabled"` Comment sql.NullString `db:"comment"` CreatedOn sql.NullString `db:"created_on"` }
func ListIntegrations ¶ added in v0.48.0
func ListIntegrations(db *sql.DB) ([]OauthIntegration, error)
func ScanOAuthIntegration ¶ added in v0.34.0
func ScanOAuthIntegration(row *sqlx.Row) (*OauthIntegration, error)
type PlatformInfo ¶ added in v0.54.0
type PrivateLinkConfig ¶ added in v0.34.0
type RawPlatformInfo ¶ added in v0.54.0
type RawPlatformInfo struct {
Info string `db:"INFO"`
}
func ScanSnowflakePlatformInfo ¶ added in v0.34.0
func ScanSnowflakePlatformInfo(row *sqlx.Row) (*RawPlatformInfo, error)
func (*RawPlatformInfo) GetStructuredConfig ¶ added in v0.54.0
func (r *RawPlatformInfo) GetStructuredConfig() (*PlatformInfo, error)
type RawPrivateLinkConfig ¶ added in v0.34.0
type RawPrivateLinkConfig struct {
Config string `db:"config"`
}
func ScanPrivateLinkConfig ¶ added in v0.34.0
func ScanPrivateLinkConfig(row *sqlx.Row) (*RawPrivateLinkConfig, error)
func (*RawPrivateLinkConfig) GetStructuredConfig ¶ added in v0.34.0
func (r *RawPrivateLinkConfig) GetStructuredConfig() (*PrivateLinkConfig, error)
type SCIMAccessToken ¶ added in v0.54.0
type SCIMAccessToken struct {
Token string `db:"TOKEN"`
}
func ScanSCIMAccessToken ¶ added in v0.34.0
func ScanSCIMAccessToken(row *sqlx.Row) (*SCIMAccessToken, error)
ScanSCIMAccessToken convert a result into a.
type SCIMIntegration ¶ added in v0.54.0
type SCIMIntegration struct { Name sql.NullString `db:"name"` Category sql.NullString `db:"category"` IntegrationType sql.NullString `db:"type"` CreatedOn sql.NullString `db:"created_on"` }
func ScanScimIntegration ¶ added in v0.34.0
func ScanScimIntegration(row *sqlx.Row) (*SCIMIntegration, error)
type SFUserMappingAttribute ¶ added in v0.62.0
type SFUserMappingAttribute string
const ( LoginName SFUserMappingAttribute = "LOGIN_NAME" EmailAddress SFUserMappingAttribute = "EMAIL_ADDRESS" )
type SQLBuilder ¶ added in v0.62.0
type SQLBuilder struct {
// contains filtered or unexported fields
}
func (*SQLBuilder) Alter ¶ added in v0.62.0
func (b *SQLBuilder) Alter(obj Identifier) (string, error)
func (*SQLBuilder) Create ¶ added in v0.62.0
func (b *SQLBuilder) Create(obj Identifier) (string, error)
func (*SQLBuilder) Describe ¶ added in v0.62.0
func (b *SQLBuilder) Describe(obj Identifier) (string, error)
func (*SQLBuilder) Drop ¶ added in v0.62.0
func (b *SQLBuilder) Drop(obj Identifier) (string, error)
func (*SQLBuilder) ParseDescribe ¶ added in v0.62.0
func (b *SQLBuilder) ParseDescribe(rows *sql.Rows, obj Identifier) error
func (*SQLBuilder) ShowLike ¶ added in v0.62.0
func (b *SQLBuilder) ShowLike(obj Identifier) (string, error)
func (*SQLBuilder) Unset ¶ added in v0.62.0
func (b *SQLBuilder) Unset(obj Identifier) (string, error)
type SQLBuilderConfig ¶ added in v0.62.0
type SQLBuilderConfig struct {
// contains filtered or unexported fields
}
type SQLParameter ¶ added in v0.62.0
type SQLParameter struct {
// contains filtered or unexported fields
}
type SamlIntegration ¶ added in v0.34.0
type SamlIntegration struct { Name sql.NullString `db:"name"` Category sql.NullString `db:"category"` IntegrationType sql.NullString `db:"type"` CreatedOn sql.NullString `db:"created_on"` Enabled sql.NullBool `db:"enabled"` }
func ScanSamlIntegration ¶ added in v0.34.0
func ScanSamlIntegration(row *sqlx.Row) (*SamlIntegration, error)
type SchemaIdentifier ¶ added in v0.62.0
func (*SchemaIdentifier) QualifiedName ¶ added in v0.62.0
func (i *SchemaIdentifier) QualifiedName() string
type SchemaObjectIdentifier ¶ added in v0.62.0
func SchemaObjectIdentifierFromQualifiedName ¶ added in v0.62.0
func SchemaObjectIdentifierFromQualifiedName(name string) *SchemaObjectIdentifier
func (*SchemaObjectIdentifier) QualifiedName ¶ added in v0.62.0
func (i *SchemaObjectIdentifier) QualifiedName() string
type SettingBuilder ¶ added in v0.34.0
type SettingBuilder interface { SetString(string, string) SetStringList(string, []string) SetBool(string, bool) SetInt(string, int) SetFloat(string, float64) SetRaw(string) }
SettingBuilder is an interface for a builder that allows you to set key value pairs.
type StageBuilder ¶ added in v0.34.0
type StageBuilder struct {
// contains filtered or unexported fields
}
StageBuilder abstracts the creation of SQL queries for a Snowflake stage.
func NewStageBuilder ¶ added in v0.54.0
func NewStageBuilder(name, db, schema string) *StageBuilder
Stage returns a pointer to a Builder that abstracts the DDL operations for a stage.
Supported DDL operations are:
- CREATE STAGE
- ALTER STAGE
- DROP STAGE
- UNDROP STAGE
- DESCRIBE STAGE
[Snowflake Reference](https://docs.snowflake.net/manuals/sql-reference/ddl-stage.html#stage-management)
func (*StageBuilder) AddTag ¶ added in v0.34.0
func (sb *StageBuilder) AddTag(tag TagValue) string
AddTag returns the SQL query that will add a new tag to the view.
func (*StageBuilder) ChangeComment ¶ added in v0.34.0
func (sb *StageBuilder) ChangeComment(c string) string
ChangeComment returns the SQL query that will update the comment on the stage.
func (*StageBuilder) ChangeCopyOptions ¶ added in v0.34.0
func (sb *StageBuilder) ChangeCopyOptions(c string) string
ChangeCopyOptions returns the SQL query that will update the copy options on the stage.
func (*StageBuilder) ChangeCredentials ¶ added in v0.34.0
func (sb *StageBuilder) ChangeCredentials(c string) string
ChangeCredentials returns the SQL query that will update the credentials on the stage.
func (*StageBuilder) ChangeEncryption ¶ added in v0.34.0
func (sb *StageBuilder) ChangeEncryption(e string) string
ChangeEncryption returns the SQL query that will update the encryption on the stage.
func (*StageBuilder) ChangeFileFormat ¶ added in v0.34.0
func (sb *StageBuilder) ChangeFileFormat(f string) string
ChangeFileFormat returns the SQL query that will update the file format on the stage.
func (*StageBuilder) ChangeStorageIntegration ¶ added in v0.34.0
func (sb *StageBuilder) ChangeStorageIntegration(s string) string
ChangeStorageIntegration returns the SQL query that will update the storage integration on the stage.
func (*StageBuilder) ChangeStorageIntegrationAndUrl ¶ added in v0.70.0
func (sb *StageBuilder) ChangeStorageIntegrationAndUrl(s string, url string) string
func (*StageBuilder) ChangeTag ¶ added in v0.34.0
func (sb *StageBuilder) ChangeTag(tag TagValue) string
ChangeTag returns the SQL query that will alter a tag on the view.
func (*StageBuilder) ChangeURL ¶ added in v0.34.0
func (sb *StageBuilder) ChangeURL(u string) string
ChangeURL returns the SQL query that will update the url on the stage.
func (*StageBuilder) Create ¶ added in v0.34.0
func (sb *StageBuilder) Create() string
Create returns the SQL query that will create a new stage.
func (*StageBuilder) QualifiedName ¶ added in v0.34.0
func (sb *StageBuilder) QualifiedName() string
QualifiedName prepends the db and schema and escapes everything nicely.
func (*StageBuilder) RemoveComment ¶ added in v0.34.0
func (sb *StageBuilder) RemoveComment() string
RemoveComment returns the SQL query that will remove the comment on the stage.
func (*StageBuilder) Rename ¶ added in v0.34.0
func (sb *StageBuilder) Rename(newName string) string
Rename returns the SQL query that will rename the stage.
func (*StageBuilder) UnsetTag ¶ added in v0.34.0
func (sb *StageBuilder) UnsetTag(tag TagValue) string
UnsetTag returns the SQL query that will unset a tag on the view.
func (*StageBuilder) WithComment ¶ added in v0.34.0
func (sb *StageBuilder) WithComment(c string) *StageBuilder
WithComment adds a comment to the StageBuilder.
func (*StageBuilder) WithCopyOptions ¶ added in v0.34.0
func (sb *StageBuilder) WithCopyOptions(c string) *StageBuilder
WithCopyOptions adds copy options to the StageBuilder.
func (*StageBuilder) WithCredentials ¶ added in v0.34.0
func (sb *StageBuilder) WithCredentials(c string) *StageBuilder
WithCredentials adds credentials to the StageBuilder.
func (*StageBuilder) WithDirectory ¶ added in v0.34.0
func (sb *StageBuilder) WithDirectory(d string) *StageBuilder
WithDirectory adds directory option to the StageBuilder.
func (*StageBuilder) WithEncryption ¶ added in v0.34.0
func (sb *StageBuilder) WithEncryption(e string) *StageBuilder
WithEncryption adds encryption to the StageBuilder.
func (*StageBuilder) WithFileFormat ¶ added in v0.34.0
func (sb *StageBuilder) WithFileFormat(f string) *StageBuilder
WithFileFormat adds a file format to the StageBuilder.
func (*StageBuilder) WithStorageIntegration ¶ added in v0.34.0
func (sb *StageBuilder) WithStorageIntegration(s string) *StageBuilder
WithStorageIntegration adds a storage integration to the StageBuilder.
func (*StageBuilder) WithTags ¶ added in v0.34.0
func (sb *StageBuilder) WithTags(tags []TagValue) *StageBuilder
WithTags sets the tags on the ExternalTableBuilder.
func (*StageBuilder) WithURL ¶ added in v0.34.0
func (sb *StageBuilder) WithURL(u string) *StageBuilder
WithURL adds a URL to the StageBuilder.
type SystemGenerateSCIMAccessTokenBuilder ¶ added in v0.34.0
type SystemGenerateSCIMAccessTokenBuilder struct {
// contains filtered or unexported fields
}
SystemGenerateSCIMAccessTokenBuilder abstracts calling the SYSTEM$GENERATE_SCIM_ACCESS_TOKEN system function.
func NewSystemGenerateSCIMAccessTokenBuilder ¶ added in v0.54.0
func NewSystemGenerateSCIMAccessTokenBuilder(integrationName string) *SystemGenerateSCIMAccessTokenBuilder
SystemGenerateSCIMAccessToken returns a pointer to a builder that abstracts calling the the SYSTEM$GENERATE_SCIM_ACCESS_TOKEN system function.
func (*SystemGenerateSCIMAccessTokenBuilder) Select ¶ added in v0.34.0
func (pb *SystemGenerateSCIMAccessTokenBuilder) Select() string
Select generates the select statement for obtaining the scim access token.
type SystemGetAWSSNSIAMPolicyBuilder ¶ added in v0.34.0
type SystemGetAWSSNSIAMPolicyBuilder struct {
// contains filtered or unexported fields
}
SystemGetAWSSNSIAMPolicyBuilder abstracts calling the SYSTEM$GET_AWS_SNS_IAM_POLICY system function.
func NewSystemGetAWSSNSIAMPolicyBuilder ¶ added in v0.54.0
func NewSystemGetAWSSNSIAMPolicyBuilder(awsSnsTopicArn string) *SystemGetAWSSNSIAMPolicyBuilder
SystemGetAWSSNSIAMPolicy returns a pointer to a builder that abstracts calling the the SYSTEM$GET_AWS_SNS_IAM_POLICY system function.
func (*SystemGetAWSSNSIAMPolicyBuilder) Select ¶ added in v0.34.0
func (pb *SystemGetAWSSNSIAMPolicyBuilder) Select() string
Select generates the select statement for obtaining the aws sns iam policy.
type TableColumn ¶ added in v0.63.0
type TableColumn struct { Table *SchemaObjectIdentifier Column string }
type TableColumnMaskingPolicyApplication ¶ added in v0.63.0
type TableColumnMaskingPolicyApplication struct { Table *SchemaObjectIdentifier Column string MaskingPolicy *SchemaObjectIdentifier }
type TableColumnMaskingPolicyApplicationCreateInput ¶ added in v0.63.0
type TableColumnMaskingPolicyApplicationCreateInput struct {
TableColumnMaskingPolicyApplication
}
type TableColumnMaskingPolicyApplicationDeleteInput ¶ added in v0.63.0
type TableColumnMaskingPolicyApplicationDeleteInput struct {
TableColumn
}
type TableColumnMaskingPolicyApplicationManager ¶ added in v0.63.0
type TableColumnMaskingPolicyApplicationManager struct{}
func NewTableColumnMaskingPolicyApplicationManager ¶ added in v0.63.0
func NewTableColumnMaskingPolicyApplicationManager() *TableColumnMaskingPolicyApplicationManager
type TableColumnMaskingPolicyApplicationReadInput ¶ added in v0.63.0
type TableColumnMaskingPolicyApplicationReadInput = TableColumn
type Tag ¶ added in v0.34.0
type Tag struct { Name sql.NullString `db:"name"` DatabaseName sql.NullString `db:"database_name"` SchemaName sql.NullString `db:"schema_name"` Comment sql.NullString `db:"comment"` AllowedValues sql.NullString `db:"allowed_values"` }
type TagBuilder ¶ added in v0.34.0
type TagBuilder struct {
// contains filtered or unexported fields
}
TagBuilder abstracts the creation of SQL queries for a Snowflake tag.
func NewTagBuilder ¶ added in v0.54.0
func NewTagBuilder(tid sdk.SchemaObjectIdentifier) *TagBuilder
Tag returns a pointer to a Builder that abstracts the DDL operations for a tag. [Snowflake Reference](https://docs.snowflake.com/en/user-guide/object-tagging.html)
func (*TagBuilder) ShowAttachedPolicy ¶ added in v0.43.0
func (tb *TagBuilder) ShowAttachedPolicy() string
Returns sql to show a tag with a specific policy attached to it.
func (*TagBuilder) WithMaskingPolicy ¶ added in v0.43.0
func (tb *TagBuilder) WithMaskingPolicy(mid sdk.SchemaObjectIdentifier) *TagBuilder
type TagPolicyAttachment ¶ added in v0.54.0
type TagPolicyAttachment struct { PolicyDB sql.NullString `db:"POLICY_DB"` PolicySchema sql.NullString `db:"POLICY_SCHEMA"` PolicyName sql.NullString `db:"POLICY_NAME"` PolicyKind sql.NullString `db:"POLICY_KIND"` RefDB sql.NullString `db:"REF_DATABASE_NAME"` RefSchema sql.NullString `db:"REF_SCHEMA_NAME"` RefEntity sql.NullString `db:"REF_ENTITY_NAME"` RefEntityDomain sql.NullString `db:"REF_ENTITY_DOMAIN"` }
func ScanTagPolicy ¶ added in v0.43.0
func ScanTagPolicy(row *sqlx.Row) (*TagPolicyAttachment, error)
type TopLevelIdentifier ¶ added in v0.62.0
type TopLevelIdentifier struct {
Name string
}
func TopLevelIdentifierFromQualifiedName ¶ added in v0.62.0
func TopLevelIdentifierFromQualifiedName(name string) *TopLevelIdentifier
func (*TopLevelIdentifier) QualifiedName ¶ added in v0.62.0
func (i *TopLevelIdentifier) QualifiedName() string
type ViewSelectStatementExtractor ¶ added in v0.34.0
type ViewSelectStatementExtractor struct {
// contains filtered or unexported fields
}
ViewSelectStatementExtractor is a simplistic parser that only exists to extract the select statement from a create view statement
The implementation is optimized for undertandable and predictable behavior. So far we only seek to support queries of the sort that are generated by this project.
Also there is little error handling and we assume queries are well-formed.
func NewViewSelectStatementExtractor ¶ added in v0.34.0
func NewViewSelectStatementExtractor(input string) *ViewSelectStatementExtractor
func (*ViewSelectStatementExtractor) Extract ¶ added in v0.34.0
func (e *ViewSelectStatementExtractor) Extract() (string, error)
func (*ViewSelectStatementExtractor) ExtractDynamicTable ¶ added in v0.86.0
func (e *ViewSelectStatementExtractor) ExtractDynamicTable() (string, error)
func (*ViewSelectStatementExtractor) ExtractMaterializedView ¶ added in v0.34.0
func (e *ViewSelectStatementExtractor) ExtractMaterializedView() (string, error)
Source Files ¶
- builder.go
- escaping.go
- exec.go
- external_oauth_integration.go
- generic.go
- identifier.go
- manager.go
- masking_policy.go
- masking_policy_application.go
- oauth_integration.go
- parser.go
- saml_integration.go
- scim_integration.go
- sorting.go
- stage.go
- system_generate_scim_access_token.go
- system_get_aws_sns_iam_policy.go
- system_get_privatelink_config.go
- system_get_snowflake_platform_info.go
- table.go
- tag.go