helpers

package
v0.90.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountClient

type AccountClient struct {
	// contains filtered or unexported fields
}

func NewAccountClient

func NewAccountClient(context *TestClientContext) *AccountClient

func (*AccountClient) GetAccountIdentifier

func (c *AccountClient) GetAccountIdentifier(t *testing.T) sdk.AccountIdentifier

GetAccountIdentifier gets the account identifier from Snowflake API, by fetching the account locator and by filtering the list of accounts in replication accounts by it (because there is no direct way to get).

type AlertClient

type AlertClient struct {
	// contains filtered or unexported fields
}

func NewAlertClient

func NewAlertClient(context *TestClientContext, idsGenerator *IdsGenerator) *AlertClient

func (*AlertClient) CreateAlert

func (c *AlertClient) CreateAlert(t *testing.T) (*sdk.Alert, func())

func (*AlertClient) CreateAlertWithOptions

func (c *AlertClient) CreateAlertWithOptions(t *testing.T, schedule string, condition string, action string, opts *sdk.CreateAlertOptions) (*sdk.Alert, func())

func (*AlertClient) DropAlertFunc

func (c *AlertClient) DropAlertFunc(t *testing.T, id sdk.SchemaObjectIdentifier) func()

type ApiIntegrationClient

type ApiIntegrationClient struct {
	// contains filtered or unexported fields
}

func NewApiIntegrationClient

func NewApiIntegrationClient(context *TestClientContext, idsGenerator *IdsGenerator) *ApiIntegrationClient

func (*ApiIntegrationClient) CreateApiIntegration

func (c *ApiIntegrationClient) CreateApiIntegration(t *testing.T) (*sdk.ApiIntegration, func())

func (*ApiIntegrationClient) DropApiIntegrationFunc

func (c *ApiIntegrationClient) DropApiIntegrationFunc(t *testing.T, id sdk.AccountObjectIdentifier) func()

type ApplicationClient

type ApplicationClient struct {
	// contains filtered or unexported fields
}

func NewApplicationClient

func NewApplicationClient(context *TestClientContext, idsGenerator *IdsGenerator) *ApplicationClient

func (*ApplicationClient) CreateApplication

func (c *ApplicationClient) CreateApplication(t *testing.T, packageId sdk.AccountObjectIdentifier, version string) (*sdk.Application, func())

func (*ApplicationClient) DropApplicationFunc

func (c *ApplicationClient) DropApplicationFunc(t *testing.T, id sdk.AccountObjectIdentifier) func()

type ApplicationPackageClient

type ApplicationPackageClient struct {
	// contains filtered or unexported fields
}

func NewApplicationPackageClient

func NewApplicationPackageClient(context *TestClientContext, idsGenerator *IdsGenerator) *ApplicationPackageClient

func (*ApplicationPackageClient) AddApplicationPackageVersion

func (c *ApplicationPackageClient) AddApplicationPackageVersion(t *testing.T, id sdk.AccountObjectIdentifier, stageId sdk.SchemaObjectIdentifier, versionName string)

func (*ApplicationPackageClient) CreateApplicationPackage

func (c *ApplicationPackageClient) CreateApplicationPackage(t *testing.T) (*sdk.ApplicationPackage, func())

func (*ApplicationPackageClient) DropApplicationPackageFunc

func (c *ApplicationPackageClient) DropApplicationPackageFunc(t *testing.T, id sdk.AccountObjectIdentifier) func()

func (*ApplicationPackageClient) ShowVersions

type ApplicationPackageVersion

type ApplicationPackageVersion struct {
	Version string `json:"version"`
	Patch   int    `json:"patch"`
}

type ContextClient

type ContextClient struct {
	// contains filtered or unexported fields
}

func NewContextClient

func NewContextClient(context *TestClientContext) *ContextClient

func (*ContextClient) CurrentAccount

func (c *ContextClient) CurrentAccount(t *testing.T) string

func (*ContextClient) CurrentRegion

func (c *ContextClient) CurrentRegion(t *testing.T) string

func (*ContextClient) CurrentRole

func (c *ContextClient) CurrentRole(t *testing.T) string

func (*ContextClient) CurrentUser

func (c *ContextClient) CurrentUser(t *testing.T) string

func (*ContextClient) IsRoleInSession

func (c *ContextClient) IsRoleInSession(t *testing.T, id sdk.AccountObjectIdentifier) bool

type DatabaseClient

type DatabaseClient struct {
	// contains filtered or unexported fields
}

func NewDatabaseClient

func NewDatabaseClient(context *TestClientContext, idsGenerator *IdsGenerator) *DatabaseClient

func (*DatabaseClient) CreateDatabase

func (c *DatabaseClient) CreateDatabase(t *testing.T) (*sdk.Database, func())

func (*DatabaseClient) CreateDatabaseWithName

func (c *DatabaseClient) CreateDatabaseWithName(t *testing.T, name string) (*sdk.Database, func())

TODO [SNOW-955520]: we have to control the name

func (*DatabaseClient) CreateDatabaseWithOptions

func (c *DatabaseClient) CreateDatabaseWithOptions(t *testing.T, id sdk.AccountObjectIdentifier, opts *sdk.CreateDatabaseOptions) (*sdk.Database, func())

func (*DatabaseClient) CreateSecondaryDatabaseWithOptions

func (c *DatabaseClient) CreateSecondaryDatabaseWithOptions(t *testing.T, id sdk.AccountObjectIdentifier, externalId sdk.ExternalObjectIdentifier, opts *sdk.CreateSecondaryDatabaseOptions) (*sdk.Database, func())

func (*DatabaseClient) DropDatabaseFunc

func (c *DatabaseClient) DropDatabaseFunc(t *testing.T, id sdk.AccountObjectIdentifier) func()

func (*DatabaseClient) Show

func (*DatabaseClient) UpdateDataRetentionTime

func (c *DatabaseClient) UpdateDataRetentionTime(t *testing.T, id sdk.AccountObjectIdentifier, days int) func()

type DatabaseRoleClient

type DatabaseRoleClient struct {
	// contains filtered or unexported fields
}

func NewDatabaseRoleClient

func NewDatabaseRoleClient(context *TestClientContext, idsGenerator *IdsGenerator) *DatabaseRoleClient

func (*DatabaseRoleClient) CleanupDatabaseRoleFunc

func (c *DatabaseRoleClient) CleanupDatabaseRoleFunc(t *testing.T, id sdk.DatabaseObjectIdentifier) func()

func (*DatabaseRoleClient) CreateDatabaseRole

func (c *DatabaseRoleClient) CreateDatabaseRole(t *testing.T) (*sdk.DatabaseRole, func())

func (*DatabaseRoleClient) CreateDatabaseRoleInDatabase

func (c *DatabaseRoleClient) CreateDatabaseRoleInDatabase(t *testing.T, databaseId sdk.AccountObjectIdentifier) (*sdk.DatabaseRole, func())

func (*DatabaseRoleClient) CreateDatabaseRoleInDatabaseWithName

func (c *DatabaseRoleClient) CreateDatabaseRoleInDatabaseWithName(t *testing.T, databaseId sdk.AccountObjectIdentifier, name string) (*sdk.DatabaseRole, func())

func (*DatabaseRoleClient) CreateDatabaseRoleWithName

func (c *DatabaseRoleClient) CreateDatabaseRoleWithName(t *testing.T, name string) (*sdk.DatabaseRole, func())

type DynamicTableClient

type DynamicTableClient struct {
	// contains filtered or unexported fields
}

func NewDynamicTableClient

func NewDynamicTableClient(context *TestClientContext, idsGenerator *IdsGenerator) *DynamicTableClient

func (*DynamicTableClient) CreateDynamicTable

func (c *DynamicTableClient) CreateDynamicTable(t *testing.T, tableId sdk.SchemaObjectIdentifier) (*sdk.DynamicTable, func())

func (*DynamicTableClient) CreateDynamicTableWithOptions

func (c *DynamicTableClient) CreateDynamicTableWithOptions(t *testing.T, schemaId sdk.DatabaseObjectIdentifier, name string, warehouseId sdk.AccountObjectIdentifier, tableId sdk.SchemaObjectIdentifier) (*sdk.DynamicTable, func())

func (*DynamicTableClient) DropDynamicTableFunc

func (c *DynamicTableClient) DropDynamicTableFunc(t *testing.T, id sdk.SchemaObjectIdentifier) func()

type FailoverGroupClient

type FailoverGroupClient struct {
	// contains filtered or unexported fields
}

func NewFailoverGroupClient

func NewFailoverGroupClient(context *TestClientContext, idsGenerator *IdsGenerator) *FailoverGroupClient

func (*FailoverGroupClient) CreateFailoverGroup

func (c *FailoverGroupClient) CreateFailoverGroup(t *testing.T) (*sdk.FailoverGroup, func())

func (*FailoverGroupClient) CreateFailoverGroupWithOptions

func (c *FailoverGroupClient) CreateFailoverGroupWithOptions(t *testing.T, objectTypes []sdk.PluralObjectType, allowedAccounts []sdk.AccountIdentifier, opts *sdk.CreateFailoverGroupOptions) (*sdk.FailoverGroup, func())

func (*FailoverGroupClient) DropFailoverGroupFunc

func (c *FailoverGroupClient) DropFailoverGroupFunc(t *testing.T, id sdk.AccountObjectIdentifier) func()

type FileFormatClient

type FileFormatClient struct {
	// contains filtered or unexported fields
}

func NewFileFormatClient

func NewFileFormatClient(context *TestClientContext, idsGenerator *IdsGenerator) *FileFormatClient

func (*FileFormatClient) CreateFileFormat

func (c *FileFormatClient) CreateFileFormat(t *testing.T) (*sdk.FileFormat, func())

func (*FileFormatClient) CreateFileFormatWithOptions

func (c *FileFormatClient) CreateFileFormatWithOptions(t *testing.T, opts *sdk.CreateFileFormatOptions) (*sdk.FileFormat, func())

func (*FileFormatClient) DropFileFormatFunc

func (c *FileFormatClient) DropFileFormatFunc(t *testing.T, id sdk.SchemaObjectIdentifier) func()

type IdsGenerator

type IdsGenerator struct {
	// contains filtered or unexported fields
}

func NewIdsGenerator

func NewIdsGenerator(context *TestClientContext) *IdsGenerator

func (*IdsGenerator) AccountIdentifierWithLocator

func (c *IdsGenerator) AccountIdentifierWithLocator() sdk.AccountIdentifier

func (*IdsGenerator) Alpha

func (c *IdsGenerator) Alpha() string

func (*IdsGenerator) AlphaContaining

func (c *IdsGenerator) AlphaContaining(part string) string

func (*IdsGenerator) AlphaN

func (c *IdsGenerator) AlphaN(n int) string

func (*IdsGenerator) AlphaWithPrefix

func (c *IdsGenerator) AlphaWithPrefix(prefix string) string

func (*IdsGenerator) DatabaseId

func (c *IdsGenerator) DatabaseId() sdk.AccountObjectIdentifier

func (*IdsGenerator) RandomAccountObjectIdentifier

func (c *IdsGenerator) RandomAccountObjectIdentifier() sdk.AccountObjectIdentifier

func (*IdsGenerator) RandomAccountObjectIdentifierContaining

func (c *IdsGenerator) RandomAccountObjectIdentifierContaining(part string) sdk.AccountObjectIdentifier

func (*IdsGenerator) RandomAccountObjectIdentifierWithPrefix

func (c *IdsGenerator) RandomAccountObjectIdentifierWithPrefix(prefix string) sdk.AccountObjectIdentifier

func (*IdsGenerator) RandomSchemaObjectIdentifier

func (c *IdsGenerator) RandomSchemaObjectIdentifier() sdk.SchemaObjectIdentifier

func (*IdsGenerator) SchemaId

func (*IdsGenerator) WarehouseId

func (c *IdsGenerator) WarehouseId() sdk.AccountObjectIdentifier

type InformationSchemaColumns

type InformationSchemaColumns struct {
	TableCatalog           string         `db:"TABLE_CATALOG"`
	TableSchema            string         `db:"TABLE_SCHEMA"`
	TableName              string         `db:"TABLE_NAME"`
	ColumnName             string         `db:"COLUMN_NAME"`
	OrdinalPosition        string         `db:"ORDINAL_POSITION"`
	ColumnDefault          sql.NullString `db:"COLUMN_DEFAULT"`
	IsNullable             string         `db:"IS_NULLABLE"`
	DataType               string         `db:"DATA_TYPE"`
	CharacterMaximumLength sql.NullString `db:"CHARACTER_MAXIMUM_LENGTH"`
	CharacterOctetLength   sql.NullString `db:"CHARACTER_OCTET_LENGTH"`
	NumericPrecision       sql.NullString `db:"NUMERIC_PRECISION"`
	NumericPrecisionRadix  sql.NullString `db:"NUMERIC_PRECISION_RADIX"`
	NumericScale           sql.NullString `db:"NUMERIC_SCALE"`
	DatetimePrecision      sql.NullString `db:"DATETIME_PRECISION"`
	IntervalType           sql.NullString `db:"INTERVAL_TYPE"`
	IntervalPrecision      sql.NullString `db:"INTERVAL_PRECISION"`
	CharacterSetCatalog    sql.NullString `db:"CHARACTER_SET_CATALOG"`
	CharacterSetSchema     sql.NullString `db:"CHARACTER_SET_SCHEMA"`
	CharacterSetName       sql.NullString `db:"CHARACTER_SET_NAME"`
	CollationCatalog       sql.NullString `db:"COLLATION_CATALOG"`
	CollationSchema        sql.NullString `db:"COLLATION_SCHEMA"`
	CollationName          sql.NullString `db:"COLLATION_NAME"`
	DomainCatalog          sql.NullString `db:"DOMAIN_CATALOG"`
	DomainSchema           sql.NullString `db:"DOMAIN_SCHEMA"`
	DomainName             sql.NullString `db:"DOMAIN_NAME"`
	UdtCatalog             sql.NullString `db:"UDT_CATALOG"`
	UdtSchema              sql.NullString `db:"UDT_SCHEMA"`
	UdtName                sql.NullString `db:"UDT_NAME"`
	ScopeCatalog           sql.NullString `db:"SCOPE_CATALOG"`
	ScopeSchema            sql.NullString `db:"SCOPE_SCHEMA"`
	ScopeName              sql.NullString `db:"SCOPE_NAME"`
	MaximumCardinality     sql.NullString `db:"MAXIMUM_CARDINALITY"`
	DtdIdentifier          sql.NullString `db:"DTD_IDENTIFIER"`
	IsSelfReferencing      string         `db:"IS_SELF_REFERENCING"`
	IsIdentity             string         `db:"IS_IDENTITY"`
	IdentityGeneration     sql.NullString `db:"IDENTITY_GENERATION"`
	IdentityStart          sql.NullString `db:"IDENTITY_START"`
	IdentityIncrement      sql.NullString `db:"IDENTITY_INCREMENT"`
	IdentityMaximum        sql.NullString `db:"IDENTITY_MAXIMUM"`
	IdentityMinimum        sql.NullString `db:"IDENTITY_MINIMUM"`
	IdentityCycle          sql.NullString `db:"IDENTITY_CYCLE"`
	IdentityOrdered        sql.NullString `db:"IDENTITY_ORDERED"`
	Comment                sql.NullString `db:"COMMENT"`
	SchemaEvolutionRecord  sql.NullString `db:"SCHEMA_EVOLUTION_RECORD"`
}

type MaskingPolicyClient

type MaskingPolicyClient struct {
	// contains filtered or unexported fields
}

func NewMaskingPolicyClient

func NewMaskingPolicyClient(context *TestClientContext, idsGenerator *IdsGenerator) *MaskingPolicyClient

func (*MaskingPolicyClient) CreateMaskingPolicy

func (c *MaskingPolicyClient) CreateMaskingPolicy(t *testing.T) (*sdk.MaskingPolicy, func())

func (*MaskingPolicyClient) CreateMaskingPolicyIdentity

func (c *MaskingPolicyClient) CreateMaskingPolicyIdentity(t *testing.T, columnType sdk.DataType) (*sdk.MaskingPolicy, func())

func (*MaskingPolicyClient) CreateMaskingPolicyInSchema

func (c *MaskingPolicyClient) CreateMaskingPolicyInSchema(t *testing.T, schemaId sdk.DatabaseObjectIdentifier) (*sdk.MaskingPolicy, func())

func (*MaskingPolicyClient) CreateMaskingPolicyWithOptions

func (c *MaskingPolicyClient) CreateMaskingPolicyWithOptions(t *testing.T, schemaId sdk.DatabaseObjectIdentifier, signature []sdk.TableColumnSignature, returns sdk.DataType, expression string, options *sdk.CreateMaskingPolicyOptions) (*sdk.MaskingPolicy, func())

func (*MaskingPolicyClient) DropMaskingPolicyFunc

func (c *MaskingPolicyClient) DropMaskingPolicyFunc(t *testing.T, id sdk.SchemaObjectIdentifier) func()

type NetworkPolicyClient

type NetworkPolicyClient struct {
	// contains filtered or unexported fields
}

func NewNetworkPolicyClient

func NewNetworkPolicyClient(context *TestClientContext, idsGenerator *IdsGenerator) *NetworkPolicyClient

func (*NetworkPolicyClient) CreateNetworkPolicy

func (c *NetworkPolicyClient) CreateNetworkPolicy(t *testing.T) (*sdk.NetworkPolicy, func())

func (*NetworkPolicyClient) CreateNetworkPolicyWithRequest

func (c *NetworkPolicyClient) CreateNetworkPolicyWithRequest(t *testing.T, request *sdk.CreateNetworkPolicyRequest) (*sdk.NetworkPolicy, func())

func (*NetworkPolicyClient) DropNetworkPolicyFunc

func (c *NetworkPolicyClient) DropNetworkPolicyFunc(t *testing.T, id sdk.AccountObjectIdentifier) func()

type ParameterClient

type ParameterClient struct {
	// contains filtered or unexported fields
}

func NewParameterClient

func NewParameterClient(context *TestClientContext) *ParameterClient

func (*ParameterClient) UpdateAccountParameterTemporarily

func (c *ParameterClient) UpdateAccountParameterTemporarily(t *testing.T, parameter sdk.AccountParameter, newValue string) func()

type PasswordPolicyClient

type PasswordPolicyClient struct {
	// contains filtered or unexported fields
}

func NewPasswordPolicyClient

func NewPasswordPolicyClient(context *TestClientContext, idsGenerator *IdsGenerator) *PasswordPolicyClient

func (*PasswordPolicyClient) CreatePasswordPolicy

func (c *PasswordPolicyClient) CreatePasswordPolicy(t *testing.T) (*sdk.PasswordPolicy, func())

func (*PasswordPolicyClient) CreatePasswordPolicyInSchema

func (c *PasswordPolicyClient) CreatePasswordPolicyInSchema(t *testing.T, schemaId sdk.DatabaseObjectIdentifier) (*sdk.PasswordPolicy, func())

func (*PasswordPolicyClient) CreatePasswordPolicyInSchemaWithOptions

func (c *PasswordPolicyClient) CreatePasswordPolicyInSchemaWithOptions(t *testing.T, schemaId sdk.DatabaseObjectIdentifier, options *sdk.CreatePasswordPolicyOptions) (*sdk.PasswordPolicy, func())

func (*PasswordPolicyClient) CreatePasswordPolicyWithOptions

func (c *PasswordPolicyClient) CreatePasswordPolicyWithOptions(t *testing.T, options *sdk.CreatePasswordPolicyOptions) (*sdk.PasswordPolicy, func())

func (*PasswordPolicyClient) DropPasswordPolicyFunc

func (c *PasswordPolicyClient) DropPasswordPolicyFunc(t *testing.T, id sdk.SchemaObjectIdentifier) func()

type PipeClient

type PipeClient struct {
	// contains filtered or unexported fields
}

func NewPipeClient

func NewPipeClient(context *TestClientContext, idsGenerator *IdsGenerator) *PipeClient

func (*PipeClient) CreatePipe

func (c *PipeClient) CreatePipe(t *testing.T, copyStatement string) (*sdk.Pipe, func())

func (*PipeClient) CreatePipeInSchema

func (c *PipeClient) CreatePipeInSchema(t *testing.T, schemaId sdk.DatabaseObjectIdentifier, copyStatement string) (*sdk.Pipe, func())

func (*PipeClient) DropPipeFunc

func (c *PipeClient) DropPipeFunc(t *testing.T, id sdk.SchemaObjectIdentifier) func()

type PolicyReference

type PolicyReference struct {
	PolicyDb          string         `db:"POLICY_DB"`
	PolicySchema      string         `db:"POLICY_SCHEMA"`
	PolicyName        string         `db:"POLICY_NAME"`
	PolicyKind        string         `db:"POLICY_KIND"`
	RefDatabaseName   string         `db:"REF_DATABASE_NAME"`
	RefSchemaName     string         `db:"REF_SCHEMA_NAME"`
	RefEntityName     string         `db:"REF_ENTITY_NAME"`
	RefEntityDomain   string         `db:"REF_ENTITY_DOMAIN"`
	RefColumnName     sql.NullString `db:"REF_COLUMN_NAME"`
	RefArgColumnNames string         `db:"REF_ARG_COLUMN_NAMES"`
	TagDatabase       sql.NullString `db:"TAG_DATABASE"`
	TagSchema         sql.NullString `db:"TAG_SCHEMA"`
	TagName           sql.NullString `db:"TAG_NAME"`
	PolicyStatus      string         `db:"POLICY_STATUS"`
}

type ResourceMonitorClient

type ResourceMonitorClient struct {
	// contains filtered or unexported fields
}

func NewResourceMonitorClient

func NewResourceMonitorClient(context *TestClientContext, idsGenerator *IdsGenerator) *ResourceMonitorClient

func (*ResourceMonitorClient) CreateResourceMonitor

func (c *ResourceMonitorClient) CreateResourceMonitor(t *testing.T) (*sdk.ResourceMonitor, func())

func (*ResourceMonitorClient) CreateResourceMonitorWithOptions

func (c *ResourceMonitorClient) CreateResourceMonitorWithOptions(t *testing.T, opts *sdk.CreateResourceMonitorOptions) (*sdk.ResourceMonitor, func())

func (*ResourceMonitorClient) DropResourceMonitorFunc

func (c *ResourceMonitorClient) DropResourceMonitorFunc(t *testing.T, id sdk.AccountObjectIdentifier) func()

type RoleClient

type RoleClient struct {
	// contains filtered or unexported fields
}

func NewRoleClient

func NewRoleClient(context *TestClientContext, idsGenerator *IdsGenerator) *RoleClient

func (*RoleClient) CreateRole

func (c *RoleClient) CreateRole(t *testing.T) (*sdk.Role, func())

func (*RoleClient) CreateRoleGrantedToCurrentUser

func (c *RoleClient) CreateRoleGrantedToCurrentUser(t *testing.T) (*sdk.Role, func())

func (*RoleClient) CreateRoleWithName

func (c *RoleClient) CreateRoleWithName(t *testing.T, name string) (*sdk.Role, func())

TODO [SNOW-955520]: we have to control the name

func (*RoleClient) CreateRoleWithRequest

func (c *RoleClient) CreateRoleWithRequest(t *testing.T, req *sdk.CreateRoleRequest) (*sdk.Role, func())

func (*RoleClient) DropRoleFunc

func (c *RoleClient) DropRoleFunc(t *testing.T, id sdk.AccountObjectIdentifier) func()

func (*RoleClient) GrantOwnershipOnAccountObject

func (c *RoleClient) GrantOwnershipOnAccountObject(t *testing.T, roleId sdk.AccountObjectIdentifier, objectId sdk.AccountObjectIdentifier, objectType sdk.ObjectType)

TODO: move later to grants client

func (*RoleClient) GrantPrivilegeOnDatabaseToShare

func (c *RoleClient) GrantPrivilegeOnDatabaseToShare(t *testing.T, databaseId sdk.AccountObjectIdentifier, shareId sdk.AccountObjectIdentifier)

TODO: move later to grants client

func (*RoleClient) GrantRoleToCurrentUser

func (c *RoleClient) GrantRoleToCurrentUser(t *testing.T, id sdk.AccountObjectIdentifier)

func (*RoleClient) UseRole

func (c *RoleClient) UseRole(t *testing.T, roleName string) func()

type RowAccessPolicyClient

type RowAccessPolicyClient struct {
	// contains filtered or unexported fields
}

func NewRowAccessPolicyClient

func NewRowAccessPolicyClient(context *TestClientContext, idsGenerator *IdsGenerator) *RowAccessPolicyClient

func (*RowAccessPolicyClient) CreateRowAccessPolicy

func (c *RowAccessPolicyClient) CreateRowAccessPolicy(t *testing.T) (*sdk.RowAccessPolicy, func())

func (*RowAccessPolicyClient) DropRowAccessPolicyFunc

func (c *RowAccessPolicyClient) DropRowAccessPolicyFunc(t *testing.T, id sdk.SchemaObjectIdentifier) func()

func (*RowAccessPolicyClient) GetRowAccessPolicyFor

func (c *RowAccessPolicyClient) GetRowAccessPolicyFor(t *testing.T, id sdk.SchemaObjectIdentifier, objectType sdk.ObjectType) (*PolicyReference, error)

GetRowAccessPolicyFor is based on https://docs.snowflake.com/en/user-guide/security-row-intro#obtain-database-objects-with-a-row-access-policy. TODO: extract getting row access policies as resource (like getting tag in system functions)

type SchemaClient

type SchemaClient struct {
	// contains filtered or unexported fields
}

func NewSchemaClient

func NewSchemaClient(context *TestClientContext, idsGenerator *IdsGenerator) *SchemaClient

func (*SchemaClient) CreateSchema

func (c *SchemaClient) CreateSchema(t *testing.T) (*sdk.Schema, func())

func (*SchemaClient) CreateSchemaInDatabase

func (c *SchemaClient) CreateSchemaInDatabase(t *testing.T, databaseId sdk.AccountObjectIdentifier) (*sdk.Schema, func())

func (*SchemaClient) CreateSchemaInDatabaseWithIdentifier

func (c *SchemaClient) CreateSchemaInDatabaseWithIdentifier(t *testing.T, databaseId sdk.AccountObjectIdentifier, name string) (*sdk.Schema, func())

func (*SchemaClient) CreateSchemaWithName

func (c *SchemaClient) CreateSchemaWithName(t *testing.T, name string) (*sdk.Schema, func())

func (*SchemaClient) DropSchemaFunc

func (c *SchemaClient) DropSchemaFunc(t *testing.T, id sdk.DatabaseObjectIdentifier) func()

func (*SchemaClient) Show

func (*SchemaClient) UpdateDataRetentionTime

func (c *SchemaClient) UpdateDataRetentionTime(t *testing.T, id sdk.DatabaseObjectIdentifier, days int) func()

type SessionPolicyClient

type SessionPolicyClient struct {
	// contains filtered or unexported fields
}

func NewSessionPolicyClient

func NewSessionPolicyClient(context *TestClientContext, idsGenerator *IdsGenerator) *SessionPolicyClient

func (*SessionPolicyClient) CreateSessionPolicy

func (c *SessionPolicyClient) CreateSessionPolicy(t *testing.T) (*sdk.SessionPolicy, func())

func (*SessionPolicyClient) CreateSessionPolicyWithOptions

func (c *SessionPolicyClient) CreateSessionPolicyWithOptions(t *testing.T, id sdk.SchemaObjectIdentifier, request *sdk.CreateSessionPolicyRequest) (*sdk.SessionPolicy, func())

func (*SessionPolicyClient) DropSessionPolicyFunc

func (c *SessionPolicyClient) DropSessionPolicyFunc(t *testing.T, id sdk.SchemaObjectIdentifier) func()

type ShareClient

type ShareClient struct {
	// contains filtered or unexported fields
}

func NewShareClient

func NewShareClient(context *TestClientContext, idsGenerator *IdsGenerator) *ShareClient

func (*ShareClient) CreateShare

func (c *ShareClient) CreateShare(t *testing.T) (*sdk.Share, func())

func (*ShareClient) CreateShareWithName

func (c *ShareClient) CreateShareWithName(t *testing.T, name string) (*sdk.Share, func())

TODO [SNOW-955520]: we have to control the name

func (*ShareClient) CreateShareWithOptions

func (c *ShareClient) CreateShareWithOptions(t *testing.T, id sdk.AccountObjectIdentifier, opts *sdk.CreateShareOptions) (*sdk.Share, func())

func (*ShareClient) DropShareFunc

func (c *ShareClient) DropShareFunc(t *testing.T, id sdk.AccountObjectIdentifier) func()

func (*ShareClient) SetAccountOnShare

func (c *ShareClient) SetAccountOnShare(t *testing.T, accountId sdk.AccountIdentifier, shareId sdk.AccountObjectIdentifier)

type StageClient

type StageClient struct {
	// contains filtered or unexported fields
}

func NewStageClient

func NewStageClient(context *TestClientContext, idsGenerator *IdsGenerator) *StageClient

func (*StageClient) CopyIntoTableFromFile

func (c *StageClient) CopyIntoTableFromFile(t *testing.T, table, stage sdk.SchemaObjectIdentifier, filename string)

func (*StageClient) CreateStage

func (c *StageClient) CreateStage(t *testing.T) (*sdk.Stage, func())

func (*StageClient) CreateStageInSchema

func (c *StageClient) CreateStageInSchema(t *testing.T, schemaId sdk.DatabaseObjectIdentifier) (*sdk.Stage, func())

func (*StageClient) CreateStageWithDirectory

func (c *StageClient) CreateStageWithDirectory(t *testing.T) (*sdk.Stage, func())

func (*StageClient) CreateStageWithRequest

func (c *StageClient) CreateStageWithRequest(t *testing.T, request *sdk.CreateInternalStageRequest) (*sdk.Stage, func())

func (*StageClient) CreateStageWithURL

func (c *StageClient) CreateStageWithURL(t *testing.T, id sdk.SchemaObjectIdentifier) (*sdk.Stage, func())

func (*StageClient) DropStageFunc

func (c *StageClient) DropStageFunc(t *testing.T, id sdk.SchemaObjectIdentifier) func()

func (*StageClient) PutOnStage

func (c *StageClient) PutOnStage(t *testing.T, id sdk.SchemaObjectIdentifier, filename string)

func (*StageClient) PutOnStageWithContent

func (c *StageClient) PutOnStageWithContent(t *testing.T, id sdk.SchemaObjectIdentifier, filename string, content string)

type TableClient

type TableClient struct {
	// contains filtered or unexported fields
}

func NewTableClient

func NewTableClient(context *TestClientContext, idsGenerator *IdsGenerator) *TableClient

func (*TableClient) CreateTable

func (c *TableClient) CreateTable(t *testing.T) (*sdk.Table, func())

func (*TableClient) CreateTableInSchema

func (c *TableClient) CreateTableInSchema(t *testing.T, schemaId sdk.DatabaseObjectIdentifier) (*sdk.Table, func())

func (*TableClient) CreateTableWithColumns

func (c *TableClient) CreateTableWithColumns(t *testing.T, schemaId sdk.DatabaseObjectIdentifier, name string, columns []sdk.TableColumnRequest) (*sdk.Table, func())

func (*TableClient) DropTableFunc

func (c *TableClient) DropTableFunc(t *testing.T, id sdk.SchemaObjectIdentifier) func()

func (*TableClient) GetTableColumnsFor

func (c *TableClient) GetTableColumnsFor(t *testing.T, tableId sdk.SchemaObjectIdentifier) []InformationSchemaColumns

GetTableColumnsFor is based on https://docs.snowflake.com/en/sql-reference/info-schema/columns. TODO: extract getting table columns as resource (like getting tag in system functions)

type TagClient

type TagClient struct {
	// contains filtered or unexported fields
}

func NewTagClient

func NewTagClient(context *TestClientContext, idsGenerator *IdsGenerator) *TagClient

func (*TagClient) CreateTag

func (c *TagClient) CreateTag(t *testing.T) (*sdk.Tag, func())

func (*TagClient) CreateTagInSchema

func (c *TagClient) CreateTagInSchema(t *testing.T, schemaId sdk.DatabaseObjectIdentifier) (*sdk.Tag, func())

func (*TagClient) DropTagFunc

func (c *TagClient) DropTagFunc(t *testing.T, id sdk.SchemaObjectIdentifier) func()

type TaskClient

type TaskClient struct {
	// contains filtered or unexported fields
}

func NewTaskClient

func NewTaskClient(context *TestClientContext, idsGenerator *IdsGenerator) *TaskClient

func (*TaskClient) CreateTask

func (c *TaskClient) CreateTask(t *testing.T) (*sdk.Task, func())

func (*TaskClient) CreateTaskWithAfter

func (c *TaskClient) CreateTaskWithAfter(t *testing.T, taskId sdk.SchemaObjectIdentifier) (*sdk.Task, func())

func (*TaskClient) CreateTaskWithRequest

func (c *TaskClient) CreateTaskWithRequest(t *testing.T, request *sdk.CreateTaskRequest) (*sdk.Task, func())

func (*TaskClient) DropTaskFunc

func (c *TaskClient) DropTaskFunc(t *testing.T, id sdk.SchemaObjectIdentifier) func()

type TestClient

type TestClient struct {
	Ids *IdsGenerator

	Account            *AccountClient
	Alert              *AlertClient
	ApiIntegration     *ApiIntegrationClient
	Application        *ApplicationClient
	ApplicationPackage *ApplicationPackageClient
	Context            *ContextClient
	Database           *DatabaseClient
	DatabaseRole       *DatabaseRoleClient
	DynamicTable       *DynamicTableClient
	FailoverGroup      *FailoverGroupClient
	FileFormat         *FileFormatClient
	MaskingPolicy      *MaskingPolicyClient
	NetworkPolicy      *NetworkPolicyClient
	Parameter          *ParameterClient
	PasswordPolicy     *PasswordPolicyClient
	Pipe               *PipeClient
	ResourceMonitor    *ResourceMonitorClient
	Role               *RoleClient
	RowAccessPolicy    *RowAccessPolicyClient
	Schema             *SchemaClient
	SessionPolicy      *SessionPolicyClient
	Share              *ShareClient
	Stage              *StageClient
	Table              *TableClient
	Tag                *TagClient
	Task               *TaskClient
	User               *UserClient
	View               *ViewClient
	Warehouse          *WarehouseClient
	// contains filtered or unexported fields
}

func NewTestClient

func NewTestClient(c *sdk.Client, database string, schema string, warehouse string, testObjectSuffix string) *TestClient

type TestClientContext

type TestClientContext struct {
	// contains filtered or unexported fields
}

type UserClient

type UserClient struct {
	// contains filtered or unexported fields
}

func NewUserClient

func NewUserClient(context *TestClientContext, idsGenerator *IdsGenerator) *UserClient

func (*UserClient) CreateUser

func (c *UserClient) CreateUser(t *testing.T) (*sdk.User, func())

func (*UserClient) CreateUserWithName

func (c *UserClient) CreateUserWithName(t *testing.T, name string) (*sdk.User, func())

TODO [SNOW-955520]: we have to control the name

func (*UserClient) CreateUserWithOptions

func (c *UserClient) CreateUserWithOptions(t *testing.T, id sdk.AccountObjectIdentifier, opts *sdk.CreateUserOptions) (*sdk.User, func())

func (*UserClient) DropUserFunc

func (c *UserClient) DropUserFunc(t *testing.T, id sdk.AccountObjectIdentifier) func()

type ViewClient

type ViewClient struct {
	// contains filtered or unexported fields
}

func NewViewClient

func NewViewClient(context *TestClientContext, idsGenerator *IdsGenerator) *ViewClient

func (*ViewClient) CreateView

func (c *ViewClient) CreateView(t *testing.T, query string) (*sdk.View, func())

func (*ViewClient) DropViewFunc

func (c *ViewClient) DropViewFunc(t *testing.T, id sdk.SchemaObjectIdentifier) func()

type WarehouseClient

type WarehouseClient struct {
	// contains filtered or unexported fields
}

func NewWarehouseClient

func NewWarehouseClient(context *TestClientContext, idsGenerator *IdsGenerator) *WarehouseClient

func (*WarehouseClient) CreateWarehouse

func (c *WarehouseClient) CreateWarehouse(t *testing.T) (*sdk.Warehouse, func())

func (*WarehouseClient) CreateWarehouseWithOptions

func (c *WarehouseClient) CreateWarehouseWithOptions(t *testing.T, id sdk.AccountObjectIdentifier, opts *sdk.CreateWarehouseOptions) (*sdk.Warehouse, func())

func (*WarehouseClient) DropWarehouseFunc

func (c *WarehouseClient) DropWarehouseFunc(t *testing.T, id sdk.AccountObjectIdentifier) func()

func (*WarehouseClient) Show

func (*WarehouseClient) UpdateMaxConcurrencyLevel

func (c *WarehouseClient) UpdateMaxConcurrencyLevel(t *testing.T, id sdk.AccountObjectIdentifier, level int)

func (*WarehouseClient) UseWarehouse

func (c *WarehouseClient) UseWarehouse(t *testing.T, id sdk.AccountObjectIdentifier) func()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL