Documentation ¶
Index ¶
- Constants
- Variables
- func AddressEscape(in ...string) string
- func ClusterStatementToList(clusterStatement string) []string
- 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 FlattenTablePrimaryKey(pkds []PrimaryKeyDescription) []interface{}
- func IsResourceNotExistOrNotAuthorized(errorString string, resourceType string) bool
- func JoinStringList(instrings []string, delimiter string) string
- func Query(db *sql.DB, stmt string) (*sqlx.Rows, error)
- func QueryRow(db *sql.DB, stmt string) *sqlx.Row
- func SelectCurrentAccount() string
- func SelectCurrentRole() string
- func SystemGetPrivateLinkConfigQuery() string
- func SystemGetSnowflakePlatformInfoQuery() string
- func UnescapeSnowflakeString(in string) string
- func UnescapeString(in string) string
- type APIIntegration
- type AWSSNSIAMPolicy
- type AllGrantBuilder
- type AllGrantExecutable
- type AllGrantTarget
- type AllGrantType
- 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
- func NewAPIIntegrationBuilder(name string) *Builder
- func NewEmailNotificationIntegrationBuilder(name string) *Builder
- func NewManagedAccountBuilder(name string) *Builder
- func NewNotificationIntegrationBuilder(name string) *Builder
- func NewOAuthIntegrationBuilder(name string) *Builder
- func NewSCIMIntegrationBuilder(name string) *Builder
- func NewSamlIntegrationBuilder(name string) *Builder
- func NewStorageIntegrationBuilder(name string) *Builder
- func NewUserBuilder(name string) *Builder
- type Column
- func (c *Column) WithComment(comment string) *Column
- func (c *Column) WithDefault(cd *ColumnDefault) *Column
- func (c *Column) WithIdentity(id *ColumnIdentity) *Column
- func (c *Column) WithMaskingPolicy(maskingPolicy string) *Column
- func (c *Column) WithName(name string) *Column
- func (c *Column) WithNullable(nullable bool) *Column
- func (c *Column) WithType(t string) *Column
- type ColumnDefault
- type ColumnDefaultType
- type ColumnIdentifier
- type ColumnIdentity
- type Columns
- 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 CurrentAccount
- type CurrentGrantBuilder
- type CurrentGrantExecutable
- type CurrentMaterializedViewGrantBuilder
- func (gb *CurrentMaterializedViewGrantBuilder) GrantType() string
- func (gb *CurrentMaterializedViewGrantBuilder) Name() string
- func (gb *CurrentMaterializedViewGrantBuilder) Role(n string) GrantExecutable
- func (gb *CurrentMaterializedViewGrantBuilder) Share(n string) GrantExecutable
- func (gb *CurrentMaterializedViewGrantBuilder) Show() string
- type CurrentRole
- type DescStageResult
- type DescribeUserProp
- type EmailNotificationIntegration
- type EntityType
- type ExternalFunction
- type ExternalFunctionBuilder
- func (fb *ExternalFunctionBuilder) Create() string
- func (fb *ExternalFunctionBuilder) Describe() string
- func (fb *ExternalFunctionBuilder) Drop() string
- func (fb *ExternalFunctionBuilder) QualifiedName() string
- func (fb *ExternalFunctionBuilder) QualifiedNameWithArgTypes() string
- func (fb *ExternalFunctionBuilder) Show() string
- func (fb *ExternalFunctionBuilder) WithAPIIntegration(apiIntegration string) *ExternalFunctionBuilder
- func (fb *ExternalFunctionBuilder) WithArgTypes(argtypes string) *ExternalFunctionBuilder
- func (fb *ExternalFunctionBuilder) WithArgs(args []map[string]string) *ExternalFunctionBuilder
- func (fb *ExternalFunctionBuilder) WithComment(c string) *ExternalFunctionBuilder
- func (fb *ExternalFunctionBuilder) WithCompression(compression string) *ExternalFunctionBuilder
- func (fb *ExternalFunctionBuilder) WithContextHeaders(contextHeaders []string) *ExternalFunctionBuilder
- func (fb *ExternalFunctionBuilder) WithHeaders(headers []map[string]string) *ExternalFunctionBuilder
- func (fb *ExternalFunctionBuilder) WithMaxBatchRows(maxBatchRows int) *ExternalFunctionBuilder
- func (fb *ExternalFunctionBuilder) WithNullInputBehavior(nullInputBehavior string) *ExternalFunctionBuilder
- func (fb *ExternalFunctionBuilder) WithRequestTranslator(requestTranslator string) *ExternalFunctionBuilder
- func (fb *ExternalFunctionBuilder) WithResponseTranslator(responseTranslator string) *ExternalFunctionBuilder
- func (fb *ExternalFunctionBuilder) WithReturnBehavior(returnBehavior string) *ExternalFunctionBuilder
- func (fb *ExternalFunctionBuilder) WithReturnNullAllowed(returnNullAllowed bool) *ExternalFunctionBuilder
- func (fb *ExternalFunctionBuilder) WithReturnType(returnType string) *ExternalFunctionBuilder
- func (fb *ExternalFunctionBuilder) WithURLOfProxyAndResource(urlOfProxyAndResource string) *ExternalFunctionBuilder
- type ExternalFunctionDescription
- 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 Function
- type FunctionBuilder
- func (pb *FunctionBuilder) ArgTypes() []string
- func (pb *FunctionBuilder) ArgumentsSignature() (string, error)
- func (pb *FunctionBuilder) ChangeComment(c string) (string, error)
- func (pb *FunctionBuilder) Create() (string, error)
- func (pb *FunctionBuilder) Describe() (string, error)
- func (pb *FunctionBuilder) Drop() (string, error)
- func (pb *FunctionBuilder) QualifiedName() (string, error)
- func (pb *FunctionBuilder) QualifiedNameWithoutArguments() (string, error)
- func (pb *FunctionBuilder) RemoveComment() (string, error)
- func (pb *FunctionBuilder) Rename(newName string) (string, error)
- func (pb *FunctionBuilder) Secure() (string, error)
- func (pb *FunctionBuilder) Show() string
- func (pb *FunctionBuilder) Unsecure() (string, error)
- func (pb *FunctionBuilder) WithArgs(args []map[string]string) *FunctionBuilder
- func (pb *FunctionBuilder) WithComment(c string) *FunctionBuilder
- func (pb *FunctionBuilder) WithHandler(s string) *FunctionBuilder
- func (pb *FunctionBuilder) WithImports(s []string) *FunctionBuilder
- func (pb *FunctionBuilder) WithLanguage(s string) *FunctionBuilder
- func (pb *FunctionBuilder) WithNullInputBehavior(s string) *FunctionBuilder
- func (pb *FunctionBuilder) WithPackages(s []string) *FunctionBuilder
- func (pb *FunctionBuilder) WithReturnBehavior(s string) *FunctionBuilder
- func (pb *FunctionBuilder) WithReturnType(s string) *FunctionBuilder
- func (pb *FunctionBuilder) WithRuntimeVersion(r string) *FunctionBuilder
- func (pb *FunctionBuilder) WithSecure() *FunctionBuilder
- func (pb *FunctionBuilder) WithStatement(s string) *FunctionBuilder
- func (pb *FunctionBuilder) WithTargetPath(s string) *FunctionBuilder
- type FunctionDescription
- type FutureGrantBuilder
- type FutureGrantExecutable
- type GrantBuilder
- func AccountGrant() GrantBuilder
- func AllExternalTableGrant(db, schema string) GrantBuilder
- func AllFileFormatGrant(db, schema string) GrantBuilder
- func AllFunctionGrant(db, schema string) GrantBuilder
- func AllMaterializedViewGrant(db, schema string) GrantBuilder
- func AllProcedureGrant(db, schema string) GrantBuilder
- func AllSchemaGrant(db string) GrantBuilder
- func AllSequenceGrant(db, schema string) GrantBuilder
- func AllStageGrant(db, schema string) GrantBuilder
- func AllStreamGrant(db, schema string) GrantBuilder
- func AllTableGrant(db, schema string) GrantBuilder
- func AllTaskGrant(db, schema string) GrantBuilder
- func AllViewGrant(db, schema string) GrantBuilder
- func DatabaseGrant(name string) GrantBuilder
- func ExternalTableGrant(db, schema, externalTable string) GrantBuilder
- func FailoverGroupGrant(failoverGroup string) GrantBuilder
- func FileFormatGrant(db, schema, fileFormat string) GrantBuilder
- func FunctionGrant(db, schema, function string, argumentTypes []string) GrantBuilder
- func FutureExternalTableGrant(db, schema string) GrantBuilder
- func FutureFileFormatGrant(db, schema string) GrantBuilder
- func FutureFunctionGrant(db, schema string) GrantBuilder
- func FutureMaterializedViewGrant(db, schema string) GrantBuilder
- func FuturePipeGrant(db, schema string) GrantBuilder
- func FutureProcedureGrant(db, schema string) GrantBuilder
- func FutureSchemaGrant(db string) GrantBuilder
- func FutureSequenceGrant(db, schema string) GrantBuilder
- func FutureStageGrant(db, schema string) GrantBuilder
- func FutureStreamGrant(db, schema string) GrantBuilder
- func FutureTableGrant(db, schema string) GrantBuilder
- func FutureTaskGrant(db, schema string) GrantBuilder
- func FutureViewGrant(db, schema string) GrantBuilder
- func IntegrationGrant(w string) GrantBuilder
- func MaskingPolicyGrant(db, schema, maskingPolicy string) GrantBuilder
- func MaterializedViewGrant(db, schema, view string) GrantBuilder
- func PipeGrant(db, schema, pipe string) GrantBuilder
- func ProcedureGrant(db, schema, procedure string, argumentTypes []string) GrantBuilder
- func ResourceMonitorGrant(w string) GrantBuilder
- func RowAccessPolicyGrant(db, schema, rowAccessPolicy string) GrantBuilder
- func SchemaGrant(db, schema string) GrantBuilder
- func SequenceGrant(db, schema, sequence string) GrantBuilder
- func StageGrant(db, schema, stage string) GrantBuilder
- func StreamGrant(db, schema, stream string) GrantBuilder
- func TableGrant(db, schema, table string) GrantBuilder
- func TagGrant(db, schema, tag string) GrantBuilder
- func TaskGrant(db, schema, task string) GrantBuilder
- func UserGrant(w string) GrantBuilder
- func ViewGrant(db, schema, view string) GrantBuilder
- func WarehouseGrant(w string) GrantBuilder
- type GrantDetail
- func ShowFutureGrantsIn(db *sql.DB, objectType, objectName string) ([]GrantDetail, error)
- func ShowFutureGrantsTo(db *sql.DB, objectType, objectName string) ([]GrantDetail, error)
- func ShowGrantsOf(db *sql.DB, objectType, objectName string) ([]GrantDetail, error)
- func ShowGrantsOn(db *sql.DB, objectType, objectName string) ([]GrantDetail, error)
- func ShowGrantsOnAccount(db *sql.DB) ([]GrantDetail, error)
- func ShowGrantsTo(db *sql.DB, objectType, objectName string) ([]GrantDetail, error)
- type GrantExecutable
- type Identifier
- type KeywordPosition
- type ManagedAccount
- type MaskingPolicyBuilder
- type MaterializedView
- type MaterializedViewBuilder
- func (vb *MaterializedViewBuilder) AddTag(tag TagValue) string
- func (vb *MaterializedViewBuilder) ChangeComment(c string) string
- func (vb *MaterializedViewBuilder) ChangeTag(tag TagValue) string
- func (vb *MaterializedViewBuilder) Create() []string
- func (vb *MaterializedViewBuilder) Drop() string
- func (vb *MaterializedViewBuilder) QualifiedName() string
- func (vb *MaterializedViewBuilder) RemoveComment() string
- func (vb *MaterializedViewBuilder) Rename(newName string) string
- func (vb *MaterializedViewBuilder) Secure() string
- func (vb *MaterializedViewBuilder) Show() string
- func (vb *MaterializedViewBuilder) Unsecure() string
- func (vb *MaterializedViewBuilder) UnsetTag(tag TagValue) string
- func (vb *MaterializedViewBuilder) WithComment(c string) *MaterializedViewBuilder
- func (vb *MaterializedViewBuilder) WithDB(db string) *MaterializedViewBuilder
- func (vb *MaterializedViewBuilder) WithReplace() *MaterializedViewBuilder
- func (vb *MaterializedViewBuilder) WithSchema(s string) *MaterializedViewBuilder
- func (vb *MaterializedViewBuilder) WithSecure() *MaterializedViewBuilder
- func (vb *MaterializedViewBuilder) WithStatement(s string) *MaterializedViewBuilder
- func (vb *MaterializedViewBuilder) WithTags(tags []TagValue) *MaterializedViewBuilder
- func (vb *MaterializedViewBuilder) WithWarehouse(s string) *MaterializedViewBuilder
- type NetworkPolicyAttachmentStruct
- type NetworkPolicyBuilder
- func (npb *NetworkPolicyBuilder) SetOnAccount() string
- func (npb *NetworkPolicyBuilder) SetOnUser(u string) string
- func (npb *NetworkPolicyBuilder) ShowOnAccount() string
- func (npb *NetworkPolicyBuilder) ShowOnUser(u string) string
- func (npb *NetworkPolicyBuilder) UnsetOnAccount() string
- func (npb *NetworkPolicyBuilder) UnsetOnUser(u string) string
- type NotificationIntegration
- type OauthIntegration
- type ParamType
- type PlatformInfo
- type PrimaryKey
- type PrimaryKeyDescription
- type PrivateLinkConfig
- type Procedure
- type ProcedureBuilder
- func (pb *ProcedureBuilder) ArgTypes() []string
- func (pb *ProcedureBuilder) ArgumentsSignature() (string, error)
- func (pb *ProcedureBuilder) ChangeComment(c string) (string, error)
- func (pb *ProcedureBuilder) ChangeExecuteAs(c string) (string, error)
- func (pb *ProcedureBuilder) Create() (string, error)
- func (pb *ProcedureBuilder) Describe() (string, error)
- func (pb *ProcedureBuilder) Drop() (string, error)
- func (pb *ProcedureBuilder) QualifiedName() (string, error)
- func (pb *ProcedureBuilder) QualifiedNameWithoutArguments() (string, error)
- func (pb *ProcedureBuilder) RemoveComment() (string, error)
- func (pb *ProcedureBuilder) Rename(newName string) (string, error)
- func (pb *ProcedureBuilder) Show() string
- func (pb *ProcedureBuilder) WithArgs(args []map[string]string) *ProcedureBuilder
- func (pb *ProcedureBuilder) WithComment(c string) *ProcedureBuilder
- func (pb *ProcedureBuilder) WithExecuteAs(s string) *ProcedureBuilder
- func (pb *ProcedureBuilder) WithHandler(s string) *ProcedureBuilder
- func (pb *ProcedureBuilder) WithImports(s []string) *ProcedureBuilder
- func (pb *ProcedureBuilder) WithLanguage(s string) *ProcedureBuilder
- func (pb *ProcedureBuilder) WithNullInputBehavior(s string) *ProcedureBuilder
- func (pb *ProcedureBuilder) WithPackages(s []string) *ProcedureBuilder
- func (pb *ProcedureBuilder) WithReturnBehavior(s string) *ProcedureBuilder
- func (pb *ProcedureBuilder) WithReturnType(s string) *ProcedureBuilder
- func (pb *ProcedureBuilder) WithRuntimeVersion(r string) *ProcedureBuilder
- func (pb *ProcedureBuilder) WithStatement(s string) *ProcedureBuilder
- type ProcedureDescription
- type RawPlatformInfo
- type RawPrivateLinkConfig
- type Replication
- type ReplicationBuilder
- type ResourceMonitor
- type ResourceMonitorAlterBuilder
- func (rcb *ResourceMonitorAlterBuilder) NotifyAt(pct int) *ResourceMonitorAlterBuilder
- func (rcb *ResourceMonitorAlterBuilder) SetOnAccount() string
- func (rcb *ResourceMonitorAlterBuilder) SetOnWarehouse(warehouse string) string
- func (rcb *ResourceMonitorAlterBuilder) Statement() string
- func (rcb *ResourceMonitorAlterBuilder) SuspendAt(pct int) *ResourceMonitorAlterBuilder
- func (rcb *ResourceMonitorAlterBuilder) SuspendImmediatelyAt(pct int) *ResourceMonitorAlterBuilder
- func (rcb *ResourceMonitorAlterBuilder) UnsetOnAccount() string
- func (rcb *ResourceMonitorAlterBuilder) UnsetOnWarehouse(warehouse string) string
- type ResourceMonitorBuilder
- type ResourceMonitorCreateBuilder
- func (rcb *ResourceMonitorCreateBuilder) NotifyAt(pct int) *ResourceMonitorCreateBuilder
- func (rcb *ResourceMonitorCreateBuilder) SetOnAccount() string
- func (rcb *ResourceMonitorCreateBuilder) SetOnWarehouse(warehouse string) string
- func (rcb *ResourceMonitorCreateBuilder) Statement() string
- func (rcb *ResourceMonitorCreateBuilder) SuspendAt(pct int) *ResourceMonitorCreateBuilder
- func (rcb *ResourceMonitorCreateBuilder) SuspendImmediatelyAt(pct int) *ResourceMonitorCreateBuilder
- type Role
- type RoleBuilder
- func (b *RoleBuilder) ChangeTag(tag TagValue) error
- func (b *RoleBuilder) Create() error
- func (b *RoleBuilder) Drop() error
- func (b *RoleBuilder) Rename(newName string) error
- func (b *RoleBuilder) SetComment(comment string) error
- func (b *RoleBuilder) SetTag(tag TagValue) error
- func (b *RoleBuilder) Show() (*Role, error)
- func (b *RoleBuilder) UnsetComment() error
- func (b *RoleBuilder) UnsetTag(tag TagValue) error
- func (b *RoleBuilder) WithComment(comment string) *RoleBuilder
- func (b *RoleBuilder) WithName(name string) *RoleBuilder
- func (b *RoleBuilder) WithTags(tags []TagValue) *RoleBuilder
- type RoleGrantBuilder
- type RoleGrantExecutable
- type RoleOwnershipGrant
- type RoleOwnershipGrantBuilder
- type RoleOwnershipGrantExecutable
- type RowAccessPolicyBuilder
- func (rapb *RowAccessPolicyBuilder) ChangeComment(c string) string
- func (rapb *RowAccessPolicyBuilder) ChangeRowAccessExpression(rowAccessExpression string) string
- func (rapb *RowAccessPolicyBuilder) Create() string
- func (rapb *RowAccessPolicyBuilder) Describe() string
- func (rapb *RowAccessPolicyBuilder) Drop() string
- func (rapb *RowAccessPolicyBuilder) QualifiedName() string
- func (rapb *RowAccessPolicyBuilder) RemoveComment() string
- func (rapb *RowAccessPolicyBuilder) Show() string
- func (rapb *RowAccessPolicyBuilder) WithComment(c string) *RowAccessPolicyBuilder
- func (rapb *RowAccessPolicyBuilder) WithRowAccessExpression(rowAccessExpression string) *RowAccessPolicyBuilder
- func (rapb *RowAccessPolicyBuilder) WithSignature(signature map[string]interface{}) *RowAccessPolicyBuilder
- type RowAccessPolicyStruct
- 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 Sequence
- type SequenceBuilder
- func (sb *SequenceBuilder) Address() string
- func (sb *SequenceBuilder) Create() string
- func (sb *SequenceBuilder) Drop() string
- func (sb *SequenceBuilder) QualifiedName() string
- func (sb *SequenceBuilder) Show() string
- func (sb *SequenceBuilder) WithComment(comment string) *SequenceBuilder
- func (sb *SequenceBuilder) WithIncrement(increment int) *SequenceBuilder
- func (sb *SequenceBuilder) WithStart(start int) *SequenceBuilder
- type SettingBuilder
- type Stage
- 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) Describe() string
- func (sb *StageBuilder) Drop() string
- func (sb *StageBuilder) QualifiedName() string
- func (sb *StageBuilder) RemoveComment() string
- func (sb *StageBuilder) Rename(newName string) string
- func (sb *StageBuilder) Show() string
- func (sb *StageBuilder) Undrop() 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 StorageIntegration
- type SystemGenerateSCIMAccessTokenBuilder
- type SystemGetAWSSNSIAMPolicyBuilder
- type Table
- type TableBuilder
- func (tb *TableBuilder) AddColumn(name string, dataType string, nullable bool, _default *ColumnDefault, ...) string
- func (tb *TableBuilder) AddTag(tag TagValue) string
- func (tb *TableBuilder) ChangeChangeTracking(changeTracking bool) string
- func (tb *TableBuilder) ChangeClusterBy(cb string) string
- func (tb *TableBuilder) ChangeColumnComment(name string, comment string) string
- func (tb *TableBuilder) ChangeColumnMaskingPolicy(name string, maskingPolicy string) string
- func (tb *TableBuilder) ChangeColumnType(name string, dataType string) string
- func (tb *TableBuilder) ChangeComment(c string) string
- func (tb *TableBuilder) ChangeDataRetention(days int) string
- func (tb *TableBuilder) ChangeNullConstraint(name string, nullable bool) string
- func (tb *TableBuilder) ChangePrimaryKey(newPk PrimaryKey) string
- func (tb *TableBuilder) ChangeTag(tag TagValue) string
- func (tb *TableBuilder) Create() string
- func (tb *TableBuilder) Drop() string
- func (tb *TableBuilder) DropClustering() string
- func (tb *TableBuilder) DropColumn(name string) string
- func (tb *TableBuilder) DropColumnDefault(name string) string
- func (tb *TableBuilder) DropPrimaryKey() string
- func (tb *TableBuilder) GetClusterKeyString() string
- func (tb *TableBuilder) GetTagValueString() string
- func (tb *TableBuilder) QualifiedName() string
- func (tb *TableBuilder) RemoveComment() string
- func (tb *TableBuilder) Rename(newName string) string
- func (tb *TableBuilder) Show() string
- func (tb *TableBuilder) ShowColumns() string
- func (tb *TableBuilder) ShowPrimaryKeys() string
- func (tb *TableBuilder) UnsetTag(tag TagValue) string
- func (tb *TableBuilder) WithChangeTracking(changeTracking bool) *TableBuilder
- func (tb *TableBuilder) WithClustering(c []string) *TableBuilder
- func (tb *TableBuilder) WithColumns(c Columns) *TableBuilder
- func (tb *TableBuilder) WithComment(c string) *TableBuilder
- func (tb *TableBuilder) WithDataRetentionTimeInDays(days int) *TableBuilder
- func (tb *TableBuilder) WithPrimaryKey(pk PrimaryKey) *TableBuilder
- func (tb *TableBuilder) WithTags(tags []TagValue) *TableBuilder
- 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 TableConstraint
- type TableConstraintBuilder
- func (b *TableConstraintBuilder) Create() string
- func (b *TableConstraintBuilder) Drop() string
- func (b *TableConstraintBuilder) Rename(newName string) string
- func (b *TableConstraintBuilder) SetComment(c string) string
- func (b *TableConstraintBuilder) WithColumns(columns []string) *TableConstraintBuilder
- func (b *TableConstraintBuilder) WithComment(comment string) *TableConstraintBuilder
- func (b *TableConstraintBuilder) WithDeferrable(deferrable bool) *TableConstraintBuilder
- func (b *TableConstraintBuilder) WithDelete(onDelete string) *TableConstraintBuilder
- func (b *TableConstraintBuilder) WithEnable(enable bool) *TableConstraintBuilder
- func (b *TableConstraintBuilder) WithEnforced(enforced bool) *TableConstraintBuilder
- func (b *TableConstraintBuilder) WithInitially(initially string) *TableConstraintBuilder
- func (b *TableConstraintBuilder) WithMatch(match string) *TableConstraintBuilder
- func (b *TableConstraintBuilder) WithReferenceColumns(referenceColumns []string) *TableConstraintBuilder
- func (b *TableConstraintBuilder) WithReferenceTableID(referenceTableID string) *TableConstraintBuilder
- func (b *TableConstraintBuilder) WithRely(rely bool) *TableConstraintBuilder
- func (b *TableConstraintBuilder) WithUpdate(onUpdate string) *TableConstraintBuilder
- func (b *TableConstraintBuilder) WithValidate(validate bool) *TableConstraintBuilder
- type TableDescription
- type Tag
- type TagAssociation
- type TagAssociationBuilder
- func (tb *TagAssociationBuilder) Create() string
- func (tb *TagAssociationBuilder) Drop() string
- func (tb *TagAssociationBuilder) GetTableAndColumnName() (string, string)
- func (tb *TagAssociationBuilder) GetTagDatabase() string
- func (tb *TagAssociationBuilder) GetTagName() string
- func (tb *TagAssociationBuilder) GetTagSchema() string
- func (tb *TagAssociationBuilder) Show() string
- func (tb *TagAssociationBuilder) WithObjectIdentifier(objectIdentifier string) *TagAssociationBuilder
- func (tb *TagAssociationBuilder) WithObjectType(objectType string) *TagAssociationBuilder
- func (tb *TagAssociationBuilder) WithTagValue(tagValue string) *TagAssociationBuilder
- type TagBuilder
- func (tb *TagBuilder) AddAllowedValues(avs []string) string
- func (tb *TagBuilder) AddMaskingPolicy() string
- func (tb *TagBuilder) ChangeComment(c string) string
- func (tb *TagBuilder) Create() string
- func (tb *TagBuilder) Drop() string
- func (tb *TagBuilder) DropAllowedValues(davs []string) string
- func (tb *TagBuilder) QualifiedName() string
- func (tb *TagBuilder) RemoveAllowedValues() string
- func (tb *TagBuilder) RemoveComment() string
- func (tb *TagBuilder) RemoveMaskingPolicy() string
- func (tb *TagBuilder) Rename(newName string) string
- func (tb *TagBuilder) Show() string
- func (tb *TagBuilder) ShowAttachedPolicy() string
- func (tb *TagBuilder) Undrop() string
- func (tb *TagBuilder) WithAllowedValues(av []string) *TagBuilder
- func (tb *TagBuilder) WithComment(c string) *TagBuilder
- func (tb *TagBuilder) WithDB(db string) *TagBuilder
- func (tb *TagBuilder) WithMaskingPolicy(mpb *MaskingPolicyBuilder) *TagBuilder
- func (tb *TagBuilder) WithSchema(schema string) *TagBuilder
- type TagPolicyAttachment
- type TagValue
- type TopLevelIdentifier
- type User
- type UserFunctions
- type UserOwnershipGrant
- type UserOwnershipGrantBuilder
- type UserOwnershipGrantExecutable
- type View
- type ViewBuilder
- func (vb *ViewBuilder) AddTag(tag TagValue) string
- func (vb *ViewBuilder) ChangeComment(c string) (string, error)
- func (vb *ViewBuilder) ChangeTag(tag TagValue) string
- func (vb *ViewBuilder) Create() (string, error)
- func (vb *ViewBuilder) Drop() (string, error)
- func (vb *ViewBuilder) QualifiedName() (string, error)
- func (vb *ViewBuilder) RemoveComment() (string, error)
- func (vb *ViewBuilder) Rename(newName string) (string, error)
- func (vb *ViewBuilder) Secure() (string, error)
- func (vb *ViewBuilder) Show() string
- func (vb *ViewBuilder) Unsecure() (string, error)
- func (vb *ViewBuilder) UnsetTag(tag TagValue) string
- func (vb *ViewBuilder) WithComment(c string) *ViewBuilder
- func (vb *ViewBuilder) WithCopyGrants() *ViewBuilder
- func (vb *ViewBuilder) WithDB(db string) *ViewBuilder
- func (vb *ViewBuilder) WithReplace() *ViewBuilder
- func (vb *ViewBuilder) WithSchema(s string) *ViewBuilder
- func (vb *ViewBuilder) WithSecure() *ViewBuilder
- func (vb *ViewBuilder) WithStatement(s string) *ViewBuilder
- func (vb *ViewBuilder) WithTags(tags []TagValue) *ViewBuilder
- type ViewSelectStatementExtractor
Constants ¶
const ( // SuspendTrigger suspends all assigned warehouses while allowing currently running queries to complete. SuspendTrigger action = "SUSPEND" // SuspendImmediatelyTrigger suspends all assigned warehouses immediately and cancel any currently running queries or statements using the warehouses. SuspendImmediatelyTrigger action = "SUSPEND_IMMEDIATE" // NotifyTrigger sends an alert (to all users who have enabled notifications for themselves), but do not take any other action. NotifyTrigger action = "NOTIFY" )
Variables ¶
var (
ErrNoRowInRS = "sql: no rows in result set"
)
Generic Errors.
Functions ¶
func AddressEscape ¶ added in v0.34.0
AddressEscape wraps a name inside double quotes only if required by Snowflake.
func ClusterStatementToList ¶ added in v0.34.0
function to take the literal snowflake cluster statement returned from SHOW TABLES and convert it to a list of keys.
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 FlattenTablePrimaryKey ¶ added in v0.34.0
func FlattenTablePrimaryKey(pkds []PrimaryKeyDescription) []interface{}
func IsResourceNotExistOrNotAuthorized ¶ added in v0.44.0
func JoinStringList ¶ added in v0.34.0
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 SelectCurrentAccount ¶ added in v0.34.0
func SelectCurrentAccount() string
func SelectCurrentRole ¶ added in v0.54.0
func SelectCurrentRole() string
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.
func UnescapeString ¶ added in v0.34.0
UnescapeString reverses EscapeString.
Types ¶
type APIIntegration ¶ added in v0.47.0
type APIIntegration struct { Name sql.NullString `db:"name"` Category sql.NullString `db:"category"` IntegrationType sql.NullString `db:"type"` CreatedOn sql.NullString `db:"created_on"` Comment sql.NullString `db:"comment"` Enabled sql.NullBool `db:"enabled"` }
func ScanAPIIntegration ¶ added in v0.47.0
func ScanAPIIntegration(row *sqlx.Row) (*APIIntegration, error)
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 AllGrantBuilder ¶ added in v0.61.0
type AllGrantBuilder struct {
// contains filtered or unexported fields
}
AllGrantBuilder abstracts the creation of ExistingGrantExecutables.
func (*AllGrantBuilder) GrantType ¶ added in v0.61.0
func (agb *AllGrantBuilder) GrantType() string
func (*AllGrantBuilder) Name ¶ added in v0.61.0
func (agb *AllGrantBuilder) Name() string
Name returns the object name for this FutureGrantBuilder.
func (*AllGrantBuilder) Role ¶ added in v0.61.0
func (agb *AllGrantBuilder) Role(n string) GrantExecutable
Role returns a pointer to a AllGrantExecutable for a role.
func (*AllGrantBuilder) Share ¶ added in v0.61.0
func (agb *AllGrantBuilder) Share(_ string) GrantExecutable
Share is not implemented because all objects cannot be granted to shares.
func (*AllGrantBuilder) Show ¶ added in v0.61.0
func (agb *AllGrantBuilder) Show() string
Show returns the SQL that will show all privileges on the grant.
type AllGrantExecutable ¶ added in v0.64.0
type AllGrantExecutable struct {
// contains filtered or unexported fields
}
AllGrantExecutable abstracts the creation of SQL queries to build all grants for different all grant types.
func (*AllGrantExecutable) Grant ¶ added in v0.64.0
func (ege *AllGrantExecutable) Grant(p string, w bool) string
Grant returns the SQL that will grant all privileges on the grant to the grantee.
func (*AllGrantExecutable) Revoke ¶ added in v0.64.0
func (ege *AllGrantExecutable) Revoke(p string) []string
Revoke returns the SQL that will revoke all privileges on the grant from the grantee.
func (*AllGrantExecutable) RevokeOwnership ¶ added in v0.65.0
func (ege *AllGrantExecutable) RevokeOwnership(r string) []string
Revoke returns the SQL that will revoke ownership privileges on the grant from the grantee. Note: returns the same SQL as Revoke.
func (*AllGrantExecutable) Show ¶ added in v0.64.0
func (ege *AllGrantExecutable) Show() string
Show returns the SQL that will show all grants on the schema.
type AllGrantTarget ¶ added in v0.61.0
type AllGrantTarget string
const ( AllGrantTargetSchema AllGrantTarget = "SCHEMA" AllGrantTargetDatabase AllGrantTarget = "DATABASE" )
type AllGrantType ¶ added in v0.61.0
type AllGrantType string
const ( AllAccountGrantAccount AllGrantType = "ACCOUNT" AllGrantTypeSchema AllGrantType = "SCHEMA" AllGrantTypeTable AllGrantType = "TABLE" AllGrantTypeView AllGrantType = "VIEW" AllGrantTypeMaterializedView AllGrantType = "MATERIALIZED VIEW" AllGrantTypeStage AllGrantType = "STAGE" AllGrantTypeExternalTable AllGrantType = "EXTERNAL TABLE" AllGrantTypeFileFormat AllGrantType = "FILE FORMAT" AllGrantTypeFunction AllGrantType = "FUNCTION" AllGrantTypeProcedure AllGrantType = "PROCEDURE" AllGrantTypeSequence AllGrantType = "SEQUENCE" AllGrantTypeStream AllGrantType = "STREAM" AllGrantTypeTask AllGrantType = "TASK" )
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 NewAPIIntegrationBuilder ¶ added in v0.54.0
ApiIntegration returns a pointer to a Builder that abstracts the DDL operations for an api integration.
Supported DDL operations are:
- CREATE API INTEGRATION
- ALTER API INTEGRATION
- DROP INTEGRATION
- SHOW INTEGRATIONS
- DESCRIBE INTEGRATION
[Snowflake Reference](https://docs.snowflake.com/en/sql-reference/ddl-user-security.html#api-integrations)
func NewEmailNotificationIntegrationBuilder ¶ added in v0.64.0
EmailNotificationIntegration returns a pointer to a Builder that abstracts the DDL operations for a email notification integration.
Supported DDL operations are:
- CREATE NOTIFICATION INTEGRATION
- ALTER NOTIFICATION INTEGRATION
- DROP INTEGRATION
- SHOW INTEGRATIONS
- DESCRIBE INTEGRATION
[Snowflake Reference](https://docs.snowflake.com/en/sql-reference/ddl-user-security.html#notification-integrations)
func NewManagedAccountBuilder ¶ added in v0.54.0
NewManagedAccountBuilder returns a pointer to a Builder that abstracts the DDL operations for a reader account.
Supported DDL operations are:
- CREATE MANAGED ACCOUNT
- DROP MANAGED ACCOUNT
- SHOW MANAGED ACCOUNTS
[Snowflake Reference](https://docs.snowflake.net/manuals/user-guide/data-sharing-reader-create.html)
func NewNotificationIntegrationBuilder ¶ added in v0.54.0
NotificationIntegration returns a pointer to a Builder that abstracts the DDL operations for a notification integration.
Supported DDL operations are:
- CREATE NOTIFICATION INTEGRATION
- ALTER NOTIFICATION INTEGRATION
- DROP INTEGRATION
- SHOW INTEGRATIONS
- DESCRIBE INTEGRATION
[Snowflake Reference](https://docs.snowflake.com/en/sql-reference/ddl-user-security.html#notification-integrations)
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 NewStorageIntegrationBuilder ¶ added in v0.54.0
StorageIntegration returns a pointer to a Builder that abstracts the DDL operations for a storage integration.
Supported DDL operations are:
- CREATE STORAGE INTEGRATION
- ALTER STORAGE INTEGRATION
- DROP INTEGRATION
- SHOW INTEGRATIONS
- DESCRIBE INTEGRATION
[Snowflake Reference](https://docs.snowflake.net/manuals/sql-reference/ddl-user-security.html#storage-integrations)
func NewUserBuilder ¶ added in v0.54.0
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 Column ¶ added in v0.34.0
type Column struct {
// contains filtered or unexported fields
}
Column structure that represents a table column.
func (*Column) WithComment ¶ added in v0.34.0
WithComment set the column comment.
func (*Column) WithDefault ¶ added in v0.34.0
func (c *Column) WithDefault(cd *ColumnDefault) *Column
func (*Column) WithIdentity ¶ added in v0.34.0
func (c *Column) WithIdentity(id *ColumnIdentity) *Column
func (*Column) WithMaskingPolicy ¶ added in v0.49.0
func (*Column) WithNullable ¶ added in v0.34.0
WithNullable set if the column is nullable.
type ColumnDefault ¶ added in v0.34.0
type ColumnDefault struct {
// contains filtered or unexported fields
}
func NewColumnDefaultWithConstant ¶ added in v0.34.0
func NewColumnDefaultWithConstant(constant string) *ColumnDefault
func NewColumnDefaultWithExpression ¶ added in v0.34.0
func NewColumnDefaultWithExpression(expression string) *ColumnDefault
func NewColumnDefaultWithSequence ¶ added in v0.34.0
func NewColumnDefaultWithSequence(sequence string) *ColumnDefault
func (*ColumnDefault) String ¶ added in v0.34.0
func (d *ColumnDefault) String(columnType string) string
func (*ColumnDefault) UnescapeConstantSnowflakeString ¶ added in v0.34.0
func (d *ColumnDefault) UnescapeConstantSnowflakeString(columnType string) string
type ColumnDefaultType ¶ added in v0.34.0
type ColumnDefaultType int
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 ColumnIdentity ¶ added in v0.34.0
type ColumnIdentity struct {
// contains filtered or unexported fields
}
func (*ColumnIdentity) WithStartNum ¶ added in v0.34.0
func (id *ColumnIdentity) WithStartNum(start int) *ColumnIdentity
func (*ColumnIdentity) WithStep ¶ added in v0.34.0
func (id *ColumnIdentity) WithStep(step int) *ColumnIdentity
type Columns ¶ added in v0.34.0
type Columns []Column
func NewColumns ¶ added in v0.34.0
func NewColumns(tds []TableDescription) Columns
NewColumns generates columns from a table description.
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 CurrentAccount ¶ added in v0.56.0
func ReadCurrentAccount ¶ added in v0.34.0
func ReadCurrentAccount(db *sql.DB) (*CurrentAccount, error)
func ScanCurrentAccount ¶ added in v0.34.0
func ScanCurrentAccount(row *sqlx.Row) (*CurrentAccount, error)
func (*CurrentAccount) AccountURL ¶ added in v0.56.0
func (acc *CurrentAccount) AccountURL() (string, error)
type CurrentGrantBuilder ¶ added in v0.34.0
type CurrentGrantBuilder struct {
// contains filtered or unexported fields
}
CurrentGrantBuilder abstracts the creation of GrantExecutables.
func (*CurrentGrantBuilder) GrantType ¶ added in v0.34.0
func (gb *CurrentGrantBuilder) GrantType() string
func (*CurrentGrantBuilder) Name ¶ added in v0.34.0
func (gb *CurrentGrantBuilder) Name() string
Name returns the object name for this CurrentGrantBuilder.
func (*CurrentGrantBuilder) Role ¶ added in v0.34.0
func (gb *CurrentGrantBuilder) Role(n string) GrantExecutable
Role returns a pointer to a CurrentGrantExecutable for a role.
func (*CurrentGrantBuilder) Share ¶ added in v0.34.0
func (gb *CurrentGrantBuilder) Share(n string) GrantExecutable
Share returns a pointer to a CurrentGrantExecutable for a share.
func (*CurrentGrantBuilder) Show ¶ added in v0.34.0
func (gb *CurrentGrantBuilder) Show() string
Show returns the SQL that will show all privileges on the grant.
type CurrentGrantExecutable ¶ added in v0.34.0
type CurrentGrantExecutable struct {
// contains filtered or unexported fields
}
CurrentGrantExecutable abstracts the creation of SQL queries to build grants for different resources.
func (*CurrentGrantExecutable) Grant ¶ added in v0.34.0
func (ge *CurrentGrantExecutable) Grant(p string, w bool) string
Grant returns the SQL that will grant privileges on the grant to the grantee.
func (*CurrentGrantExecutable) Revoke ¶ added in v0.34.0
func (ge *CurrentGrantExecutable) Revoke(p string) []string
Revoke returns the SQL that will revoke privileges on the grant from the grantee.
func (*CurrentGrantExecutable) RevokeOwnership ¶ added in v0.65.0
func (ge *CurrentGrantExecutable) RevokeOwnership(r string) []string
Revoke returns the SQL that will revoke ownership privileges on the grant from the grantee. Since 10/2020 Snowflake dropped support for REVOKE OWNERSHIP. It's only possible to transfer it to another role now, so we grant it to role r.
func (*CurrentGrantExecutable) Show ¶ added in v0.34.0
func (ge *CurrentGrantExecutable) Show() string
Show returns the SQL that will show all grants of the grantee.
type CurrentMaterializedViewGrantBuilder ¶ added in v0.34.0
type CurrentMaterializedViewGrantBuilder struct {
// contains filtered or unexported fields
}
///////////////////////////////////////////// START CurrentMaterializedViewGrantBuilder // /////////////////////////////////////////////.
func (*CurrentMaterializedViewGrantBuilder) GrantType ¶ added in v0.34.0
func (gb *CurrentMaterializedViewGrantBuilder) GrantType() string
func (*CurrentMaterializedViewGrantBuilder) Name ¶ added in v0.34.0
func (gb *CurrentMaterializedViewGrantBuilder) Name() string
Name returns the object name for this CurrentGrantBuilder.
func (*CurrentMaterializedViewGrantBuilder) Role ¶ added in v0.34.0
func (gb *CurrentMaterializedViewGrantBuilder) Role(n string) GrantExecutable
Role returns a pointer to a CurrentGrantExecutable for a role.
func (*CurrentMaterializedViewGrantBuilder) Share ¶ added in v0.34.0
func (gb *CurrentMaterializedViewGrantBuilder) Share(n string) GrantExecutable
Share returns a pointer to a CurrentGrantExecutable for a share.
func (*CurrentMaterializedViewGrantBuilder) Show ¶ added in v0.34.0
func (gb *CurrentMaterializedViewGrantBuilder) Show() string
Show returns the SQL that will show all privileges on the grant.
type CurrentRole ¶ added in v0.54.0
type CurrentRole struct {
Role string `db:"currentRole"`
}
func ReadCurrentRole ¶ added in v0.54.0
func ReadCurrentRole(db *sql.DB) (*CurrentRole, error)
func ScanCurrentRole ¶ added in v0.54.0
func ScanCurrentRole(row *sqlx.Row) (*CurrentRole, error)
type DescStageResult ¶ added in v0.54.0
type DescribeUserProp ¶ added in v0.34.0
type DescribeUserProp struct { Property string `db:"property"` Value sql.NullString `db:"value"` }
type EmailNotificationIntegration ¶ added in v0.64.0
type EmailNotificationIntegration struct { Name sql.NullString `db:"name"` Type sql.NullString `db:"type"` Comment sql.NullString `db:"comment"` Enabled sql.NullBool `db:"enabled"` }
func ScanEmailNotificationIntegration ¶ added in v0.64.0
func ScanEmailNotificationIntegration(row *sqlx.Row) (*EmailNotificationIntegration, error)
type EntityType ¶ added in v0.3.0
type EntityType string
const ( APIIntegrationType EntityType = "API INTEGRATION" DatabaseType EntityType = "DATABASE" ManagedAccountType EntityType = "MANAGED ACCOUNT" ResourceMonitorType EntityType = "RESOURCE MONITOR" RoleType EntityType = "ROLE" ReplicationType EntityType = "REPLICATION" StorageIntegrationType EntityType = "STORAGE INTEGRATION" NotificationIntegrationType EntityType = "NOTIFICATION INTEGRATION" SecurityIntegrationType EntityType = "SECURITY INTEGRATION" UserType EntityType = "USER" WarehouseType EntityType = "WAREHOUSE" )
type ExternalFunction ¶ added in v0.34.0
type ExternalFunction struct { CreatedOn sql.NullString `db:"created_on"` ExternalFunctionName sql.NullString `db:"name"` DatabaseName sql.NullString `db:"catalog_name"` SchemaName sql.NullString `db:"schema_name"` Comment sql.NullString `db:"description"` IsExternalFunction sql.NullString `db:"is_external_function"` Language sql.NullString `db:"language"` }
func ListExternalFunctions ¶ added in v0.34.0
func ScanExternalFunction ¶ added in v0.34.0
func ScanExternalFunction(row *sqlx.Row) (*ExternalFunction, error)
ScanExternalFunction.
type ExternalFunctionBuilder ¶ added in v0.34.0
type ExternalFunctionBuilder struct {
// contains filtered or unexported fields
}
ExternalFunctionBuilder abstracts the creation of SQL queries for a Snowflake schema.
func NewExternalFunctionBuilder ¶ added in v0.54.0
func NewExternalFunctionBuilder(name, db, schema string) *ExternalFunctionBuilder
NewExternalFunctionBuilder returns a pointer to a Builder that abstracts the DDL operations for an external function.
Supported DDL operations are:
- CREATE EXTERNAL FUNCTION
- ALTER EXTERNAL FUNCTION
- DROP FUNCTION
- SHOW EXTERNAL FUNCTIONS
- DESCRIBE FUNCTION
[Snowflake Reference](https://docs.snowflake.com/en/sql-reference/ddl-udf.html#external-function-management)
func (*ExternalFunctionBuilder) Create ¶ added in v0.34.0
func (fb *ExternalFunctionBuilder) Create() string
Create returns the SQL statement required to create an external function.
func (*ExternalFunctionBuilder) Describe ¶ added in v0.34.0
func (fb *ExternalFunctionBuilder) Describe() string
Describe returns the SQL query that will describe an external function.
func (*ExternalFunctionBuilder) Drop ¶ added in v0.34.0
func (fb *ExternalFunctionBuilder) Drop() string
Drop returns the SQL query that will drop an external function.
func (*ExternalFunctionBuilder) QualifiedName ¶ added in v0.34.0
func (fb *ExternalFunctionBuilder) QualifiedName() string
QualifiedName prepends the db and schema if set and escapes everything nicely.
func (*ExternalFunctionBuilder) QualifiedNameWithArgTypes ¶ added in v0.34.0
func (fb *ExternalFunctionBuilder) QualifiedNameWithArgTypes() string
QualifiedNameWithArgTypes appends all args' types to the qualified name. This is required to invoke 'DESC FUNCTION' and 'DROP FUNCTION' commands.
func (*ExternalFunctionBuilder) Show ¶ added in v0.34.0
func (fb *ExternalFunctionBuilder) Show() string
Show returns the SQL query that will show an external function.
func (*ExternalFunctionBuilder) WithAPIIntegration ¶ added in v0.34.0
func (fb *ExternalFunctionBuilder) WithAPIIntegration(apiIntegration string) *ExternalFunctionBuilder
WithAPIIntegration adds a apiIntegration to the ExternalFunctionBuilder.
func (*ExternalFunctionBuilder) WithArgTypes ¶ added in v0.34.0
func (fb *ExternalFunctionBuilder) WithArgTypes(argtypes string) *ExternalFunctionBuilder
WithArgTypes sets the args on the ExternalFunctionBuilder.
func (*ExternalFunctionBuilder) WithArgs ¶ added in v0.34.0
func (fb *ExternalFunctionBuilder) WithArgs(args []map[string]string) *ExternalFunctionBuilder
WithArgs sets the args on the ExternalFunctionBuilder.
func (*ExternalFunctionBuilder) WithComment ¶ added in v0.34.0
func (fb *ExternalFunctionBuilder) WithComment(c string) *ExternalFunctionBuilder
WithComment adds a comment to the ExternalFunctionBuilder.
func (*ExternalFunctionBuilder) WithCompression ¶ added in v0.34.0
func (fb *ExternalFunctionBuilder) WithCompression(compression string) *ExternalFunctionBuilder
WithCompression adds a compression to the ExternalFunctionBuilder.
func (*ExternalFunctionBuilder) WithContextHeaders ¶ added in v0.34.0
func (fb *ExternalFunctionBuilder) WithContextHeaders(contextHeaders []string) *ExternalFunctionBuilder
WithContextHeaders sets the context headers on the ExternalFunctionBuilder.
func (*ExternalFunctionBuilder) WithHeaders ¶ added in v0.34.0
func (fb *ExternalFunctionBuilder) WithHeaders(headers []map[string]string) *ExternalFunctionBuilder
WithHeaders sets the headers on the ExternalFunctionBuilder.
func (*ExternalFunctionBuilder) WithMaxBatchRows ¶ added in v0.34.0
func (fb *ExternalFunctionBuilder) WithMaxBatchRows(maxBatchRows int) *ExternalFunctionBuilder
WithMaxBatchRows adds a maxBatchRows to the ExternalFunctionBuilder.
func (*ExternalFunctionBuilder) WithNullInputBehavior ¶ added in v0.34.0
func (fb *ExternalFunctionBuilder) WithNullInputBehavior(nullInputBehavior string) *ExternalFunctionBuilder
WithNullInputBehavior adds a nullInputBehavior to the ExternalFunctionBuilder.
func (*ExternalFunctionBuilder) WithRequestTranslator ¶ added in v0.64.0
func (fb *ExternalFunctionBuilder) WithRequestTranslator(requestTranslator string) *ExternalFunctionBuilder
WithRequestTranslator adds a request translator to the ExternalFunctionBuilder.
func (*ExternalFunctionBuilder) WithResponseTranslator ¶ added in v0.64.0
func (fb *ExternalFunctionBuilder) WithResponseTranslator(responseTranslator string) *ExternalFunctionBuilder
WithResponseTranslator adds a response translator to the ExternalFunctionBuilder.
func (*ExternalFunctionBuilder) WithReturnBehavior ¶ added in v0.34.0
func (fb *ExternalFunctionBuilder) WithReturnBehavior(returnBehavior string) *ExternalFunctionBuilder
WithReturnBehavior adds a returnBehavior to the ExternalFunctionBuilder.
func (*ExternalFunctionBuilder) WithReturnNullAllowed ¶ added in v0.34.0
func (fb *ExternalFunctionBuilder) WithReturnNullAllowed(returnNullAllowed bool) *ExternalFunctionBuilder
WithReturnNullAllowed adds a returnNullAllowed to the ExternalFunctionBuilder.
func (*ExternalFunctionBuilder) WithReturnType ¶ added in v0.34.0
func (fb *ExternalFunctionBuilder) WithReturnType(returnType string) *ExternalFunctionBuilder
WithReturnType adds a returnType to the ExternalFunctionBuilder.
func (*ExternalFunctionBuilder) WithURLOfProxyAndResource ¶ added in v0.34.0
func (fb *ExternalFunctionBuilder) WithURLOfProxyAndResource(urlOfProxyAndResource string) *ExternalFunctionBuilder
WithURLOfProxyAndResource adds a urlOfProxyAndResource to the ExternalFunctionBuilder.
type ExternalFunctionDescription ¶ added in v0.54.0
type ExternalFunctionDescription struct { Property sql.NullString `db:"property"` Value sql.NullString `db:"value"` }
func ScanExternalFunctionDescription ¶ added in v0.34.0
func ScanExternalFunctionDescription(rows *sqlx.Rows) ([]ExternalFunctionDescription, error)
ScanExternalFunctionDescription.
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 Function ¶ added in v0.34.0
type Function struct { Comment sql.NullString `db:"description"` IsSecure sql.NullString `db:"is_secure"` Name sql.NullString `db:"name"` SchemaName sql.NullString `db:"schema_name"` Text sql.NullString `db:"text"` DatabaseName sql.NullString `db:"database_name"` Arguments sql.NullString `db:"arguments"` }
func ScanFunctions ¶ added in v0.34.0
SHOW FUNCTION can return more than one item because of function names overloading https://docs.snowflake.com/en/sql-reference/sql/show-functions.html
type FunctionBuilder ¶ added in v0.34.0
type FunctionBuilder struct {
// contains filtered or unexported fields
}
FunctionBuilder abstracts the creation of Function.
func NewFunctionBuilder ¶ added in v0.54.0
func NewFunctionBuilder(db, schema, name string, argTypes []string) *FunctionBuilder
Function returns a pointer to a Builder that abstracts the DDL operations for a stored function.
Supported DDL operations are:
- CREATE FUNCTION
- ALTER FUNCTION
- DROP FUNCTION
- SHOW FUNCTION
- DESCRIBE
[Snowflake Reference](https://docs.snowflake.com/en/sql-reference/user-defined-functions.html)
func (*FunctionBuilder) ArgTypes ¶ added in v0.34.0
func (pb *FunctionBuilder) ArgTypes() []string
Returns the argument types.
func (*FunctionBuilder) ArgumentsSignature ¶ added in v0.34.0
func (pb *FunctionBuilder) ArgumentsSignature() (string, error)
Returns the arguments signature of the function in a form <function>(<type>, <type>, ..) RETURN <type>.
func (*FunctionBuilder) ChangeComment ¶ added in v0.34.0
func (pb *FunctionBuilder) ChangeComment(c string) (string, error)
ChangeComment returns the SQL query that will update the comment on the function.
func (*FunctionBuilder) Create ¶ added in v0.34.0
func (pb *FunctionBuilder) Create() (string, error)
Create returns the SQL query that will create a new function.
func (*FunctionBuilder) Describe ¶ added in v0.34.0
func (pb *FunctionBuilder) Describe() (string, error)
To describe the function the name must be specified as fully qualified name including argument types.
func (*FunctionBuilder) Drop ¶ added in v0.34.0
func (pb *FunctionBuilder) Drop() (string, error)
Drop returns the SQL query that will drop the function.
func (*FunctionBuilder) QualifiedName ¶ added in v0.34.0
func (pb *FunctionBuilder) QualifiedName() (string, error)
QualifiedName prepends the db and schema and appends argument types.
func (*FunctionBuilder) QualifiedNameWithoutArguments ¶ added in v0.34.0
func (pb *FunctionBuilder) QualifiedNameWithoutArguments() (string, error)
QualifiedNameWithoutArguments prepends the db and schema if set.
func (*FunctionBuilder) RemoveComment ¶ added in v0.34.0
func (pb *FunctionBuilder) RemoveComment() (string, error)
RemoveComment returns the SQL query that will remove the comment on the function.
func (*FunctionBuilder) Rename ¶ added in v0.34.0
func (pb *FunctionBuilder) Rename(newName string) (string, error)
Rename returns the SQL query that will rename the function.
func (*FunctionBuilder) Secure ¶ added in v0.59.0
func (pb *FunctionBuilder) Secure() (string, error)
Secure returns the SQL query that will change the function to a secure function.
func (*FunctionBuilder) Show ¶ added in v0.34.0
func (pb *FunctionBuilder) Show() string
Show returns the SQL query that will show the row representing this function. This show statement returns all functions with the given name (overloaded ones).
func (*FunctionBuilder) Unsecure ¶ added in v0.59.0
func (pb *FunctionBuilder) Unsecure() (string, error)
Unsecure returns the SQL query that will change the function to a normal (unsecured) function.
func (*FunctionBuilder) WithArgs ¶ added in v0.34.0
func (pb *FunctionBuilder) WithArgs(args []map[string]string) *FunctionBuilder
WithArgs sets the args and argumentTypes on the FunctionBuilder.
func (*FunctionBuilder) WithComment ¶ added in v0.34.0
func (pb *FunctionBuilder) WithComment(c string) *FunctionBuilder
WithComment adds a comment to the FunctionBuilder.
func (*FunctionBuilder) WithHandler ¶ added in v0.34.0
func (pb *FunctionBuilder) WithHandler(s string) *FunctionBuilder
WithHandler sets the handler method for Java / Python function.
func (*FunctionBuilder) WithImports ¶ added in v0.34.0
func (pb *FunctionBuilder) WithImports(s []string) *FunctionBuilder
WithImports adds jar files to import for Java function or Python file for Python function.
func (*FunctionBuilder) WithLanguage ¶ added in v0.34.0
func (pb *FunctionBuilder) WithLanguage(s string) *FunctionBuilder
WithLanguage sets the language to SQL, JAVA or JAVASCRIPT.
func (*FunctionBuilder) WithNullInputBehavior ¶ added in v0.34.0
func (pb *FunctionBuilder) WithNullInputBehavior(s string) *FunctionBuilder
WithNullInputBehavior.
func (*FunctionBuilder) WithPackages ¶ added in v0.37.0
func (pb *FunctionBuilder) WithPackages(s []string) *FunctionBuilder
WithPackages.
func (*FunctionBuilder) WithReturnBehavior ¶ added in v0.34.0
func (pb *FunctionBuilder) WithReturnBehavior(s string) *FunctionBuilder
WithReturnBehavior.
func (*FunctionBuilder) WithReturnType ¶ added in v0.34.0
func (pb *FunctionBuilder) WithReturnType(s string) *FunctionBuilder
WithReturnType adds the data type of the return type to the FunctionBuilder.
func (*FunctionBuilder) WithRuntimeVersion ¶ added in v0.37.0
func (pb *FunctionBuilder) WithRuntimeVersion(r string) *FunctionBuilder
WithRuntimeVersion.
func (*FunctionBuilder) WithSecure ¶ added in v0.59.0
func (pb *FunctionBuilder) WithSecure() *FunctionBuilder
WithSecure sets the secure boolean to true [Snowflake Reference](https://docs.snowflake.com/en/sql-reference/sql/create-function)
func (*FunctionBuilder) WithStatement ¶ added in v0.34.0
func (pb *FunctionBuilder) WithStatement(s string) *FunctionBuilder
WithStatement adds the SQL/JAVASCRIPT/JAVA statement to be used for the function.
func (*FunctionBuilder) WithTargetPath ¶ added in v0.34.0
func (pb *FunctionBuilder) WithTargetPath(s string) *FunctionBuilder
WithTargetPath sets the target path for compiled jar file for Java function or Python file for Python function.
type FunctionDescription ¶ added in v0.54.0
type FunctionDescription struct { Property sql.NullString `db:"property"` Value sql.NullString `db:"value"` }
func ScanFunctionDescription ¶ added in v0.34.0
func ScanFunctionDescription(rows *sqlx.Rows) ([]FunctionDescription, error)
ScanFunctionDescription reads through the rows with property and value columns and returns a slice of functionDescription structs.
type FutureGrantBuilder ¶ added in v0.34.0
type FutureGrantBuilder struct {
// contains filtered or unexported fields
}
FutureGrantBuilder abstracts the creation of FutureGrantExecutables.
func (*FutureGrantBuilder) GrantType ¶ added in v0.34.0
func (fgb *FutureGrantBuilder) GrantType() string
func (*FutureGrantBuilder) Name ¶ added in v0.34.0
func (fgb *FutureGrantBuilder) Name() string
Name returns the object name for this FutureGrantBuilder.
func (*FutureGrantBuilder) Role ¶ added in v0.34.0
func (fgb *FutureGrantBuilder) Role(n string) GrantExecutable
Role returns a pointer to a FutureGrantExecutable for a role.
func (*FutureGrantBuilder) Share ¶ added in v0.34.0
func (fgb *FutureGrantBuilder) Share(_ string) GrantExecutable
Share is not implemented because future objects cannot be granted to shares.
func (*FutureGrantBuilder) Show ¶ added in v0.34.0
func (fgb *FutureGrantBuilder) Show() string
Show returns the SQL that will show all privileges on the grant.
type FutureGrantExecutable ¶ added in v0.34.0
type FutureGrantExecutable struct {
// contains filtered or unexported fields
}
FutureGrantExecutable abstracts the creation of SQL queries to build future grants for different future grant types.
func (*FutureGrantExecutable) Grant ¶ added in v0.34.0
func (fge *FutureGrantExecutable) Grant(p string, w bool) string
Grant returns the SQL that will grant future privileges on the grant to the grantee.
func (*FutureGrantExecutable) Revoke ¶ added in v0.34.0
func (fge *FutureGrantExecutable) Revoke(p string) []string
Revoke returns the SQL that will revoke future privileges on the grant from the grantee.
func (*FutureGrantExecutable) RevokeOwnership ¶ added in v0.65.0
func (fge *FutureGrantExecutable) RevokeOwnership(r string) []string
Revoke returns the SQL that will revoke ownership privileges on the grant from the grantee. Note: returns the same SQL as Revoke.
func (*FutureGrantExecutable) Show ¶ added in v0.34.0
func (fge *FutureGrantExecutable) Show() string
Show returns the SQL that will show all future grants on the schema.
type GrantBuilder ¶ added in v0.34.0
type GrantBuilder interface { Name() string GrantType() string Role(string) GrantExecutable Show() string }
func AccountGrant ¶ added in v0.34.0
func AccountGrant() GrantBuilder
AccountGrant returns a pointer to a CurrentGrantBuilder for an account.
func AllExternalTableGrant ¶ added in v0.64.0
func AllExternalTableGrant(db, schema string) GrantBuilder
AllExternalTableGrant returns a pointer to a AllGrantBuilder for a external table.
func AllFileFormatGrant ¶ added in v0.64.0
func AllFileFormatGrant(db, schema string) GrantBuilder
AllFileFormatGrant returns a pointer to a AllGrantBuilder for a file format.
func AllFunctionGrant ¶ added in v0.64.0
func AllFunctionGrant(db, schema string) GrantBuilder
AllFunctionGrant returns a pointer to a AllGrantBuilder for a function.
func AllMaterializedViewGrant ¶ added in v0.62.0
func AllMaterializedViewGrant(db, schema string) GrantBuilder
AllMaterializedViewGrant returns a pointer to a AllGrantBuilder for a view.
func AllProcedureGrant ¶ added in v0.64.0
func AllProcedureGrant(db, schema string) GrantBuilder
AllProcedureGrant returns a pointer to a AllGrantBuilder for a procedure.
func AllSchemaGrant ¶ added in v0.62.0
func AllSchemaGrant(db string) GrantBuilder
AllSchemaGrant returns a pointer to a AllGrantBuilder for a schema.
func AllSequenceGrant ¶ added in v0.64.0
func AllSequenceGrant(db, schema string) GrantBuilder
AllSequenceGrant returns a pointer to a AllGrantBuilder for a sequence.
func AllStageGrant ¶ added in v0.62.0
func AllStageGrant(db, schema string) GrantBuilder
AllStageGrant returns a pointer to a AllGrantBuilder for a stage.
func AllStreamGrant ¶ added in v0.64.0
func AllStreamGrant(db, schema string) GrantBuilder
AllStreamGrant returns a pointer to a AllGrantBuilder for a stream.
func AllTableGrant ¶ added in v0.61.0
func AllTableGrant(db, schema string) GrantBuilder
AllTableGrant returns a pointer to a AllGrantBuilder for a table.
func AllTaskGrant ¶ added in v0.64.0
func AllTaskGrant(db, schema string) GrantBuilder
AllTaskGrant returns a pointer to a AllGrantBuilder for a task.
func AllViewGrant ¶ added in v0.62.0
func AllViewGrant(db, schema string) GrantBuilder
AllViewGrant returns a pointer to a AllGrantBuilder for a view.
func DatabaseGrant ¶ added in v0.34.0
func DatabaseGrant(name string) GrantBuilder
DatabaseGrant returns a pointer to a CurrentGrantBuilder for a database.
func ExternalTableGrant ¶ added in v0.34.0
func ExternalTableGrant(db, schema, externalTable string) GrantBuilder
ExternalTableGrant returns a pointer to a CurrentGrantBuilder for an external table.
func FailoverGroupGrant ¶ added in v0.65.0
func FailoverGroupGrant(failoverGroup string) GrantBuilder
FailoverGroupGrant returns a pointer to a CurrentGrantBuilder for a failover group.
func FileFormatGrant ¶ added in v0.34.0
func FileFormatGrant(db, schema, fileFormat string) GrantBuilder
FileFormatGrant returns a pointer to a CurrentGrantBuilder for a file format.
func FunctionGrant ¶ added in v0.34.0
func FunctionGrant(db, schema, function string, argumentTypes []string) GrantBuilder
FunctionGrant returns a pointer to a CurrentGrantBuilder for a view.
func FutureExternalTableGrant ¶ added in v0.34.0
func FutureExternalTableGrant(db, schema string) GrantBuilder
FutureExternalTableGrant returns a pointer to a FutureGrantBuilder for a external table.
func FutureFileFormatGrant ¶ added in v0.34.0
func FutureFileFormatGrant(db, schema string) GrantBuilder
FutureFileFormatGrant returns a pointer to a FutureGrantBuilder for a file format.
func FutureFunctionGrant ¶ added in v0.34.0
func FutureFunctionGrant(db, schema string) GrantBuilder
FutureFunctionGrant returns a pointer to a FutureGrantBuilder for a function.
func FutureMaterializedViewGrant ¶ added in v0.34.0
func FutureMaterializedViewGrant(db, schema string) GrantBuilder
FutureMaterializedViewGrant returns a pointer to a FutureGrantBuilder for a view.
func FuturePipeGrant ¶ added in v0.34.0
func FuturePipeGrant(db, schema string) GrantBuilder
FuturePipeGrant returns a pointer to a FutureGrantBuilder for a pipe.
func FutureProcedureGrant ¶ added in v0.34.0
func FutureProcedureGrant(db, schema string) GrantBuilder
FutureProcedureGrant returns a pointer to a FutureGrantBuilder for a procedure.
func FutureSchemaGrant ¶ added in v0.34.0
func FutureSchemaGrant(db string) GrantBuilder
FutureSchemaGrant returns a pointer to a FutureGrantBuilder for a schema.
func FutureSequenceGrant ¶ added in v0.34.0
func FutureSequenceGrant(db, schema string) GrantBuilder
FutureSequenceGrant returns a pointer to a FutureGrantBuilder for a sequence.
func FutureStageGrant ¶ added in v0.34.0
func FutureStageGrant(db, schema string) GrantBuilder
FutureStageGrant returns a pointer to a FutureGrantBuilder for a stage.
func FutureStreamGrant ¶ added in v0.34.0
func FutureStreamGrant(db, schema string) GrantBuilder
FutureStreamGrant returns a pointer to a FutureGrantBuilder for a stream.
func FutureTableGrant ¶ added in v0.34.0
func FutureTableGrant(db, schema string) GrantBuilder
FutureTableGrant returns a pointer to a FutureGrantBuilder for a table.
func FutureTaskGrant ¶ added in v0.34.0
func FutureTaskGrant(db, schema string) GrantBuilder
FutureTaskGrant returns a pointer to a FutureGrantBuilder for a task.
func FutureViewGrant ¶ added in v0.34.0
func FutureViewGrant(db, schema string) GrantBuilder
FutureViewGrant returns a pointer to a FutureGrantBuilder for a view.
func IntegrationGrant ¶ added in v0.34.0
func IntegrationGrant(w string) GrantBuilder
IntegrationGrant returns a pointer to a CurrentGrantBuilder for an integration.
func MaskingPolicyGrant ¶ added in v0.34.0
func MaskingPolicyGrant(db, schema, maskingPolicy string) GrantBuilder
MaskingPolicyGrant returns a pointer to a CurrentGrantBuilder for a masking policy.
func MaterializedViewGrant ¶ added in v0.34.0
func MaterializedViewGrant(db, schema, view string) GrantBuilder
MaterializedViewGrant returns a pointer to a CurrentGrantBuilder for a materialized view.
func PipeGrant ¶ added in v0.34.0
func PipeGrant(db, schema, pipe string) GrantBuilder
PipeGrant returns a pointer to a CurrentGrantBuilder for a pipe.
func ProcedureGrant ¶ added in v0.34.0
func ProcedureGrant(db, schema, procedure string, argumentTypes []string) GrantBuilder
ProcedureGrant returns a pointer to a CurrentGrantBuilder for a procedure.
func ResourceMonitorGrant ¶ added in v0.34.0
func ResourceMonitorGrant(w string) GrantBuilder
ResourceMonitorGrant returns a pointer to a CurrentGrantBuilder for a resource monitor.
func RowAccessPolicyGrant ¶ added in v0.34.0
func RowAccessPolicyGrant(db, schema, rowAccessPolicy string) GrantBuilder
RowAccessPolicyGrant returns a pointer to a CurrentGrantBuilder for a masking policy.
func SchemaGrant ¶ added in v0.34.0
func SchemaGrant(db, schema string) GrantBuilder
SchemaGrant returns a pointer to a CurrentGrantBuilder for a schema.
func SequenceGrant ¶ added in v0.34.0
func SequenceGrant(db, schema, sequence string) GrantBuilder
SequenceGrant returns a pointer to a CurrentGrantBuilder for a sequence.
func StageGrant ¶ added in v0.34.0
func StageGrant(db, schema, stage string) GrantBuilder
StageGrant returns a pointer to a CurrentGrantBuilder for a stage.
func StreamGrant ¶ added in v0.34.0
func StreamGrant(db, schema, stream string) GrantBuilder
StreamGrant returns a pointer to a CurrentGrantBuilder for a stream.
func TableGrant ¶ added in v0.34.0
func TableGrant(db, schema, table string) GrantBuilder
TableGrant returns a pointer to a CurrentGrantBuilder for a table.
func TagGrant ¶ added in v0.41.0
func TagGrant(db, schema, tag string) GrantBuilder
TagGrant returns a pointer to a CurrentGrantBuilder for a tag grant.
func TaskGrant ¶ added in v0.34.0
func TaskGrant(db, schema, task string) GrantBuilder
TaskGrant returns a pointer to a CurrentGrantBuilder for a task.
func UserGrant ¶ added in v0.44.0
func UserGrant(w string) GrantBuilder
UserGrant returns a pointer to a CurrentGrantBuilder for a user.
func ViewGrant ¶ added in v0.34.0
func ViewGrant(db, schema, view string) GrantBuilder
ViewGrant returns a pointer to a CurrentGrantBuilder for a view.
func WarehouseGrant ¶ added in v0.34.0
func WarehouseGrant(w string) GrantBuilder
WarehouseGrant returns a pointer to a CurrentGrantBuilder for a warehouse.
type GrantDetail ¶ added in v0.52.0
type GrantDetail struct { CreatedOn sql.NullString `db:"created_on"` Privilege sql.NullString `db:"privilege"` GrantedOn sql.NullString `db:"granted_on"` Name sql.NullString `db:"name"` GrantedTo sql.NullString `db:"granted_to"` GranteeName sql.NullString `db:"grantee_name"` GrantOption sql.NullString `db:"grant_option"` GrantedBy sql.NullString `db:"granted_by"` }
func ShowFutureGrantsIn ¶ added in v0.52.0
func ShowFutureGrantsIn(db *sql.DB, objectType, objectName string) ([]GrantDetail, error)
func ShowFutureGrantsTo ¶ added in v0.52.0
func ShowFutureGrantsTo(db *sql.DB, objectType, objectName string) ([]GrantDetail, error)
func ShowGrantsOf ¶ added in v0.52.0
func ShowGrantsOf(db *sql.DB, objectType, objectName string) ([]GrantDetail, error)
func ShowGrantsOn ¶ added in v0.52.0
func ShowGrantsOn(db *sql.DB, objectType, objectName string) ([]GrantDetail, error)
func ShowGrantsOnAccount ¶ added in v0.52.0
func ShowGrantsOnAccount(db *sql.DB) ([]GrantDetail, error)
func ShowGrantsTo ¶ added in v0.52.0
func ShowGrantsTo(db *sql.DB, objectType, objectName string) ([]GrantDetail, error)
type GrantExecutable ¶ added in v0.34.0
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 ManagedAccount ¶ added in v0.34.0
type ManagedAccount struct { Name sql.NullString `db:"name"` Cloud sql.NullString `db:"cloud"` Region sql.NullString `db:"region"` Locator sql.NullString `db:"locator"` CreatedOn sql.NullString `db:"created_on"` URL sql.NullString `db:"url"` Comment sql.NullString `db:"comment"` IsReader bool `db:"is_reader"` }
func ScanManagedAccount ¶ added in v0.34.0
func ScanManagedAccount(row *sqlx.Row) (*ManagedAccount, error)
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 MaterializedView ¶ added in v0.34.0
type MaterializedView struct { Comment sql.NullString `db:"comment"` IsSecure bool `db:"is_secure"` Name sql.NullString `db:"name"` SchemaName sql.NullString `db:"schema_name"` Text sql.NullString `db:"text"` DatabaseName sql.NullString `db:"database_name"` WarehouseName sql.NullString `db:"warehouse_name"` }
func ListMaterializedViews ¶ added in v0.34.0
func ScanMaterializedView ¶ added in v0.34.0
func ScanMaterializedView(row *sqlx.Row) (*MaterializedView, error)
type MaterializedViewBuilder ¶ added in v0.34.0
type MaterializedViewBuilder struct {
// contains filtered or unexported fields
}
MaterializedViewBuilder abstracts the creation of SQL queries for a Snowflake Materialized View.
func NewMaterializedViewBuilder ¶ added in v0.54.0
func NewMaterializedViewBuilder(name string) *MaterializedViewBuilder
View returns a pointer to a Builder that abstracts the DDL operations for a view.
Supported DDL operations are:
- CREATE MATERIALIZED VIEW
- ALTER MATERIALIZED VIEW
- DROP MATERIALIZED VIEW
- SHOW MATERIALIZED VIEWS
- DESCRIBE MATERIALIZED VIEW
[Snowflake Reference](https://docs.snowflake.com/en/sql-reference/ddl-table.html#materialized-view-management)
func (*MaterializedViewBuilder) AddTag ¶ added in v0.34.0
func (vb *MaterializedViewBuilder) AddTag(tag TagValue) string
AddTag returns the SQL query that will add a new tag to the view.
func (*MaterializedViewBuilder) ChangeComment ¶ added in v0.34.0
func (vb *MaterializedViewBuilder) ChangeComment(c string) string
ChangeComment returns the SQL query that will update the comment on the view. Note that comment is the only parameter, if more are released this should be abstracted as per the generic builder.
func (*MaterializedViewBuilder) ChangeTag ¶ added in v0.34.0
func (vb *MaterializedViewBuilder) ChangeTag(tag TagValue) string
ChangeTag returns the SQL query that will alter a tag on the view.
func (*MaterializedViewBuilder) Create ¶ added in v0.34.0
func (vb *MaterializedViewBuilder) Create() []string
Create returns the SQL query that will create a new view.
func (*MaterializedViewBuilder) Drop ¶ added in v0.34.0
func (vb *MaterializedViewBuilder) Drop() string
Drop returns the SQL query that will drop the row representing this view.
func (*MaterializedViewBuilder) QualifiedName ¶ added in v0.34.0
func (vb *MaterializedViewBuilder) QualifiedName() string
QualifiedName prepends the db and schema if set and escapes everything nicely.
func (*MaterializedViewBuilder) RemoveComment ¶ added in v0.34.0
func (vb *MaterializedViewBuilder) RemoveComment() string
RemoveComment returns the SQL query that will remove the comment on the view. Note that comment is the only parameter, if more are released this should be abstracted as per the generic builder.
func (*MaterializedViewBuilder) Rename ¶ added in v0.34.0
func (vb *MaterializedViewBuilder) Rename(newName string) string
Rename returns the SQL query that will rename the view.
func (*MaterializedViewBuilder) Secure ¶ added in v0.34.0
func (vb *MaterializedViewBuilder) Secure() string
Secure returns the SQL query that will change the view to a secure view.
func (*MaterializedViewBuilder) Show ¶ added in v0.34.0
func (vb *MaterializedViewBuilder) Show() string
Show returns the SQL query that will show the row representing this view.
func (*MaterializedViewBuilder) Unsecure ¶ added in v0.34.0
func (vb *MaterializedViewBuilder) Unsecure() string
Unsecure returns the SQL query that will change the view to a normal (unsecured) view.
func (*MaterializedViewBuilder) UnsetTag ¶ added in v0.34.0
func (vb *MaterializedViewBuilder) UnsetTag(tag TagValue) string
UnsetTag returns the SQL query that will unset a tag on the view.
func (*MaterializedViewBuilder) WithComment ¶ added in v0.34.0
func (vb *MaterializedViewBuilder) WithComment(c string) *MaterializedViewBuilder
WithComment adds a comment to the MaterializedViewBuilder.
func (*MaterializedViewBuilder) WithDB ¶ added in v0.34.0
func (vb *MaterializedViewBuilder) WithDB(db string) *MaterializedViewBuilder
WithDB adds the name of the database to the MaterializedViewBuilder.
func (*MaterializedViewBuilder) WithReplace ¶ added in v0.34.0
func (vb *MaterializedViewBuilder) WithReplace() *MaterializedViewBuilder
WithReplace adds the "OR REPLACE" option to the MaterializedViewBuilder.
func (*MaterializedViewBuilder) WithSchema ¶ added in v0.34.0
func (vb *MaterializedViewBuilder) WithSchema(s string) *MaterializedViewBuilder
WithSchema adds the name of the schema to the MaterializedViewBuilder.
func (*MaterializedViewBuilder) WithSecure ¶ added in v0.34.0
func (vb *MaterializedViewBuilder) WithSecure() *MaterializedViewBuilder
WithSecure sets the secure boolean to true [Snowflake Reference](https://docs.snowflake.net/manuals/user-guide/views-secure.html)
func (*MaterializedViewBuilder) WithStatement ¶ added in v0.34.0
func (vb *MaterializedViewBuilder) WithStatement(s string) *MaterializedViewBuilder
WithStatement adds the SQL statement to be used for the view.
func (*MaterializedViewBuilder) WithTags ¶ added in v0.34.0
func (vb *MaterializedViewBuilder) WithTags(tags []TagValue) *MaterializedViewBuilder
WithTags sets the tags on the ExternalTableBuilder.
func (*MaterializedViewBuilder) WithWarehouse ¶ added in v0.34.0
func (vb *MaterializedViewBuilder) WithWarehouse(s string) *MaterializedViewBuilder
WithWarehouse adds the name of the warehouse to the MaterializedViewBuilder.
type NetworkPolicyAttachmentStruct ¶ added in v0.34.0
type NetworkPolicyAttachmentStruct struct { Key sql.NullString `db:"key"` Value sql.NullString `db:"value"` Level sql.NullString `db:"level"` }
func ScanNetworkPolicyAttachment ¶ added in v0.34.0
func ScanNetworkPolicyAttachment(row *sqlx.Row) (*NetworkPolicyAttachmentStruct, error)
type NetworkPolicyBuilder ¶ added in v0.34.0
type NetworkPolicyBuilder struct {
// contains filtered or unexported fields
}
NetworkPolicyBuilder abstracts the creation of SQL queries for a Snowflake Network Policy.
func NetworkPolicy ¶ added in v0.34.0
func NetworkPolicy(name string) *NetworkPolicyBuilder
NetworkPolicy returns a pointer to a Builder that abstracts the DDL operations for a network policy.
Supported DDL operations are:
- CREATE NETWORK POLICY
- DROP NETWORK POLICY
- SHOW NETWORK POLICIES
[Snowflake Reference](https://docs.snowflake.com/en/user-guide/network-policies.html)
func (*NetworkPolicyBuilder) SetOnAccount ¶ added in v0.34.0
func (npb *NetworkPolicyBuilder) SetOnAccount() string
SetOnAccount returns the SQL query that will set the network policy globally on your Snowflake account.
func (*NetworkPolicyBuilder) SetOnUser ¶ added in v0.34.0
func (npb *NetworkPolicyBuilder) SetOnUser(u string) string
SetOnUser returns the SQL query that will set the network policy on a given user.
func (*NetworkPolicyBuilder) ShowOnAccount ¶ added in v0.34.0
func (npb *NetworkPolicyBuilder) ShowOnAccount() string
ShowOnAccount returns the SQL query that will SHOW network policy set on Account.
func (*NetworkPolicyBuilder) ShowOnUser ¶ added in v0.34.0
func (npb *NetworkPolicyBuilder) ShowOnUser(u string) string
ShowOnUser returns the SQL query that will SHOW network policy set on a specific User.
func (*NetworkPolicyBuilder) UnsetOnAccount ¶ added in v0.34.0
func (npb *NetworkPolicyBuilder) UnsetOnAccount() string
UnsetOnAccount returns the SQL query that will unset the network policy globally on your Snowflake account.
func (*NetworkPolicyBuilder) UnsetOnUser ¶ added in v0.34.0
func (npb *NetworkPolicyBuilder) UnsetOnUser(u string) string
UnsetOnUser returns the SQL query that will unset the network policy of a given user.
type NotificationIntegration ¶ added in v0.34.0
type NotificationIntegration struct { Name sql.NullString `db:"name"` Category sql.NullString `db:"category"` Type sql.NullString `db:"type"` CreatedOn sql.NullString `db:"created_on"` Enabled sql.NullBool `db:"enabled"` }
func ScanNotificationIntegration ¶ added in v0.34.0
func ScanNotificationIntegration(row *sqlx.Row) (*NotificationIntegration, error)
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 PrimaryKey ¶ added in v0.34.0
type PrimaryKey struct {
// contains filtered or unexported fields
}
PrimaryKey structure that represents a tables primary key.
func (*PrimaryKey) WithKeys ¶ added in v0.34.0
func (pk *PrimaryKey) WithKeys(keys []string) *PrimaryKey
WithKeys set the primary key keys.
func (*PrimaryKey) WithName ¶ added in v0.34.0
func (pk *PrimaryKey) WithName(name string) *PrimaryKey
WithName set the primary key name.
type PrimaryKeyDescription ¶ added in v0.54.0
type PrimaryKeyDescription struct { ColumnName sql.NullString `db:"column_name"` KeySequence sql.NullString `db:"key_sequence"` ConstraintName sql.NullString `db:"constraint_name"` }
func ScanPrimaryKeyDescription ¶ added in v0.34.0
func ScanPrimaryKeyDescription(rows *sqlx.Rows) ([]PrimaryKeyDescription, error)
type PrivateLinkConfig ¶ added in v0.34.0
type Procedure ¶ added in v0.34.0
type Procedure struct { Comment sql.NullString `db:"description"` // Snowflake returns is_secure in the show procedure output, but it is irrelevant Name sql.NullString `db:"name"` SchemaName sql.NullString `db:"schema_name"` Text sql.NullString `db:"text"` DatabaseName sql.NullString `db:"catalog_name"` Arguments sql.NullString `db:"arguments"` }
func ListProcedures ¶ added in v0.34.0
func ScanProcedures ¶ added in v0.34.0
SHOW PROCEDURE can return more than one item because of procedure names overloading https://docs.snowflake.com/en/sql-reference/sql/show-procedures.html
type ProcedureBuilder ¶ added in v0.34.0
type ProcedureBuilder struct {
// contains filtered or unexported fields
}
ProcedureBuilder abstracts the creation of Stored Procedure.
func NewProcedureBuilder ¶ added in v0.54.0
func NewProcedureBuilder(db, schema, name string, argTypes []string) *ProcedureBuilder
Procedure returns a pointer to a Builder that abstracts the DDL operations for a stored procedure.
Supported DDL operations are:
- CREATE PROCEDURE
- ALTER PROCEDURE
- DROP PROCEDURE
- SHOW PROCEDURE
- DESCRIBE
[Snowflake Reference](https://docs.snowflake.com/en/sql-reference/stored-procedures.html)
func (*ProcedureBuilder) ArgTypes ¶ added in v0.34.0
func (pb *ProcedureBuilder) ArgTypes() []string
Returns the argument types.
func (*ProcedureBuilder) ArgumentsSignature ¶ added in v0.34.0
func (pb *ProcedureBuilder) ArgumentsSignature() (string, error)
Returns the arguments signature of the procedure in a form <PROCEDURE>(<TYPE>, <TYPE>, ..)
func (*ProcedureBuilder) ChangeComment ¶ added in v0.34.0
func (pb *ProcedureBuilder) ChangeComment(c string) (string, error)
ChangeComment returns the SQL query that will update the comment on the procedure.
func (*ProcedureBuilder) ChangeExecuteAs ¶ added in v0.34.0
func (pb *ProcedureBuilder) ChangeExecuteAs(c string) (string, error)
ChangeExecuteAs returns the SQL query that will update the call mode on the procedure.
func (*ProcedureBuilder) Create ¶ added in v0.34.0
func (pb *ProcedureBuilder) Create() (string, error)
Create returns the SQL query that will create a new procedure.
func (*ProcedureBuilder) Describe ¶ added in v0.34.0
func (pb *ProcedureBuilder) Describe() (string, error)
To describe the procedure the name must be specified as fully qualified name including argument types.
func (*ProcedureBuilder) Drop ¶ added in v0.34.0
func (pb *ProcedureBuilder) Drop() (string, error)
Drop returns the SQL query that will drop the procedure.
func (*ProcedureBuilder) QualifiedName ¶ added in v0.34.0
func (pb *ProcedureBuilder) QualifiedName() (string, error)
QualifiedName prepends the db and schema and appends argument types.
func (*ProcedureBuilder) QualifiedNameWithoutArguments ¶ added in v0.34.0
func (pb *ProcedureBuilder) QualifiedNameWithoutArguments() (string, error)
QualifiedNameWithoutArguments prepends the db and schema if set.
func (*ProcedureBuilder) RemoveComment ¶ added in v0.34.0
func (pb *ProcedureBuilder) RemoveComment() (string, error)
RemoveComment returns the SQL query that will remove the comment on the procedure.
func (*ProcedureBuilder) Rename ¶ added in v0.34.0
func (pb *ProcedureBuilder) Rename(newName string) (string, error)
Rename returns the SQL query that will rename the procedure.
func (*ProcedureBuilder) Show ¶ added in v0.34.0
func (pb *ProcedureBuilder) Show() string
Show returns the SQL query that will show the row representing this procedure. This show statement returns all procedures with the given name (overloaded ones).
func (*ProcedureBuilder) WithArgs ¶ added in v0.34.0
func (pb *ProcedureBuilder) WithArgs(args []map[string]string) *ProcedureBuilder
WithArgs sets the args and argumentTypes on the ProcedureBuilder.
func (*ProcedureBuilder) WithComment ¶ added in v0.34.0
func (pb *ProcedureBuilder) WithComment(c string) *ProcedureBuilder
WithComment adds a comment to the ProcedureBuilder.
func (*ProcedureBuilder) WithExecuteAs ¶ added in v0.34.0
func (pb *ProcedureBuilder) WithExecuteAs(s string) *ProcedureBuilder
WithExecuteAs sets the execute to OWNER or CALLER.
func (*ProcedureBuilder) WithHandler ¶ added in v0.60.0
func (pb *ProcedureBuilder) WithHandler(s string) *ProcedureBuilder
WithHandler sets the handler method for Java / Python function.
func (*ProcedureBuilder) WithImports ¶ added in v0.60.0
func (pb *ProcedureBuilder) WithImports(s []string) *ProcedureBuilder
WithImports adds jar files to import for Java function or Python file for Python function.
func (*ProcedureBuilder) WithLanguage ¶ added in v0.35.0
func (pb *ProcedureBuilder) WithLanguage(s string) *ProcedureBuilder
WithLanguage sets the language to SQL, JAVA, SCALA or JAVASCRIPT.
func (*ProcedureBuilder) WithNullInputBehavior ¶ added in v0.34.0
func (pb *ProcedureBuilder) WithNullInputBehavior(s string) *ProcedureBuilder
WithNullInputBehavior.
func (*ProcedureBuilder) WithPackages ¶ added in v0.60.0
func (pb *ProcedureBuilder) WithPackages(s []string) *ProcedureBuilder
WithPackages.
func (*ProcedureBuilder) WithReturnBehavior ¶ added in v0.34.0
func (pb *ProcedureBuilder) WithReturnBehavior(s string) *ProcedureBuilder
WithReturnBehavior.
func (*ProcedureBuilder) WithReturnType ¶ added in v0.34.0
func (pb *ProcedureBuilder) WithReturnType(s string) *ProcedureBuilder
WithReturnType adds the data type of the return type to the ProcedureBuilder.
func (*ProcedureBuilder) WithRuntimeVersion ¶ added in v0.60.0
func (pb *ProcedureBuilder) WithRuntimeVersion(r string) *ProcedureBuilder
WithRuntimeVersion.
func (*ProcedureBuilder) WithStatement ¶ added in v0.34.0
func (pb *ProcedureBuilder) WithStatement(s string) *ProcedureBuilder
WithStatement adds the SQL statement to be used for the procedure.
type ProcedureDescription ¶ added in v0.54.0
type ProcedureDescription struct { Property sql.NullString `db:"property"` Value sql.NullString `db:"value"` }
func ScanProcedureDescription ¶ added in v0.34.0
func ScanProcedureDescription(rows *sqlx.Rows) ([]ProcedureDescription, error)
ScanProcedureDescription reads through the rows with property and value columns and returns a slice of procedureDescription structs.
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 Replication ¶ added in v0.34.0
type Replication struct { Region sql.NullString `db:"snowflake_region"` CreatedOn sql.NullString `db:"created_on"` AccountName sql.NullString `db:"account_name"` DBName sql.NullString `db:"name"` Comment sql.NullString `db:"comment"` IsPrimary sql.NullBool `db:"is_primary"` Primary sql.NullString `db:"primary"` ReplAccounts sql.NullString `db:"replication_allowed_to_accounts"` FailoverAccounts sql.NullString `db:"failover_allowed_to_accounts"` Org sql.NullString `db:"organization_name"` AccountLocator sql.NullString `db:"account_locator"` }
func ScanReplication ¶ added in v0.34.0
func ScanReplication(rows *sqlx.Rows, accName string) (*Replication, error)
type ReplicationBuilder ¶ added in v0.34.0
type ReplicationBuilder struct {
// contains filtered or unexported fields
}
ReplicationBuilder is a basic builder that enables replication on databases.
func NewReplicationBuilder ¶ added in v0.54.0
func NewReplicationBuilder(database string) *ReplicationBuilder
DatabaseFromDatabase returns a pointer to a builder that can create a database from a source database.
func (*ReplicationBuilder) Show ¶ added in v0.34.0
func (rb *ReplicationBuilder) Show() string
type ResourceMonitor ¶ added in v0.34.0
type ResourceMonitor struct { Name sql.NullString `db:"name"` CreditQuota sql.NullString `db:"credit_quota"` UsedCredits sql.NullString `db:"used_credits"` RemainingCredits sql.NullString `db:"remaining_credits"` Level sql.NullString `db:"level"` Frequency sql.NullString `db:"frequency"` StartTime sql.NullString `db:"start_time"` EndTime sql.NullString `db:"end_time"` NotifyAt sql.NullString `db:"notify_at"` SuspendAt sql.NullString `db:"suspend_at"` SuspendImmediatelyAt sql.NullString `db:"suspend_immediately_at"` CreatedOn sql.NullString `db:"created_on"` Owner sql.NullString `db:"owner"` Comment sql.NullString `db:"comment"` NotifyUsers sql.NullString `db:"notify_users"` }
func ListResourceMonitors ¶ added in v0.34.0
func ListResourceMonitors(db *sql.DB) ([]ResourceMonitor, error)
func ScanResourceMonitor ¶ added in v0.34.0
func ScanResourceMonitor(row *sqlx.Row) (*ResourceMonitor, error)
type ResourceMonitorAlterBuilder ¶ added in v0.55.0
type ResourceMonitorAlterBuilder struct { AlterPropertiesBuilder // contains filtered or unexported fields }
func (*ResourceMonitorAlterBuilder) NotifyAt ¶ added in v0.55.0
func (rcb *ResourceMonitorAlterBuilder) NotifyAt(pct int) *ResourceMonitorAlterBuilder
NotifyAt adds a notify trigger at the specified percentage threshold.
func (*ResourceMonitorAlterBuilder) SetOnAccount ¶ added in v0.55.0
func (rcb *ResourceMonitorAlterBuilder) SetOnAccount() string
SetOnAccount returns the SQL query that will set the resource monitor globally on your Snowflake account.
func (*ResourceMonitorAlterBuilder) SetOnWarehouse ¶ added in v0.55.0
func (rcb *ResourceMonitorAlterBuilder) SetOnWarehouse(warehouse string) string
SetOnWarehouse returns the SQL query that will set the resource monitor on the specified warehouse.
func (*ResourceMonitorAlterBuilder) Statement ¶ added in v0.55.0
func (rcb *ResourceMonitorAlterBuilder) Statement() string
Statement returns the SQL statement needed to actually alter the resource.
func (*ResourceMonitorAlterBuilder) SuspendAt ¶ added in v0.55.0
func (rcb *ResourceMonitorAlterBuilder) SuspendAt(pct int) *ResourceMonitorAlterBuilder
SuspendAt adds a suspend trigger at the specified percentage threshold.
func (*ResourceMonitorAlterBuilder) SuspendImmediatelyAt ¶ added in v0.55.0
func (rcb *ResourceMonitorAlterBuilder) SuspendImmediatelyAt(pct int) *ResourceMonitorAlterBuilder
SuspendImmediatelyAt adds a suspend immediately trigger at the specified percentage threshold.
func (*ResourceMonitorAlterBuilder) UnsetOnAccount ¶ added in v0.55.0
func (rcb *ResourceMonitorAlterBuilder) UnsetOnAccount() string
func (*ResourceMonitorAlterBuilder) UnsetOnWarehouse ¶ added in v0.55.0
func (rcb *ResourceMonitorAlterBuilder) UnsetOnWarehouse(warehouse string) string
UnsetOnWarehouse returns the SQL query that will unset the resource monitor on the specified warehouse.
type ResourceMonitorBuilder ¶ added in v0.34.0
type ResourceMonitorBuilder struct {
Builder
}
ResourceMonitorBuilder extends the generic builder to provide support for triggers.
func NewResourceMonitorBuilder ¶ added in v0.54.0
func NewResourceMonitorBuilder(name string) *ResourceMonitorBuilder
ResourceMonitor returns a pointer to a ResourceMonitorBuilder that abstracts the DDL operations for a resource monitor.
Supported DDL operations are:
- CREATE RESOURCE MONITOR
- ALTER RESOURCE MONITOR
- DROP RESOURCE MONITOR
- SHOW RESOURCE MONITOR
[Snowflake Reference](https://docs.snowflake.net/manuals/user-guide/resource-monitors.html#ddl-for-resource-monitors)
func (*ResourceMonitorBuilder) Alter ¶ added in v0.55.0
func (rb *ResourceMonitorBuilder) Alter() *ResourceMonitorAlterBuilder
Alter returns a pointer to a ResourceMonitorAlterBuilder.
func (*ResourceMonitorBuilder) Create ¶ added in v0.34.0
func (rb *ResourceMonitorBuilder) Create() *ResourceMonitorCreateBuilder
Create returns a pointer to a ResourceMonitorCreateBuilder.
type ResourceMonitorCreateBuilder ¶ added in v0.34.0
type ResourceMonitorCreateBuilder struct { CreateBuilder // contains filtered or unexported fields }
ResourceMonitorCreateBuilder extends the generic create builder to provide support for triggers.
func (*ResourceMonitorCreateBuilder) NotifyAt ¶ added in v0.34.0
func (rcb *ResourceMonitorCreateBuilder) NotifyAt(pct int) *ResourceMonitorCreateBuilder
NotifyAt adds a notify trigger at the specified percentage threshold.
func (*ResourceMonitorCreateBuilder) SetOnAccount ¶ added in v0.34.0
func (rcb *ResourceMonitorCreateBuilder) SetOnAccount() string
SetOnAccount returns the SQL query that will set the resource monitor globally on your Snowflake account.
func (*ResourceMonitorCreateBuilder) SetOnWarehouse ¶ added in v0.34.0
func (rcb *ResourceMonitorCreateBuilder) SetOnWarehouse(warehouse string) string
SetOnWarehouse returns the SQL query that will set the resource monitor on the specified warehouse.
func (*ResourceMonitorCreateBuilder) Statement ¶ added in v0.34.0
func (rcb *ResourceMonitorCreateBuilder) Statement() string
Statement returns the SQL statement needed to actually create the resource.
func (*ResourceMonitorCreateBuilder) SuspendAt ¶ added in v0.34.0
func (rcb *ResourceMonitorCreateBuilder) SuspendAt(pct int) *ResourceMonitorCreateBuilder
SuspendAt adds a suspend trigger at the specified percentage threshold.
func (*ResourceMonitorCreateBuilder) SuspendImmediatelyAt ¶ added in v0.34.0
func (rcb *ResourceMonitorCreateBuilder) SuspendImmediatelyAt(pct int) *ResourceMonitorCreateBuilder
SuspendImmediatelyAt adds a suspend immediately trigger at the specified percentage threshold.
type Role ¶ added in v0.3.0
type Role struct { Name sql.NullString `db:"name"` Comment sql.NullString `db:"comment"` Owner sql.NullString `db:"owner"` }
type RoleBuilder ¶ added in v0.58.0
type RoleBuilder struct {
// contains filtered or unexported fields
}
func NewRoleBuilder ¶ added in v0.54.0
func NewRoleBuilder(db *sql.DB, name string) *RoleBuilder
func (*RoleBuilder) ChangeTag ¶ added in v0.58.0
func (b *RoleBuilder) ChangeTag(tag TagValue) error
func (*RoleBuilder) Create ¶ added in v0.58.0
func (b *RoleBuilder) Create() error
func (*RoleBuilder) Drop ¶ added in v0.58.0
func (b *RoleBuilder) Drop() error
func (*RoleBuilder) Rename ¶ added in v0.58.0
func (b *RoleBuilder) Rename(newName string) error
func (*RoleBuilder) SetComment ¶ added in v0.58.0
func (b *RoleBuilder) SetComment(comment string) error
func (*RoleBuilder) SetTag ¶ added in v0.58.0
func (b *RoleBuilder) SetTag(tag TagValue) error
func (*RoleBuilder) Show ¶ added in v0.58.0
func (b *RoleBuilder) Show() (*Role, error)
func (*RoleBuilder) UnsetComment ¶ added in v0.58.0
func (b *RoleBuilder) UnsetComment() error
func (*RoleBuilder) UnsetTag ¶ added in v0.58.0
func (b *RoleBuilder) UnsetTag(tag TagValue) error
func (*RoleBuilder) WithComment ¶ added in v0.58.0
func (b *RoleBuilder) WithComment(comment string) *RoleBuilder
func (*RoleBuilder) WithName ¶ added in v0.58.0
func (b *RoleBuilder) WithName(name string) *RoleBuilder
func (*RoleBuilder) WithTags ¶ added in v0.58.0
func (b *RoleBuilder) WithTags(tags []TagValue) *RoleBuilder
type RoleGrantBuilder ¶
type RoleGrantBuilder struct {
// contains filtered or unexported fields
}
func RoleGrant ¶
func RoleGrant(name string) *RoleGrantBuilder
func (*RoleGrantBuilder) Role ¶
func (gb *RoleGrantBuilder) Role(role string) *RoleGrantExecutable
func (*RoleGrantBuilder) User ¶
func (gb *RoleGrantBuilder) User(user string) *RoleGrantExecutable
type RoleGrantExecutable ¶
type RoleGrantExecutable struct {
// contains filtered or unexported fields
}
func (*RoleGrantExecutable) Grant ¶
func (gr *RoleGrantExecutable) Grant() string
func (*RoleGrantExecutable) Revoke ¶
func (gr *RoleGrantExecutable) Revoke() string
type RoleOwnershipGrant ¶ added in v0.34.0
type RoleOwnershipGrant struct { CreatedOn sql.NullString `db:"created_on"` Name sql.NullString `db:"name"` IsDefault sql.NullString `db:"is_default"` IsCurrent sql.NullString `db:"is_current"` IsInherited sql.NullString `db:"is_inherited"` AssignedToUsers sql.NullString `db:"assigned_to_users"` GrantedToRoles sql.NullString `db:"granted_to_roles"` GrantedRoles sql.NullString `db:"granted_roles"` Owner sql.NullString `db:"owner"` Comment sql.NullString `db:"comment"` }
func ScanRoleOwnershipGrant ¶ added in v0.34.0
func ScanRoleOwnershipGrant(row *sqlx.Row) (*RoleOwnershipGrant, error)
type RoleOwnershipGrantBuilder ¶ added in v0.34.0
type RoleOwnershipGrantBuilder struct {
// contains filtered or unexported fields
}
func NewRoleOwnershipGrantBuilder ¶ added in v0.54.0
func NewRoleOwnershipGrantBuilder(role string, currentGrants string) *RoleOwnershipGrantBuilder
func (*RoleOwnershipGrantBuilder) Role ¶ added in v0.34.0
func (gb *RoleOwnershipGrantBuilder) Role(role string) *RoleOwnershipGrantExecutable
type RoleOwnershipGrantExecutable ¶ added in v0.34.0
type RoleOwnershipGrantExecutable struct {
// contains filtered or unexported fields
}
func (*RoleOwnershipGrantExecutable) Grant ¶ added in v0.34.0
func (gr *RoleOwnershipGrantExecutable) Grant() string
func (*RoleOwnershipGrantExecutable) Revoke ¶ added in v0.34.0
func (gr *RoleOwnershipGrantExecutable) Revoke() string
type RowAccessPolicyBuilder ¶ added in v0.34.0
type RowAccessPolicyBuilder struct {
// contains filtered or unexported fields
}
RowAccessPolicyBuilder abstracts the creation of SQL queries for a Snowflake Row Access Policy.
func RowAccessPolicy ¶ added in v0.34.0
func RowAccessPolicy(name, db, schema string) *RowAccessPolicyBuilder
RowAccessPolicy returns a pointer to a Builder that abstracts the DDL operations for a row access policy.
Supported DDL operations are:
- CREATE ROW ACCESS POLICY
- ALTER ROW ACCESS POLICY
- DROP ROW ACCESS POLICY
- SHOW ROW ACCESS POLICIES
- DESCRIBE ROW ACCESS POLICY
func (*RowAccessPolicyBuilder) ChangeComment ¶ added in v0.34.0
func (rapb *RowAccessPolicyBuilder) ChangeComment(c string) string
ChangeComment returns the SQL query that will update the comment on the row access policy.
func (*RowAccessPolicyBuilder) ChangeRowAccessExpression ¶ added in v0.34.0
func (rapb *RowAccessPolicyBuilder) ChangeRowAccessExpression(rowAccessExpression string) string
ChangeRowAccessExpression returns the SQL query that will update the row access expression on the row access policy.
func (*RowAccessPolicyBuilder) Create ¶ added in v0.34.0
func (rapb *RowAccessPolicyBuilder) Create() string
Create returns the SQL query that will create a row access policy.
func (*RowAccessPolicyBuilder) Describe ¶ added in v0.34.0
func (rapb *RowAccessPolicyBuilder) Describe() string
Describe returns the SQL query that will describe a row access policy.
func (*RowAccessPolicyBuilder) Drop ¶ added in v0.34.0
func (rapb *RowAccessPolicyBuilder) Drop() string
Drop returns the SQL query that will drop a row access policy.
func (*RowAccessPolicyBuilder) QualifiedName ¶ added in v0.34.0
func (rapb *RowAccessPolicyBuilder) QualifiedName() string
QualifiedName prepends the db and schema if set and escapes everything nicely.
func (*RowAccessPolicyBuilder) RemoveComment ¶ added in v0.34.0
func (rapb *RowAccessPolicyBuilder) RemoveComment() string
RemoveComment returns the SQL query that will remove the comment on the row access policy.
func (*RowAccessPolicyBuilder) Show ¶ added in v0.34.0
func (rapb *RowAccessPolicyBuilder) Show() string
Show returns the SQL query that will show a row access policy.
func (*RowAccessPolicyBuilder) WithComment ¶ added in v0.34.0
func (rapb *RowAccessPolicyBuilder) WithComment(c string) *RowAccessPolicyBuilder
WithComment adds a comment to the RowAccessPolicyBuilder.
func (*RowAccessPolicyBuilder) WithRowAccessExpression ¶ added in v0.34.0
func (rapb *RowAccessPolicyBuilder) WithRowAccessExpression(rowAccessExpression string) *RowAccessPolicyBuilder
WithRowAccessExpression adds rowAccessExpression to the RowAccessPolicyBuilder.
func (*RowAccessPolicyBuilder) WithSignature ¶ added in v0.34.0
func (rapb *RowAccessPolicyBuilder) WithSignature(signature map[string]interface{}) *RowAccessPolicyBuilder
WithSignature adds signature to the RowAccessPolicyBuilder.
type RowAccessPolicyStruct ¶ added in v0.34.0
type RowAccessPolicyStruct struct { CreatedOn sql.NullString `db:"created_on"` Name sql.NullString `db:"name"` DatabaseName sql.NullString `db:"database_name"` SchemaName sql.NullString `db:"schema_name"` Kind sql.NullString `db:"kind"` Owner sql.NullString `db:"owner"` Comment sql.NullString `db:"comment"` }
func ListRowAccessPolicies ¶ added in v0.34.0
func ScanRowAccessPolicies ¶ added in v0.34.0
func ScanRowAccessPolicies(row *sqlx.Row) (*RowAccessPolicyStruct, 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 SchemaIdentifierFromQualifiedName ¶ added in v0.62.0
func SchemaIdentifierFromQualifiedName(name string) *SchemaIdentifier
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 Sequence ¶ added in v0.34.0
type Sequence struct { Name sql.NullString `db:"name"` DBName sql.NullString `db:"database_name"` SchemaName sql.NullString `db:"schema_name"` NextValue sql.NullString `db:"next_value"` Increment sql.NullString `db:"interval"` CreatedOn sql.NullString `db:"created_on"` Owner sql.NullString `db:"owner"` Comment sql.NullString `db:"comment"` }
func ListSequences ¶ added in v0.34.0
type SequenceBuilder ¶ added in v0.34.0
type SequenceBuilder struct {
// contains filtered or unexported fields
}
func NewSequenceBuilder ¶ added in v0.54.0
func NewSequenceBuilder(name, db, schema string) *SequenceBuilder
Sequence returns a pointer to a Builder for a sequence.
func (*SequenceBuilder) Address ¶ added in v0.34.0
func (sb *SequenceBuilder) Address() string
func (*SequenceBuilder) Create ¶ added in v0.34.0
func (sb *SequenceBuilder) Create() string
func (*SequenceBuilder) Drop ¶ added in v0.34.0
func (sb *SequenceBuilder) Drop() string
Drop returns the SQL query that will drop a sequence.
func (*SequenceBuilder) QualifiedName ¶ added in v0.34.0
func (sb *SequenceBuilder) QualifiedName() string
func (*SequenceBuilder) Show ¶ added in v0.34.0
func (sb *SequenceBuilder) Show() string
Show returns the SQL query that will show a sequence.
func (*SequenceBuilder) WithComment ¶ added in v0.34.0
func (sb *SequenceBuilder) WithComment(comment string) *SequenceBuilder
func (*SequenceBuilder) WithIncrement ¶ added in v0.34.0
func (sb *SequenceBuilder) WithIncrement(increment int) *SequenceBuilder
func (*SequenceBuilder) WithStart ¶ added in v0.34.0
func (sb *SequenceBuilder) WithStart(start int) *SequenceBuilder
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 Stage ¶ added in v0.34.0
type Stage struct { Name *string `db:"name"` DatabaseName *string `db:"database_name"` SchemaName *string `db:"schema_name"` Comment *string `db:"comment"` StorageIntegration *string `db:"storage_integration"` }
func ListStages ¶ added in v0.34.0
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) Describe ¶ added in v0.34.0
func (sb *StageBuilder) Describe() string
Describe returns the SQL query that will describe a stage.
func (*StageBuilder) Drop ¶ added in v0.34.0
func (sb *StageBuilder) Drop() string
Drop returns the SQL query that will drop a 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) Show ¶ added in v0.34.0
func (sb *StageBuilder) Show() string
Show returns the SQL query that will show a stage.
func (*StageBuilder) Undrop ¶ added in v0.34.0
func (sb *StageBuilder) Undrop() string
Undrop returns the SQL query that will undrop a 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 StorageIntegration ¶ added in v0.34.0
type StorageIntegration 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"` Comment sql.NullString `db:"comment"` }
func ListStorageIntegrations ¶ added in v0.34.0
func ListStorageIntegrations(db *sql.DB) ([]StorageIntegration, error)
func ScanStorageIntegration ¶ added in v0.34.0
func ScanStorageIntegration(row *sqlx.Row) (*StorageIntegration, error)
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 Table ¶ added in v0.34.0
type Table struct { CreatedOn sql.NullString `db:"created_on"` TableName sql.NullString `db:"name"` DatabaseName sql.NullString `db:"database_name"` SchemaName sql.NullString `db:"schema_name"` Kind sql.NullString `db:"kind"` Comment sql.NullString `db:"comment"` ClusterBy sql.NullString `db:"cluster_by"` Rows sql.NullString `db:"row"` Bytes sql.NullString `db:"bytes"` Owner sql.NullString `db:"owner"` RetentionTime sql.NullInt32 `db:"retention_time"` AutomaticClustering sql.NullString `db:"automatic_clustering"` ChangeTracking sql.NullString `db:"change_tracking"` IsExternal sql.NullString `db:"is_external"` }
func ListTables ¶ added in v0.34.0
type TableBuilder ¶ added in v0.34.0
type TableBuilder struct {
// contains filtered or unexported fields
}
TableBuilder abstracts the creation of SQL queries for a Snowflake schema.
func NewTableBuilder ¶ added in v0.54.0
func NewTableBuilder(name, db, schema string) *TableBuilder
Table returns a pointer to a Builder that abstracts the DDL operations for a table.
Supported DDL operations are:
- ALTER TABLE
- DROP TABLE
- SHOW TABLES
[Snowflake Reference](https://docs.snowflake.com/en/sql-reference/ddl-table.html)
func NewTableWithColumnDefinitionsBuilder ¶ added in v0.54.0
func NewTableWithColumnDefinitionsBuilder(name, db, schema string, columns Columns) *TableBuilder
Table returns a pointer to a Builder that abstracts the DDL operations for a table.
Supported DDL operations are:
- CREATE TABLE
[Snowflake Reference](https://docs.snowflake.com/en/sql-reference/ddl-table.html)
func (*TableBuilder) AddColumn ¶ added in v0.34.0
func (tb *TableBuilder) AddColumn(name string, dataType string, nullable bool, _default *ColumnDefault, identity *ColumnIdentity, comment string, maskingPolicy string) string
AddColumn returns the SQL query that will add a new column to the table.
func (*TableBuilder) AddTag ¶ added in v0.34.0
func (tb *TableBuilder) AddTag(tag TagValue) string
AddTag returns the SQL query that will add a new tag to the table.
func (*TableBuilder) ChangeChangeTracking ¶ added in v0.34.0
func (tb *TableBuilder) ChangeChangeTracking(changeTracking bool) string
ChangeChangeTracking returns the SQL query that will update the CHANGE_TRACKING on the table.
func (*TableBuilder) ChangeClusterBy ¶ added in v0.34.0
func (tb *TableBuilder) ChangeClusterBy(cb string) string
ChangeClusterBy returns the SQL query to change cluastering on table.
func (*TableBuilder) ChangeColumnComment ¶ added in v0.34.0
func (tb *TableBuilder) ChangeColumnComment(name string, comment string) string
func (*TableBuilder) ChangeColumnMaskingPolicy ¶ added in v0.49.0
func (tb *TableBuilder) ChangeColumnMaskingPolicy(name string, maskingPolicy string) string
func (*TableBuilder) ChangeColumnType ¶ added in v0.34.0
func (tb *TableBuilder) ChangeColumnType(name string, dataType string) string
ChangeColumnType returns the SQL query that will change the type of the named column to the given type.
func (*TableBuilder) ChangeComment ¶ added in v0.34.0
func (tb *TableBuilder) ChangeComment(c string) string
ChangeComment returns the SQL query that will update the comment on the table.
func (*TableBuilder) ChangeDataRetention ¶ added in v0.34.0
func (tb *TableBuilder) ChangeDataRetention(days int) string
ChangeDataRetention returns the SQL query that will update the DATA_RETENTION_TIME_IN_DAYS on the table.
func (*TableBuilder) ChangeNullConstraint ¶ added in v0.34.0
func (tb *TableBuilder) ChangeNullConstraint(name string, nullable bool) string
Return sql to set/unset null constraint on column.
func (*TableBuilder) ChangePrimaryKey ¶ added in v0.34.0
func (tb *TableBuilder) ChangePrimaryKey(newPk PrimaryKey) string
func (*TableBuilder) ChangeTag ¶ added in v0.34.0
func (tb *TableBuilder) ChangeTag(tag TagValue) string
ChangeTag returns the SQL query that will alter a tag on the table.
func (*TableBuilder) Create ¶ added in v0.34.0
func (tb *TableBuilder) Create() string
Create returns the SQL statement required to create a table.
func (*TableBuilder) Drop ¶ added in v0.34.0
func (tb *TableBuilder) Drop() string
Drop returns the SQL query that will drop a table.
func (*TableBuilder) DropClustering ¶ added in v0.34.0
func (tb *TableBuilder) DropClustering() string
RemoveClustering returns the SQL query that will remove data clustering from the table.
func (*TableBuilder) DropColumn ¶ added in v0.34.0
func (tb *TableBuilder) DropColumn(name string) string
DropColumn returns the SQL query that will add a new column to the table.
func (*TableBuilder) DropColumnDefault ¶ added in v0.34.0
func (tb *TableBuilder) DropColumnDefault(name string) string
func (*TableBuilder) DropPrimaryKey ¶ added in v0.34.0
func (tb *TableBuilder) DropPrimaryKey() string
func (*TableBuilder) GetClusterKeyString ¶ added in v0.34.0
func (tb *TableBuilder) GetClusterKeyString() string
Function to get clustering definition.
func (*TableBuilder) GetTagValueString ¶ added in v0.34.0
func (tb *TableBuilder) GetTagValueString() string
func (*TableBuilder) QualifiedName ¶ added in v0.34.0
func (tb *TableBuilder) QualifiedName() string
QualifiedName prepends the db and schema if set and escapes everything nicely.
func (*TableBuilder) RemoveComment ¶ added in v0.34.0
func (tb *TableBuilder) RemoveComment() string
RemoveComment returns the SQL query that will remove the comment on the table.
func (*TableBuilder) Rename ¶ added in v0.34.0
func (tb *TableBuilder) Rename(newName string) string
func (*TableBuilder) Show ¶ added in v0.34.0
func (tb *TableBuilder) Show() string
Show returns the SQL query that will show a table.
func (*TableBuilder) ShowColumns ¶ added in v0.34.0
func (tb *TableBuilder) ShowColumns() string
func (*TableBuilder) ShowPrimaryKeys ¶ added in v0.34.0
func (tb *TableBuilder) ShowPrimaryKeys() string
func (*TableBuilder) UnsetTag ¶ added in v0.34.0
func (tb *TableBuilder) UnsetTag(tag TagValue) string
UnsetTag returns the SQL query that will unset a tag on the table.
func (*TableBuilder) WithChangeTracking ¶ added in v0.34.0
func (tb *TableBuilder) WithChangeTracking(changeTracking bool) *TableBuilder
WithChangeTracking sets the change tracking on the TableBuilder.
func (*TableBuilder) WithClustering ¶ added in v0.34.0
func (tb *TableBuilder) WithClustering(c []string) *TableBuilder
WithClustering adds cluster keys/expressions to TableBuilder.
func (*TableBuilder) WithColumns ¶ added in v0.34.0
func (tb *TableBuilder) WithColumns(c Columns) *TableBuilder
WithColumns sets the column definitions on the TableBuilder.
func (*TableBuilder) WithComment ¶ added in v0.34.0
func (tb *TableBuilder) WithComment(c string) *TableBuilder
WithComment adds a comment to the TableBuilder.
func (*TableBuilder) WithDataRetentionTimeInDays ¶ added in v0.34.0
func (tb *TableBuilder) WithDataRetentionTimeInDays(days int) *TableBuilder
WithDataRetentionTimeInDays sets the data retention time on the TableBuilder.
func (*TableBuilder) WithPrimaryKey ¶ added in v0.34.0
func (tb *TableBuilder) WithPrimaryKey(pk PrimaryKey) *TableBuilder
WithPrimaryKey sets the primary key on the TableBuilder.
func (*TableBuilder) WithTags ¶ added in v0.34.0
func (tb *TableBuilder) WithTags(tags []TagValue) *TableBuilder
WithTags sets the tags on the TableBuilder.
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 TableConstraint ¶ added in v0.47.0
type TableConstraint struct { ConstraintCatalog sql.NullString `db:"CONSTRAINT_CATALOG"` ConstraintSchema sql.NullString `db:"CONSTRAINT_SCHEMA"` ConstraintName sql.NullString `db:"CONSTRAINT_NAME"` TableCatalog sql.NullString `db:"TABLE_CATALOG"` TableSchema sql.NullString `db:"TABLE_SCHEMA"` TableName sql.NullString `db:"TABLE_NAME"` ConstraintType sql.NullString `db:"CONSTRAINT_TYPE"` IsDeferrable sql.NullString `db:"IS_DEFERRABLE"` InitiallyDeferred sql.NullString `db:"INITIALLY_DEFERRED"` Enforced sql.NullString `db:"ENFORCED"` Comment sql.NullString `db:"COMMENT"` }
func ShowTableConstraint ¶ added in v0.47.0
func ShowTableConstraint(name, tableDB, tableSchema, tableName string, db *sql.DB) (*TableConstraint, error)
Show returns the SQL query that will show a table constraint by ID.
type TableConstraintBuilder ¶ added in v0.47.0
type TableConstraintBuilder struct {
// contains filtered or unexported fields
}
TableConstraintBuilder abstracts the creation of SQL queries for a Snowflake table constraint.
func NewTableConstraintBuilder ¶ added in v0.54.0
func NewTableConstraintBuilder(name string, constraintType string, tableID string) *TableConstraintBuilder
func (*TableConstraintBuilder) Create ¶ added in v0.47.0
func (b *TableConstraintBuilder) Create() string
Create returns the SQL query that will create a new table constraint.
func (*TableConstraintBuilder) Drop ¶ added in v0.47.0
func (b *TableConstraintBuilder) Drop() string
Drop returns the SQL query that will drop a table constraint.
func (*TableConstraintBuilder) Rename ¶ added in v0.47.0
func (b *TableConstraintBuilder) Rename(newName string) string
Rename returns the SQL query that will rename the table constraint.
func (*TableConstraintBuilder) SetComment ¶ added in v0.47.0
func (b *TableConstraintBuilder) SetComment(c string) string
SetComment returns the SQL query that will update the comment on the table constraint.
func (*TableConstraintBuilder) WithColumns ¶ added in v0.47.0
func (b *TableConstraintBuilder) WithColumns(columns []string) *TableConstraintBuilder
WithColumns sets columns.
func (*TableConstraintBuilder) WithComment ¶ added in v0.47.0
func (b *TableConstraintBuilder) WithComment(comment string) *TableConstraintBuilder
WithComment sets comment.
func (*TableConstraintBuilder) WithDeferrable ¶ added in v0.47.0
func (b *TableConstraintBuilder) WithDeferrable(deferrable bool) *TableConstraintBuilder
WithDeferrable sets deferrable.
func (*TableConstraintBuilder) WithDelete ¶ added in v0.47.0
func (b *TableConstraintBuilder) WithDelete(onDelete string) *TableConstraintBuilder
WithDelete sets delete.
func (*TableConstraintBuilder) WithEnable ¶ added in v0.47.0
func (b *TableConstraintBuilder) WithEnable(enable bool) *TableConstraintBuilder
WithEnable sets enable.
func (*TableConstraintBuilder) WithEnforced ¶ added in v0.47.0
func (b *TableConstraintBuilder) WithEnforced(enforced bool) *TableConstraintBuilder
WithEnforced sets enforced.
func (*TableConstraintBuilder) WithInitially ¶ added in v0.47.0
func (b *TableConstraintBuilder) WithInitially(initially string) *TableConstraintBuilder
WithInitially sets initially.
func (*TableConstraintBuilder) WithMatch ¶ added in v0.47.0
func (b *TableConstraintBuilder) WithMatch(match string) *TableConstraintBuilder
WithMatch sets match.
func (*TableConstraintBuilder) WithReferenceColumns ¶ added in v0.47.0
func (b *TableConstraintBuilder) WithReferenceColumns(referenceColumns []string) *TableConstraintBuilder
WithReferenceColumns sets referenceColumns.
func (*TableConstraintBuilder) WithReferenceTableID ¶ added in v0.47.0
func (b *TableConstraintBuilder) WithReferenceTableID(referenceTableID string) *TableConstraintBuilder
WithReferenceTableID sets referenceTableID.
func (*TableConstraintBuilder) WithRely ¶ added in v0.47.0
func (b *TableConstraintBuilder) WithRely(rely bool) *TableConstraintBuilder
WithRely sets rely.
func (*TableConstraintBuilder) WithUpdate ¶ added in v0.47.0
func (b *TableConstraintBuilder) WithUpdate(onUpdate string) *TableConstraintBuilder
WithUpdate sets update.
func (*TableConstraintBuilder) WithValidate ¶ added in v0.47.0
func (b *TableConstraintBuilder) WithValidate(validate bool) *TableConstraintBuilder
WithValidated sets validated.
type TableDescription ¶ added in v0.54.0
type TableDescription struct { Name sql.NullString `db:"name"` Type sql.NullString `db:"type"` Kind sql.NullString `db:"kind"` Nullable sql.NullString `db:"null?"` Default sql.NullString `db:"default"` Comment sql.NullString `db:"comment"` MaskingPolicy sql.NullString `db:"policy name"` }
func ScanTableDescription ¶ added in v0.34.0
func ScanTableDescription(rows *sqlx.Rows) ([]TableDescription, error)
func (*TableDescription) ColumnDefault ¶ added in v0.54.0
func (td *TableDescription) ColumnDefault() *ColumnDefault
func (*TableDescription) ColumnIdentity ¶ added in v0.54.0
func (td *TableDescription) ColumnIdentity() *ColumnIdentity
func (*TableDescription) IsNullable ¶ added in v0.54.0
func (td *TableDescription) IsNullable() bool
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 TagAssociation ¶ added in v0.42.0
type TagAssociation struct {
TagValue sql.NullString `db:"TAG_VALUE"`
}
func ListTagAssociations ¶ added in v0.42.0
func ListTagAssociations(tb *TagAssociationBuilder, db *sql.DB) ([]TagAssociation, error)
func ScanTagAssociation ¶ added in v0.48.0
func ScanTagAssociation(row *sqlx.Row) (*TagAssociation, error)
type TagAssociationBuilder ¶ added in v0.42.0
type TagAssociationBuilder struct {
// contains filtered or unexported fields
}
TagAssociationBuilder abstracts the creation of SQL queries for a Snowflake tag.
func NewTagAssociationBuilder ¶ added in v0.54.0
func NewTagAssociationBuilder(tagID string) *TagAssociationBuilder
TagAssociation returns a pointer to a Builder that abstracts the DDL operations for a tag sssociation.
Supported DDL operations are:
- ALTER <object_type> SET TAG
- ALTER <object_type> UNSET TAG
- SYSTEM$GET_TAG (get current tag value)
[Snowflake Reference](https://docs.snowflake.com/en/user-guide/object-tagging.html)
func (*TagAssociationBuilder) Create ¶ added in v0.42.0
func (tb *TagAssociationBuilder) Create() string
Create returns the SQL query that will set the tag on an object.
func (*TagAssociationBuilder) Drop ¶ added in v0.42.0
func (tb *TagAssociationBuilder) Drop() string
Drop returns the SQL query that will remove a tag from an object.
func (*TagAssociationBuilder) GetTableAndColumnName ¶ added in v0.56.2
func (tb *TagAssociationBuilder) GetTableAndColumnName() (string, string)
func (*TagAssociationBuilder) GetTagDatabase ¶ added in v0.42.0
func (tb *TagAssociationBuilder) GetTagDatabase() string
GetTagDatabase returns the value of the tag database of TagAssociationBuilder.
func (*TagAssociationBuilder) GetTagName ¶ added in v0.42.0
func (tb *TagAssociationBuilder) GetTagName() string
GetTagName returns the value of the tag name of TagAssociationBuilder.
func (*TagAssociationBuilder) GetTagSchema ¶ added in v0.42.0
func (tb *TagAssociationBuilder) GetTagSchema() string
GetTagSchema returns the value of the tag schema of TagAssociationBuilder.
func (*TagAssociationBuilder) Show ¶ added in v0.48.0
func (tb *TagAssociationBuilder) Show() string
Show returns the SQL query that will show the current tag value on an object.
func (*TagAssociationBuilder) WithObjectIdentifier ¶ added in v0.48.0
func (tb *TagAssociationBuilder) WithObjectIdentifier(objectIdentifier string) *TagAssociationBuilder
WithObjectIdentifier adds the name of the schema to the TagAssociationBuilder.
func (*TagAssociationBuilder) WithObjectType ¶ added in v0.42.0
func (tb *TagAssociationBuilder) WithObjectType(objectType string) *TagAssociationBuilder
WithObjectType adds the object type of the resource to add tag attachement to the TagAssociationBuilder.
func (*TagAssociationBuilder) WithTagValue ¶ added in v0.42.0
func (tb *TagAssociationBuilder) WithTagValue(tagValue string) *TagAssociationBuilder
WithTagValue adds the name of the tag value to the TagAssociationBuilder.
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(name string) *TagBuilder
Tag returns a pointer to a Builder that abstracts the DDL operations for a tag.
Supported DDL operations are:
- CREATE TAG
- ALTER TAG
- DROP TAG
- UNDROP TAG
- SHOW TAGS
[Snowflake Reference](https://docs.snowflake.com/en/user-guide/object-tagging.html)
func (*TagBuilder) AddAllowedValues ¶ added in v0.35.0
func (tb *TagBuilder) AddAllowedValues(avs []string) string
AddAllowedValues returns the SQL query that will add the allowed_values.
func (*TagBuilder) AddMaskingPolicy ¶ added in v0.43.0
func (tb *TagBuilder) AddMaskingPolicy() string
AddMaskingPolicy returns the SQL query that will add a masking policy to a tag.
func (*TagBuilder) ChangeComment ¶ added in v0.34.0
func (tb *TagBuilder) ChangeComment(c string) string
ChangeComment returns the SQL query that will update the comment on the tag.
func (*TagBuilder) Create ¶ added in v0.34.0
func (tb *TagBuilder) Create() string
Create returns the SQL query that will create a new tag.
func (*TagBuilder) Drop ¶ added in v0.34.0
func (tb *TagBuilder) Drop() string
Drop returns the SQL query that will drop a tag.
func (*TagBuilder) DropAllowedValues ¶ added in v0.35.0
func (tb *TagBuilder) DropAllowedValues(davs []string) string
DropAllowedValues returns the SQL query that will drop the unwanted allowed_values.
func (*TagBuilder) QualifiedName ¶ added in v0.34.0
func (tb *TagBuilder) QualifiedName() string
QualifiedName prepends the db and schema if set and escapes everything nicely.
func (*TagBuilder) RemoveAllowedValues ¶ added in v0.35.0
func (tb *TagBuilder) RemoveAllowedValues() string
RemoveAllowedValues returns the SQL query that will remove the allowed_values from the tag.
func (*TagBuilder) RemoveComment ¶ added in v0.34.0
func (tb *TagBuilder) RemoveComment() string
RemoveComment returns the SQL query that will remove the comment on the tag.
func (*TagBuilder) RemoveMaskingPolicy ¶ added in v0.43.0
func (tb *TagBuilder) RemoveMaskingPolicy() string
ReamoveMaskingPolicy returns the SQL query that will remove a masking policy from a tag.
func (*TagBuilder) Rename ¶ added in v0.34.0
func (tb *TagBuilder) Rename(newName string) string
Rename returns the SQL query that will rename the tag.
func (*TagBuilder) Show ¶ added in v0.34.0
func (tb *TagBuilder) Show() string
Show returns the SQL query that will show a tag.
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) Undrop ¶ added in v0.34.0
func (tb *TagBuilder) Undrop() string
Undrop returns the SQL query that will undrop a tag.
func (*TagBuilder) WithAllowedValues ¶ added in v0.35.0
func (tb *TagBuilder) WithAllowedValues(av []string) *TagBuilder
WithAllowedValues adds the allowed values to the query.
func (*TagBuilder) WithComment ¶ added in v0.34.0
func (tb *TagBuilder) WithComment(c string) *TagBuilder
WithComment adds a comment to the TagBuilder.
func (*TagBuilder) WithDB ¶ added in v0.34.0
func (tb *TagBuilder) WithDB(db string) *TagBuilder
WithDB adds the name of the database to the TagBuilder.
func (*TagBuilder) WithMaskingPolicy ¶ added in v0.43.0
func (tb *TagBuilder) WithMaskingPolicy(mpb *MaskingPolicyBuilder) *TagBuilder
WithMaskingPolicy adds a pointer to a MaskingPolicyBuilder to the TagBuilder.
func (*TagBuilder) WithSchema ¶ added in v0.34.0
func (tb *TagBuilder) WithSchema(schema string) *TagBuilder
WithSchema adds the name of the schema to the 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 User ¶ added in v0.3.0
type User struct { Comment sql.NullString `db:"comment"` DefaultNamespace sql.NullString `db:"default_namespace"` DefaultRole sql.NullString `db:"default_role"` DefaultSecondaryRoles sql.NullString `db:"default_secondary_roles"` DefaultWarehouse sql.NullString `db:"default_warehouse"` Disabled bool `db:"disabled"` DisplayName sql.NullString `db:"display_name"` Email sql.NullString `db:"email"` FirstName sql.NullString `db:"first_name"` HasRsaPublicKey bool `db:"has_rsa_public_key"` LastName sql.NullString `db:"last_name"` LoginName sql.NullString `db:"login_name"` Name sql.NullString `db:"name"` }
type UserFunctions ¶ added in v0.54.0
type UserFunctions struct { Name sql.NullString `db:"name"` Arguments sql.NullString `db:"arguments"` Description sql.NullString `db:"description"` Language sql.NullString `db:"language"` }
func ListUserFunctions ¶ added in v0.54.0
type UserOwnershipGrant ¶ added in v0.34.0
type UserOwnershipGrant struct { Name sql.NullString `db:"name"` CreatedOn sql.NullString `db:"created_on"` LoginName sql.NullString `db:"login_name"` DisplayName sql.NullString `db:"display_name"` FirstName sql.NullString `db:"first_name"` LastName sql.NullString `db:"last_name"` Email sql.NullString `db:"email"` MinsToUnlock sql.NullString `db:"mins_to_unlock"` DaysToExpiry sql.NullString `db:"days_to_expiry"` Comment sql.NullString `db:"comment"` Disabled sql.NullString `db:"disabled"` MustChangePassword sql.NullString `db:"must_change_password"` SnowflakeLock sql.NullString `db:"snowflake_lock"` DefaultWarehouse sql.NullString `db:"default_warehouse"` DefaultNamespace sql.NullString `db:"default_namespace"` DefaultRole sql.NullString `db:"default_role"` DefaultSecondaryRoles sql.NullString `db:"default_secondary_roles"` ExtAuthnDuo sql.NullString `db:"ext_authn_duo"` ExtAuthnUID sql.NullString `db:"ext_authn_uid"` MinsToBypassMFA sql.NullString `db:"mins_to_bypass_mfa"` Owner sql.NullString `db:"owner"` LastSuccessLogin sql.NullString `db:"last_success_login"` ExpiresAtTime sql.NullString `db:"expires_at_time"` LockedUntilTime sql.NullString `db:"locked_until_time"` HasPassword sql.NullString `db:"has_password"` HasRsaPublicKey sql.NullString `db:"has_rsa_public_key"` }
func ScanUserOwnershipGrant ¶ added in v0.34.0
func ScanUserOwnershipGrant(row *sqlx.Row) (*UserOwnershipGrant, error)
type UserOwnershipGrantBuilder ¶ added in v0.34.0
type UserOwnershipGrantBuilder struct {
// contains filtered or unexported fields
}
func NewUserOwnershipGrantBuilder ¶ added in v0.54.0
func NewUserOwnershipGrantBuilder(user string, currentGrants string) *UserOwnershipGrantBuilder
func (*UserOwnershipGrantBuilder) Role ¶ added in v0.34.0
func (gb *UserOwnershipGrantBuilder) Role(role string) *UserOwnershipGrantExecutable
type UserOwnershipGrantExecutable ¶ added in v0.34.0
type UserOwnershipGrantExecutable struct {
// contains filtered or unexported fields
}
func (*UserOwnershipGrantExecutable) Grant ¶ added in v0.34.0
func (gr *UserOwnershipGrantExecutable) Grant() string
func (*UserOwnershipGrantExecutable) Revoke ¶ added in v0.34.0
func (gr *UserOwnershipGrantExecutable) Revoke() string
type View ¶ added in v0.34.0
type View struct { Comment sql.NullString `db:"comment"` IsSecure bool `db:"is_secure"` Name sql.NullString `db:"name"` SchemaName sql.NullString `db:"schema_name"` Text sql.NullString `db:"text"` DatabaseName sql.NullString `db:"database_name"` CreatedOn time.Time `db:"created_on"` }
func (*View) HasCopyGrants ¶ added in v0.61.0
type ViewBuilder ¶ added in v0.34.0
type ViewBuilder struct {
// contains filtered or unexported fields
}
ViewBuilder abstracts the creation of SQL queries for a Snowflake View.
func NewViewBuilder ¶ added in v0.54.0
func NewViewBuilder(name string) *ViewBuilder
View returns a pointer to a Builder that abstracts the DDL operations for a view.
Supported DDL operations are:
- CREATE VIEW
- ALTER VIEW
- DROP VIEW
- SHOW VIEWS
- DESCRIBE VIEW
[Snowflake Reference](https://docs.snowflake.net/manuals/sql-reference/ddl-table.html#standard-view-management)
func (*ViewBuilder) AddTag ¶ added in v0.34.0
func (vb *ViewBuilder) AddTag(tag TagValue) string
AddTag returns the SQL query that will add a new tag to the view.
func (*ViewBuilder) ChangeComment ¶ added in v0.34.0
func (vb *ViewBuilder) ChangeComment(c string) (string, error)
ChangeComment returns the SQL query that will update the comment on the view. Note that comment is the only parameter, if more are released this should be abstracted as per the generic builder.
func (*ViewBuilder) ChangeTag ¶ added in v0.34.0
func (vb *ViewBuilder) ChangeTag(tag TagValue) string
ChangeTag returns the SQL query that will alter a tag on the view.
func (*ViewBuilder) Create ¶ added in v0.34.0
func (vb *ViewBuilder) Create() (string, error)
Create returns the SQL query that will create a new view.
func (*ViewBuilder) Drop ¶ added in v0.34.0
func (vb *ViewBuilder) Drop() (string, error)
Drop returns the SQL query that will drop the row representing this view.
func (*ViewBuilder) QualifiedName ¶ added in v0.34.0
func (vb *ViewBuilder) QualifiedName() (string, error)
QualifiedName prepends the db and schema if set and escapes everything nicely.
func (*ViewBuilder) RemoveComment ¶ added in v0.34.0
func (vb *ViewBuilder) RemoveComment() (string, error)
RemoveComment returns the SQL query that will remove the comment on the view. Note that comment is the only parameter, if more are released this should be abstracted as per the generic builder.
func (*ViewBuilder) Rename ¶ added in v0.34.0
func (vb *ViewBuilder) Rename(newName string) (string, error)
Rename returns the SQL query that will rename the view.
func (*ViewBuilder) Secure ¶ added in v0.34.0
func (vb *ViewBuilder) Secure() (string, error)
Secure returns the SQL query that will change the view to a secure view.
func (*ViewBuilder) Show ¶ added in v0.34.0
func (vb *ViewBuilder) Show() string
Show returns the SQL query that will show the row representing this view.
func (*ViewBuilder) Unsecure ¶ added in v0.34.0
func (vb *ViewBuilder) Unsecure() (string, error)
Unsecure returns the SQL query that will change the view to a normal (unsecured) view.
func (*ViewBuilder) UnsetTag ¶ added in v0.34.0
func (vb *ViewBuilder) UnsetTag(tag TagValue) string
UnsetTag returns the SQL query that will unset a tag on the view.
func (*ViewBuilder) WithComment ¶ added in v0.34.0
func (vb *ViewBuilder) WithComment(c string) *ViewBuilder
WithComment adds a comment to the ViewBuilder.
func (*ViewBuilder) WithCopyGrants ¶ added in v0.61.0
func (vb *ViewBuilder) WithCopyGrants() *ViewBuilder
WithCopyGrants adds the "COPY GRANTS" option to the ViewBuilder.
func (*ViewBuilder) WithDB ¶ added in v0.34.0
func (vb *ViewBuilder) WithDB(db string) *ViewBuilder
WithDB adds the name of the database to the ViewBuilder.
func (*ViewBuilder) WithReplace ¶ added in v0.34.0
func (vb *ViewBuilder) WithReplace() *ViewBuilder
WithReplace adds the "OR REPLACE" option to the ViewBuilder.
func (*ViewBuilder) WithSchema ¶ added in v0.34.0
func (vb *ViewBuilder) WithSchema(s string) *ViewBuilder
WithSchema adds the name of the schema to the ViewBuilder.
func (*ViewBuilder) WithSecure ¶ added in v0.34.0
func (vb *ViewBuilder) WithSecure() *ViewBuilder
WithSecure sets the secure boolean to true [Snowflake Reference](https://docs.snowflake.net/manuals/user-guide/views-secure.html)
func (*ViewBuilder) WithStatement ¶ added in v0.34.0
func (vb *ViewBuilder) WithStatement(s string) *ViewBuilder
WithStatement adds the SQL statement to be used for the view.
func (*ViewBuilder) WithTags ¶ added in v0.34.0
func (vb *ViewBuilder) WithTags(tags []TagValue) *ViewBuilder
WithTags sets the tags on the ViewBuilder.
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) ExtractMaterializedView ¶ added in v0.34.0
func (e *ViewSelectStatementExtractor) ExtractMaterializedView() (string, error)
Source Files ¶
- all_grant.go
- api_integration.go
- builder.go
- current_account.go
- current_role.go
- email_notification_integration.go
- errors.go
- escaping.go
- exec.go
- external_function.go
- external_oauth_integration.go
- function.go
- future_grant.go
- generic.go
- grant.go
- identifier.go
- managed_account.go
- manager.go
- masking_policy.go
- masking_policy_application.go
- materialized_view.go
- network_policy.go
- notification_integration.go
- oauth_integration.go
- parser.go
- procedure.go
- replication.go
- resource_monitor.go
- role.go
- role_grant.go
- role_ownership_grant.go
- row_access_policy.go
- saml_integration.go
- scim_integration.go
- sequence.go
- sorting.go
- stage.go
- storage_integration.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
- table_constraint.go
- tag.go
- tag_association.go
- user.go
- user_ownership_grant.go
- view.go