sdk

package
v0.68.1 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: MIT Imports: 19 Imported by: 0

README

Snowflake Go SDK

[secondary_test_account] credentials are required in the Snowflake profile if running integration tests that provision resources in multiple accounts:

Required environment variable to run sweepers (cleanup up resources created by integration tests):

SNOWFLAKE_ENABLE_SWEEP=1

Required environment variable to test creating an account. Note that this cannot be cleaned up by sweepers:

SNOWFLAKE_TEST_ACCOUNT_CREATE=1

SQL clause types

ddl tag function output format
ddl:"static" sqlStaticClause WORD
ddl:"keyword" sqlKeywordClause "WORD" (quotes configurable)
ddl:"identifier" sqlIdentifierClause "a.b.c" or OBJ_TYPE "a.b.c"
ddl:"parameter" sqlParameterClause PARAM = "value" (quotes configurable) or PARAM = 2
ddl:"list" sqlListClause WORD (<subclause>, <subclause>) (WORD, parentheses, separator configurable)

Documentation

Index

Constants

View Source
const (
	Comma   commaModifier = "comma"
	NoComma commaModifier = "no_comma"
)
View Source
const (
	NoQuotes     quoteModifier = "no_quotes"
	DoubleQuotes quoteModifier = "double_quotes"
	SingleQuotes quoteModifier = "single_quotes"
)
View Source
const (
	NoParentheses parenModifier = "no_parentheses"
	Parentheses   parenModifier = "parentheses"
)
View Source
const (
	NoReverse reverseModifier = "no_reverse"
	Reverse   reverseModifier = "reverse"
)
View Source
const (
	Equals      equalsModifier = "equals"
	ArrowEquals equalsModifier = "arrow_equals"
	NoEquals    equalsModifier = "no_equals"
)

Variables

View Source
var (
	// go-snowflake errors.
	ErrObjectNotExistOrAuthorized = errors.New("object does not exist or not authorized")
	ErrAccountIsEmpty             = errors.New("account is empty")

	// snowflake-sdk errors.
	ErrInvalidObjectIdentifier = errors.New("invalid object identifier")
)

Functions

func Bool

func Bool(b bool) *bool

Bool returns a pointer to the given bool.

func DefaultConfig

func DefaultConfig() *gosnowflake.Config

func EnvConfig

func EnvConfig() *gosnowflake.Config

func Float64 added in v0.65.0

func Float64(f float64) *float64

Int64 returns a pointer to the given int64.

func Int

func Int(i int) *int

Int returns a pointer to the given int.

func IsValidDataType

func IsValidDataType(v string) bool

func IsValidWarehouseSize added in v0.66.2

func IsValidWarehouseSize(v string) bool

func MergeConfig

func MergeConfig(baseConfig *gosnowflake.Config, mergeConfig *gosnowflake.Config) *gosnowflake.Config

func Pointer added in v0.65.0

func Pointer[K any](v K) *K

Pointer is a generic function that returns a pointer to a given value.

func ProfileConfig

func ProfileConfig(profile string) (*gosnowflake.Config, error)

func String

func String(s string) *string

String returns a pointer to the given string.

func Sweep added in v0.65.0

func Sweep(client *Client, prefix string) error

func SweepAll added in v0.65.0

func SweepAll(client *Client) error

Types

type Account added in v0.65.0

type Account struct {
	OrganizationName                     string
	AccountName                          string
	RegionGroup                          string
	SnowflakeRegion                      string
	Edition                              AccountEdition
	AccountURL                           string
	CreatedOn                            time.Time
	Comment                              string
	AccountLocator                       string
	AccountLocatorURL                    string
	ManagedAccounts                      int
	ConsumptionBillingEntityName         string
	MarketplaceConsumerBillingEntityName string
	MarketplaceProviderBillingEntityName string
	OldAccountURL                        string
	IsOrgAdmin                           bool
}

func (*Account) AccountID added in v0.65.0

func (v *Account) AccountID() AccountIdentifier

func (*Account) ID added in v0.65.0

type AccountDrop added in v0.65.0

type AccountDrop struct {
	Name   AccountObjectIdentifier `ddl:"identifier"`
	OldURL *bool                   `ddl:"keyword" sql:"DROP OLD URL"`
}

type AccountEdition added in v0.65.0

type AccountEdition string
var (
	EditionStandard         AccountEdition = "STANDARD"
	EditionEnterprise       AccountEdition = "ENTERPRISE"
	EditionBusinessCritical AccountEdition = "BUSINESS_CRITICAL"
)

type AccountIdentifier added in v0.65.0

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

func NewAccountIdentifier added in v0.65.0

func NewAccountIdentifier(organizationName, accountName string) AccountIdentifier

func NewAccountIdentifierFromAccountLocator added in v0.65.0

func NewAccountIdentifierFromAccountLocator(accountLocator string) AccountIdentifier

func (AccountIdentifier) Name added in v0.65.0

func (i AccountIdentifier) Name() string

type AccountLevelParameters added in v0.65.0

type AccountLevelParameters struct {
	AccountParameters *AccountParameters `ddl:"list,no_parentheses"`
	SessionParameters *SessionParameters `ddl:"list,no_parentheses"`
	ObjectParameters  *ObjectParameters  `ddl:"list,no_parentheses"`
	UserParameters    *UserParameters    `ddl:"list,no_parentheses"`
}

type AccountLevelParametersUnset added in v0.65.0

type AccountLevelParametersUnset struct {
	AccountParameters *AccountParametersUnset `ddl:"list,no_parentheses"`
	SessionParameters *SessionParametersUnset `ddl:"list,no_parentheses"`
	ObjectParameters  *ObjectParametersUnset  `ddl:"list,no_parentheses"`
	UserParameters    *UserParametersUnset    `ddl:"list,no_parentheses"`
}

type AccountObjectIdentifier

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

func NewAccountObjectIdentifier

func NewAccountObjectIdentifier(name string) AccountObjectIdentifier

func NewAccountObjectIdentifierFromFullyQualifiedName added in v0.68.0

func NewAccountObjectIdentifierFromFullyQualifiedName(fullyQualifiedName string) AccountObjectIdentifier

func (AccountObjectIdentifier) FullyQualifiedName

func (i AccountObjectIdentifier) FullyQualifiedName() string

func (AccountObjectIdentifier) Name

type AccountObjectPrivilege added in v0.68.0

type AccountObjectPrivilege string
const (
	// -- For DATABASE
	// { CREATE { DATABASE ROLE | SCHEMA } | IMPORTED PRIVILEGES | MODIFY | MONITOR | USAGE } [ , ... ]
	AccountObjectPrivilegeCreateDatabaseRole AccountObjectPrivilege = "CREATE DATABASE ROLE"
	AccountObjectPrivilegeCreateSchema       AccountObjectPrivilege = "CREATE SCHEMA"
	AccountObjectPrivilegeImportedPrivileges AccountObjectPrivilege = "IMPORTED PRIVILEGES"
	AccountObjectPrivilegeModify             AccountObjectPrivilege = "MODIFY"
	AccountObjectPrivilegeMonitor            AccountObjectPrivilege = "MONITOR"
	AccountObjectPrivilegeUsage              AccountObjectPrivilege = "USAGE"

	// -- For FAILOVER GROUP
	// { FAILOVER | MODIFY | MONITOR | REPLICATE } [ , ... ]
	AccountObjectPrivilegeFailover AccountObjectPrivilege = "FAILOVER"

	// -- For INTEGRATION
	// { USAGE | USE_ANY_ROLE } [ , ... ]
	// AccountObjectPrivilegeUsage AccountObjectPrivilege = "USAGE" (duplicate)
	AccountObjectPrivilegeUseAnyRole AccountObjectPrivilege = "USE_ANY_ROLE"

	// -- For REPLICATION GROUP
	// { MODIFY | MONITOR | REPLICATE } [ , ... ]
	// AccountObjectPrivilegeModify AccountObjectPrivilege = "MODIFY" (duplicate)
	// AccountObjectPrivilegeMonitor AccountObjectPrivilege = "MONITOR" (duplicate)
	AccountObjectPrivilegeReplicate AccountObjectPrivilege = "REPLICATE"

	// -- For WAREHOUSE
	// { MODIFY | MONITOR | USAGE | OPERATE } [ , ... ]
	// AccountObjectPrivilegeModify AccountObjectPrivilege = "MODIFY" (duplicate)
	// AccountObjectPrivilegeMonitor AccountObjectPrivilege = "MONITOR" (duplicate)
	// AccountObjectPrivilegeUsage AccountObjectPrivilege = "USAGE" (duplicate)
	AccountObjectPrivilegeOperate AccountObjectPrivilege = "OPERATE"
)

func (AccountObjectPrivilege) String added in v0.68.0

func (p AccountObjectPrivilege) String() string

type AccountParameter added in v0.65.0

type AccountParameter string
const (
	// Account Parameters
	AccountParameterAllowClientMFACaching                        AccountParameter = "ALLOW_CLIENT_MFA_CACHING"
	AccountParameterAllowIDToken                                 AccountParameter = "ALLOW_ID_TOKEN" // #nosec G101
	AccountParameterClientEncryptionKeySize                      AccountParameter = "CLIENT_ENCRYPTION_KEY_SIZE"
	AccountParameterEnableInternalStagesPrivatelink              AccountParameter = "ENABLE_INTERNAL_STAGES_PRIVATELINK"
	AccountParameterEventTable                                   AccountParameter = "EVENT_TABLE"
	AccountParameterExternalOAuthAddPrivilegedRolesToBlockedList AccountParameter = "EXTERNAL_OAUTH_ADD_PRIVILEGED_ROLES_TO_BLOCKED_LIST"
	AccountParameterInitialReplicationSizeLimitInTB              AccountParameter = "INITIAL_REPLICATION_SIZE_LIMIT_IN_TB"
	AccountParameterMinDataRetentionTimeInDays                   AccountParameter = "MIN_DATA_RETENTION_TIME_IN_DAYS"
	AccountParameterNetworkPolicy                                AccountParameter = "NETWORK_POLICY"
	AccountParameterPeriodicDataRekeying                         AccountParameter = "PERIODIC_DATA_REKEYING"
	AccountParameterPreventUnloadToInlineURL                     AccountParameter = "PREVENT_UNLOAD_TO_INLINE_URL"
	AccountParameterPreventUnloadToInternalStages                AccountParameter = "PREVENT_UNLOAD_TO_INTERNAL_STAGES"
	AccountParameterRequireStorageIntegrationForStageCreation    AccountParameter = "REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_CREATION"
	AccountParameterRequireStorageIntegrationForStageOperation   AccountParameter = "REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_OPERATION"
	AccountParameterSSOLoginPage                                 AccountParameter = "SSO_LOGIN_PAGE"

	// Session Parameters (inherited)
	AccountParameterAbortDetachedQuery               AccountParameter = "ABORT_DETACHED_QUERY"
	AccountParameterAutocommit                       AccountParameter = "AUTOCOMMIT"
	AccountParameterBinaryInputFormat                AccountParameter = "BINARY_INPUT_FORMAT"
	AccountParameterBinaryOutputFormat               AccountParameter = "BINARY_OUTPUT_FORMAT"
	AccountParameterDateInputFormat                  AccountParameter = "DATE_INPUT_FORMAT"
	AccountParameterDateOutputFormat                 AccountParameter = "DATE_OUTPUT_FORMAT"
	AccountParameterErrorOnNondeterministicMerge     AccountParameter = "ERROR_ON_NONDETERMINISTIC_MERGE"
	AccountParameterErrorOnNondeterministicUpdate    AccountParameter = "ERROR_ON_NONDETERMINISTIC_UPDATE"
	AccountParameterGeographyOutputFormat            AccountParameter = "GEOGRAPHY_OUTPUT_FORMAT"
	AccountParameterJSONIndent                       AccountParameter = "JSON_INDENT"
	AccountParameterLockTimeout                      AccountParameter = "LOCK_TIMEOUT"
	AccountParameterQueryTag                         AccountParameter = "QUERY_TAG"
	AccountParameterRowsPerResultset                 AccountParameter = "ROWS_PER_RESULTSET"
	AccountParameterSimulatedDataSharingConsumer     AccountParameter = "SIMULATED_DATA_SHARING_CONSUMER"
	AccountParameterStatementTimeoutInSeconds        AccountParameter = "STATEMENT_TIMEOUT_IN_SECONDS"
	AccountParameterStrictJSONOutput                 AccountParameter = "STRICT_JSON_OUTPUT"
	AccountParameterTimestampDayIsAlways24h          AccountParameter = "TIMESTAMP_DAY_IS_ALWAYS_24H"
	AccountParameterTimestampInputFormat             AccountParameter = "TIMESTAMP_INPUT_FORMAT"
	AccountParameterTimestampLTZOutputFormat         AccountParameter = "TIMESTAMP_LTZ_OUTPUT_FORMAT"
	AccountParameterTimestampNTZOutputFormat         AccountParameter = "TIMESTAMP_NTZ_OUTPUT_FORMAT"
	AccountParameterTimestampOutputFormat            AccountParameter = "TIMESTAMP_OUTPUT_FORMAT"
	AccountParameterTimestampTypeMapping             AccountParameter = "TIMESTAMP_TYPE_MAPPING"
	AccountParameterTimestampTZOutputFormat          AccountParameter = "TIMESTAMP_TZ_OUTPUT_FORMAT"
	AccountParameterTimezone                         AccountParameter = "TIMEZONE"
	AccountParameterTimeInputFormat                  AccountParameter = "TIME_INPUT_FORMAT"
	AccountParameterTimeOutputFormat                 AccountParameter = "TIME_OUTPUT_FORMAT"
	AccountParameterTransactionDefaultIsolationLevel AccountParameter = "TRANSACTION_DEFAULT_ISOLATION_LEVEL"
	AccountParameterTwoDigitCenturyStart             AccountParameter = "TWO_DIGIT_CENTURY_START"
	AccountParameterUnsupportedDDLAction             AccountParameter = "UNSUPPORTED_DDL_ACTION"
	AccountParameterUseCachedResult                  AccountParameter = "USE_CACHED_RESULT"
	AccountParameterWeekOfYearPolicy                 AccountParameter = "WEEK_OF_YEAR_POLICY"
	AccountParameterWeekStart                        AccountParameter = "WEEK_START"

	// Object Parameters (inherited)
	AccountParameterDataRetentionTimeInDays             AccountParameter = "DATA_RETENTION_TIME_IN_DAYS"
	AccountParameterDefaultDDLCollation                 AccountParameter = "DEFAULT_DDL_COLLATION"
	AccountParameterLogLevel                            AccountParameter = "LOG_LEVEL"
	AccountParameterMaxConcurrencyLevel                 AccountParameter = "MAX_CONCURRENCY_LEVEL"
	AccountParameterMaxDataExtensionTimeInDays          AccountParameter = "MAX_DATA_EXTENSION_TIME_IN_DAYS"
	AccountParameterPipeExecutionPaused                 AccountParameter = "PIPE_EXECUTION_PAUSED"
	AccountParameterStatementQueuedTimeoutInSeconds     AccountParameter = "STATEMENT_QUEUED_TIMEOUT_IN_SECONDS"
	AccountParameterShareRestrictions                   AccountParameter = "SHARE_RESTRICTIONS"
	AccountParameterSuspendTaskAfterNumFailures         AccountParameter = "SUSPEND_TASK_AFTER_NUM_FAILURES"
	AccountParameterTraceLevel                          AccountParameter = "TRACE_LEVEL"
	AccountParameterUserTaskManagedInitialWarehouseSize AccountParameter = "USER_TASK_MANAGED_INITIAL_WAREHOUSE_SIZE"
	AccountParameterUserTaskTimeoutMs                   AccountParameter = "USER_TASK_TIMEOUT_MS"

	// User Parameters (inherited)
	AccountParameterEnableUnredactedQuerySyntaxError AccountParameter = "ENABLE_UNREDACTED_QUERY_SYNTAX_ERROR"
)

There is a hierarchical relationship between the different parameter types. Account parameters can set any of account, user, session or object parameters https://docs.snowflake.com/en/sql-reference/parameters#parameter-hierarchy-and-types Account Parameters include Session Parameters, Object Parameters and User Parameters

type AccountParameters added in v0.65.0

type AccountParameters struct {
	// Account Parameters
	AllowClientMFACaching                        *bool    `ddl:"parameter" sql:"ALLOW_CLIENT_MFA_CACHING"`
	AllowIDToken                                 *bool    `ddl:"parameter" sql:"ALLOW_ID_TOKEN"`
	ClientEncryptionKeySize                      *int     `ddl:"parameter" sql:"CLIENT_ENCRYPTION_KEY_SIZE"`
	EnableInternalStagesPrivatelink              *bool    `ddl:"parameter" sql:"ENABLE_INTERNAL_STAGES_PRIVATELINK"`
	EventTable                                   *string  `ddl:"parameter,single_quotes" sql:"EVENT_TABLE"`
	ExternalOAuthAddPrivilegedRolesToBlockedList *bool    `ddl:"parameter" sql:"EXTERNAL_OAUTH_ADD_PRIVILEGED_ROLES_TO_BLOCKED_LIST"`
	InitialReplicationSizeLimitInTB              *float64 `ddl:"parameter" sql:"INITIAL_REPLICATION_SIZE_LIMIT_IN_TB"`
	MinDataRetentionTimeInDays                   *int     `ddl:"parameter" sql:"MIN_DATA_RETENTION_TIME_IN_DAYS"`
	NetworkPolicy                                *string  `ddl:"parameter,single_quotes" sql:"NETWORK_POLICY"`
	PeriodicDataRekeying                         *bool    `ddl:"parameter" sql:"PERIODIC_DATA_REKEYING"`
	PreventUnloadToInlineURL                     *bool    `ddl:"parameter" sql:"PREVENT_UNLOAD_TO_INLINE_URL"`
	PreventUnloadToInternalStages                *bool    `ddl:"parameter" sql:"PREVENT_UNLOAD_TO_INTERNAL_STAGES"`
	RequireStorageIntegrationForStageCreation    *bool    `ddl:"parameter" sql:"REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_CREATION"`
	RequireStorageIntegrationForStageOperation   *bool    `ddl:"parameter" sql:"REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_OPERATION"`
	SSOLoginPage                                 *bool    `ddl:"parameter" sql:"SSO_LOGIN_PAGE"`
}

type AccountParametersUnset added in v0.65.0

type AccountParametersUnset struct {
	AllowClientMFACaching                        *bool `ddl:"keyword" sql:"ALLOW_CLIENT_MFA_CACHING"`
	AllowIDToken                                 *bool `ddl:"keyword" sql:"ALLOW_ID_TOKEN"`
	ClientEncryptionKeySize                      *bool `ddl:"keyword" sql:"CLIENT_ENCRYPTION_KEY_SIZE"`
	EnableInternalStagesPrivatelink              *bool `ddl:"keyword" sql:"ENABLE_INTERNAL_STAGES_PRIVATELINK"`
	EventTable                                   *bool `ddl:"keyword" sql:"EVENT_TABLE"`
	ExternalOAuthAddPrivilegedRolesToBlockedList *bool `ddl:"keyword" sql:"EXTERNAL_OAUTH_ADD_PRIVILEGED_ROLES_TO_BLOCKED_LIST"`
	InitialReplicationSizeLimitInTB              *bool `ddl:"keyword" sql:"INITIAL_REPLICATION_SIZE_LIMIT_IN_TB"`
	MinDataRetentionTimeInDays                   *bool `ddl:"keyword" sql:"MIN_DATA_RETENTION_TIME_IN_DAYS"`
	NetworkPolicy                                *bool `ddl:"keyword,single_quotes" sql:"NETWORK_POLICY"`
	PeriodicDataRekeying                         *bool `ddl:"keyword" sql:"PERIODIC_DATA_REKEYING"`
	PreventUnloadToInlineURL                     *bool `ddl:"keyword" sql:"PREVENT_UNLOAD_TO_INLINE_URL"`
	PreventUnloadToInternalStages                *bool `ddl:"keyword" sql:"PREVENT_UNLOAD_TO_INTERNAL_STAGES"`
	RequireStorageIntegrationForStageCreation    *bool `ddl:"keyword" sql:"REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_CREATION"`
	RequireStorageIntegrationForStageOperation   *bool `ddl:"keyword" sql:"REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_OPERATION"`
	SSOLoginPage                                 *bool `ddl:"keyword" sql:"SSO_LOGIN_PAGE"`
}

type AccountRename added in v0.65.0

type AccountRename struct {
	Name       AccountObjectIdentifier `ddl:"identifier"`
	NewName    AccountObjectIdentifier `ddl:"identifier" sql:"RENAME TO"`
	SaveOldURL *bool                   `ddl:"parameter" sql:"SAVE_OLD_URL"`
}

type AccountRoleGrantOn added in v0.68.0

type AccountRoleGrantOn struct {
	Account       *bool                 `ddl:"keyword" sql:"ACCOUNT"`
	AccountObject *GrantOnAccountObject `ddl:"-"`
	Schema        *GrantOnSchema        `ddl:"-"`
	SchemaObject  *GrantOnSchemaObject  `ddl:"-"`
}

type AccountRoleGrantPrivileges added in v0.68.0

type AccountRoleGrantPrivileges struct {
	GlobalPrivileges        []GlobalPrivilege        `ddl:"-"`
	AccountObjectPrivileges []AccountObjectPrivilege `ddl:"-"`
	SchemaPrivileges        []SchemaPrivilege        `ddl:"-"`
	SchemaObjectPrivileges  []SchemaObjectPrivilege  `ddl:"-"`
	AllPrivileges           *bool                    `ddl:"keyword" sql:"ALL PRIVILEGES"`
}

type AccountSet added in v0.65.0

type AccountSet struct {
	Parameters      *AccountLevelParameters `ddl:"list,no_parentheses"`
	ResourceMonitor AccountObjectIdentifier `ddl:"identifier,equals" sql:"RESOURCE_MONITOR"`
	PasswordPolicy  SchemaObjectIdentifier  `ddl:"identifier" sql:"PASSWORD POLICY"`
	SessionPolicy   SchemaObjectIdentifier  `ddl:"identifier" sql:"SESSION POLICY"`
	Tag             []TagAssociation        `ddl:"keyword" sql:"TAG"`
}

type AccountUnset added in v0.65.0

type AccountUnset struct {
	Parameters     *AccountLevelParametersUnset `ddl:"list,no_parentheses"`
	PasswordPolicy *bool                        `ddl:"keyword" sql:"PASSWORD POLICY"`
	SessionPolicy  *bool                        `ddl:"keyword" sql:"SESSION POLICY"`
	Tag            []ObjectIdentifier           `ddl:"keyword" sql:"TAG"`
}

type Accounts added in v0.65.0

type Accounts interface {
	// Create creates an account.
	Create(ctx context.Context, id AccountObjectIdentifier, opts *CreateAccountOptions) error
	// Alter modifies an existing account
	Alter(ctx context.Context, opts *AlterAccountOptions) error
	// Show returns a list of accounts.
	Show(ctx context.Context, opts *ShowAccountOptions) ([]*Account, error)
	// ShowByID returns an account by id
	ShowByID(ctx context.Context, id AccountObjectIdentifier) (*Account, error)
}

type Alert added in v0.68.0

type Alert struct {
	CreatedOn    time.Time
	Name         string
	DatabaseName string
	SchemaName   string
	Owner        string
	Comment      *string
	Warehouse    string
	Schedule     string
	State        AlertState
	Condition    string
	Action       string
}

func (*Alert) ID added in v0.68.0

func (v *Alert) ID() SchemaObjectIdentifier

func (*Alert) ObjectType added in v0.68.0

func (v *Alert) ObjectType() ObjectType

type AlertAction added in v0.68.0

type AlertAction string
var (
	// AlertActionResume makes a suspended alert active.
	AlertActionResume AlertAction = "RESUME"
	// AlertActionSuspend puts the alert into a “Suspended” state.
	AlertActionSuspend AlertAction = "SUSPEND"
)

type AlertCondition added in v0.68.0

type AlertCondition struct {
	Condition []string `ddl:"keyword,parentheses,no_comma" sql:"EXISTS"`
}

type AlertDetails added in v0.68.0

type AlertDetails struct {
	CreatedOn    time.Time
	Name         string
	DatabaseName string
	SchemaName   string
	Owner        string
	Comment      *string
	Warehouse    string
	Schedule     string
	State        string
	Condition    string
	Action       string
}

type AlertSet added in v0.68.0

type AlertSet struct {
	Warehouse *AccountObjectIdentifier `ddl:"identifier,equals" sql:"WAREHOUSE"`
	Schedule  *string                  `ddl:"parameter,single_quotes" sql:"SCHEDULE"`
	Comment   *string                  `ddl:"parameter,single_quotes" sql:"COMMENT"`
}

type AlertState added in v0.68.0

type AlertState string
var (
	AlertStateStarted   AlertState = "started"
	AlertStateSuspended AlertState = "suspended"
)

type AlertUnset added in v0.68.0

type AlertUnset struct {
	Warehouse *bool `ddl:"keyword" sql:"WAREHOUSE"`
	Schedule  *bool `ddl:"keyword" sql:"SCHEDULE"`
	Comment   *bool `ddl:"keyword" sql:"COMMENT"`
}

type Alerts added in v0.68.0

type Alerts interface {
	// Create creates a new alert.
	Create(ctx context.Context, id SchemaObjectIdentifier, warehouse AccountObjectIdentifier, schedule string, condition string, action string, opts *CreateAlertOptions) error
	// Alter modifies an existing alert.
	Alter(ctx context.Context, id SchemaObjectIdentifier, opts *AlterAlertOptions) error
	// Drop removes an alert.
	Drop(ctx context.Context, id SchemaObjectIdentifier) error
	// Show returns a list of alerts
	Show(ctx context.Context, opts *ShowAlertOptions) ([]*Alert, error)
	// ShowByID returns an alert by ID
	ShowByID(ctx context.Context, id SchemaObjectIdentifier) (*Alert, error)
	// Describe returns the details of an alert.
	Describe(ctx context.Context, id SchemaObjectIdentifier) (*AlertDetails, error)
}

type AlterAccountOptions added in v0.66.0

type AlterAccountOptions struct {
	Set    *AccountSet    `ddl:"keyword" sql:"SET"`
	Unset  *AccountUnset  `ddl:"list,no_parentheses" sql:"UNSET"`
	Rename *AccountRename `ddl:"-"`
	Drop   *AccountDrop   `ddl:"-"`
	// contains filtered or unexported fields
}

type AlterAlertOptions added in v0.68.0

type AlterAlertOptions struct {
	IfExists *bool `ddl:"keyword" sql:"IF EXISTS"`

	// One of
	Action          *AlertAction `ddl:"keyword"`
	Set             *AlertSet    `ddl:"keyword" sql:"SET"`
	Unset           *AlertUnset  `ddl:"keyword" sql:"UNSET"`
	ModifyCondition *[]string    `ddl:"keyword,parentheses,no_comma" sql:"MODIFY CONDITION EXISTS"`
	ModifyAction    *string      `ddl:"parameter,no_equals" sql:"MODIFY ACTION"`
	// contains filtered or unexported fields
}

type AlterDatabaseFailoverOptions added in v0.66.0

type AlterDatabaseFailoverOptions struct {
	EnableFailover  *EnableFailover  `ddl:"keyword" sql:"ENABLE FAILOVER"`
	DisableFailover *DisableFailover `ddl:"keyword" sql:"DISABLE FAILOVER"`
	Primary         *bool            `ddl:"keyword" sql:"PRIMARY"`
	// contains filtered or unexported fields
}

type AlterDatabaseOptions added in v0.66.0

type AlterDatabaseOptions struct {
	IfExists *bool `ddl:"keyword" sql:"IF EXISTS"`

	NewName  AccountObjectIdentifier `ddl:"identifier" sql:"RENAME TO"`
	SwapWith AccountObjectIdentifier `ddl:"identifier" sql:"SWAP WITH"`
	Set      *DatabaseSet            `ddl:"list,no_parentheses" sql:"SET"`
	Unset    *DatabaseUnset          `ddl:"list,no_parentheses" sql:"UNSET"`
	// contains filtered or unexported fields
}

type AlterDatabaseReplicationOptions added in v0.66.0

type AlterDatabaseReplicationOptions struct {
	EnableReplication  *EnableReplication  `ddl:"keyword" sql:"ENABLE REPLICATION"`
	DisableReplication *DisableReplication `ddl:"keyword" sql:"DISABLE REPLICATION"`
	Refresh            *bool               `ddl:"keyword" sql:"REFRESH"`
	// contains filtered or unexported fields
}

type AlterFileFormatOptions added in v0.68.0

type AlterFileFormatOptions struct {
	IfExists *bool `ddl:"keyword" sql:"IF EXISTS"`

	Rename *AlterFileFormatRenameOptions
	Set    *FileFormatTypeOptions `ddl:"list,no_comma" sql:"SET"`
	// contains filtered or unexported fields
}

type AlterFileFormatRenameOptions added in v0.68.0

type AlterFileFormatRenameOptions struct {
	NewName SchemaObjectIdentifier `ddl:"identifier" sql:"RENAME TO"`
}

type AlterMaskingPolicyOptions added in v0.66.0

type AlterMaskingPolicyOptions struct {
	IfExists *bool `ddl:"keyword" sql:"IF EXISTS"`

	NewName SchemaObjectIdentifier `ddl:"identifier" sql:"RENAME TO"`
	Set     *MaskingPolicySet      `ddl:"keyword" sql:"SET"`
	Unset   *MaskingPolicyUnset    `ddl:"keyword" sql:"UNSET"`
	// contains filtered or unexported fields
}

type AlterPasswordPolicyOptions added in v0.66.0

type AlterPasswordPolicyOptions struct {
	IfExists *bool `ddl:"keyword" sql:"IF EXISTS"`

	NewName SchemaObjectIdentifier `ddl:"identifier" sql:"RENAME TO"`
	Set     *PasswordPolicySet     `ddl:"keyword" sql:"SET"`
	Unset   *PasswordPolicyUnset   `ddl:"keyword" sql:"UNSET"`
	// contains filtered or unexported fields
}

type AlterResourceMonitorOptions added in v0.66.0

type AlterResourceMonitorOptions struct{}

AlterResourceMonitorOptions contains options for altering a resource monitor.

type AlterSessionOptions added in v0.65.0

type AlterSessionOptions struct {
	Set   *SessionSet   `ddl:"keyword" sql:"SET"`
	Unset *SessionUnset `ddl:"keyword" sql:"UNSET"`
	// contains filtered or unexported fields
}

type AlterSessionPolicyOptions added in v0.66.0

type AlterSessionPolicyOptions struct{}

AlterSessionPolicyOptions contains options for altering a session policy.

type AlterShareOptions added in v0.66.0

type AlterShareOptions struct {
	IfExists *bool `ddl:"keyword" sql:"IF EXISTS"`

	Add    *ShareAdd    `ddl:"keyword" sql:"ADD"`
	Remove *ShareRemove `ddl:"keyword" sql:"REMOVE"`
	Set    *ShareSet    `ddl:"keyword" sql:"SET"`
	Unset  *ShareUnset  `ddl:"keyword" sql:"UNSET"`
	// contains filtered or unexported fields
}

type AlterSourceFailoverGroupOptions added in v0.66.0

type AlterSourceFailoverGroupOptions struct {
	IfExists *bool `ddl:"keyword" sql:"IF EXISTS"`

	NewName AccountObjectIdentifier `ddl:"identifier" sql:"RENAME TO"`
	Set     *FailoverGroupSet       `ddl:"keyword" sql:"SET"`
	Add     *FailoverGroupAdd       `ddl:"keyword" sql:"ADD"`
	Move    *FailoverGroupMove      `ddl:"keyword" sql:"MOVE"`
	Remove  *FailoverGroupRemove    `ddl:"keyword" sql:"REMOVE"`
	// contains filtered or unexported fields
}

type AlterTargetFailoverGroupOptions added in v0.66.0

type AlterTargetFailoverGroupOptions struct {
	IfExists *bool `ddl:"keyword" sql:"IF EXISTS"`

	Refresh *bool `ddl:"keyword" sql:"REFRESH"`
	Primary *bool `ddl:"keyword" sql:"PRIMARY"`
	Suspend *bool `ddl:"keyword" sql:"SUSPEND"`
	Resume  *bool `ddl:"keyword" sql:"RESUME"`
	// contains filtered or unexported fields
}

type AlterUserOptions added in v0.66.0

type AlterUserOptions struct{}

AlterUserOptions contains options for altering a user.

type AlterWarehouseOptions added in v0.66.0

type AlterWarehouseOptions struct {
	IfExists *bool `ddl:"keyword" sql:"IF EXISTS"`

	Suspend         *bool                   `ddl:"keyword" sql:"SUSPEND"`
	Resume          *bool                   `ddl:"keyword" sql:"RESUME"`
	IfSuspended     *bool                   `ddl:"keyword" sql:"IF SUSPENDED"`
	AbortAllQueries *bool                   `ddl:"keyword" sql:"ABORT ALL QUERIES"`
	NewName         AccountObjectIdentifier `ddl:"identifier" sql:"RENAME TO"`

	Set   *WarehouseSet   `ddl:"keyword" sql:"SET"`
	Unset *WarehouseUnset `ddl:"list,no_parentheses" sql:"UNSET"`
	// contains filtered or unexported fields
}

type AvroCompression added in v0.68.0

type AvroCompression string
var (
	AvroCompressionAuto       AvroCompression = "AUTO"
	AvroCompressionGzip       AvroCompression = "GZIP"
	AvroCompressionBrotli     AvroCompression = "BROTLI"
	AvroCompressionZstd       AvroCompression = "ZSTD"
	AvroCompressionDeflate    AvroCompression = "DEFLATE"
	AvroCompressionRawDeflate AvroCompression = "RAW_DEFLATE"
	AvroCompressionNone       AvroCompression = "NONE"
)

type BinaryFormat added in v0.68.0

type BinaryFormat string
var (
	BinaryFormatHex    BinaryFormat = "HEX"
	BinaryFormatBase64 BinaryFormat = "BASE64"
	BinaryFormatUTF8   BinaryFormat = "UTF8"
)

type BinaryInputFormat added in v0.65.0

type BinaryInputFormat string
const (
	BinaryInputFormatHex    BinaryInputFormat = "HEX"
	BinaryInputFormatBase64 BinaryInputFormat = "BASE64"
	BinaryInputFormatUTF8   BinaryInputFormat = "UTF8"
)

type CSVCompression added in v0.68.0

type CSVCompression string
var (
	CSVCompressionAuto       CSVCompression = "AUTO"
	CSVCompressionGzip       CSVCompression = "GZIP"
	CSVCompressionBz2        CSVCompression = "BZ2"
	CSVCompressionBrotli     CSVCompression = "BROTLI"
	CSVCompressionZstd       CSVCompression = "ZSTD"
	CSVCompressionDeflate    CSVCompression = "DEFLATE"
	CSVCompressionRawDeflate CSVCompression = "RAW_DEFLATE"
	CSVCompressionNone       CSVCompression = "NONE"
)

type CSVEncoding added in v0.68.0

type CSVEncoding string
var (
	CSVEncodingBIG5        CSVEncoding = "BIG5"
	CSVEncodingEUCJP       CSVEncoding = "EUCJP"
	CSVEncodingEUCKR       CSVEncoding = "EUCKR"
	CSVEncodingGB18030     CSVEncoding = "GB18030"
	CSVEncodingIBM420      CSVEncoding = "IBM420"
	CSVEncodingIBM424      CSVEncoding = "IBM424"
	CSVEncodingISO2022CN   CSVEncoding = "ISO2022CN"
	CSVEncodingISO2022JP   CSVEncoding = "ISO2022JP"
	CSVEncodingISO2022KR   CSVEncoding = "ISO2022KR"
	CSVEncodingISO88591    CSVEncoding = "ISO88591"
	CSVEncodingISO88592    CSVEncoding = "ISO88592"
	CSVEncodingISO88595    CSVEncoding = "ISO88595"
	CSVEncodingISO88596    CSVEncoding = "ISO88596"
	CSVEncodingISO88597    CSVEncoding = "ISO88597"
	CSVEncodingISO88598    CSVEncoding = "ISO88598"
	CSVEncodingISO88599    CSVEncoding = "ISO88599"
	CSVEncodingISO885915   CSVEncoding = "ISO885915"
	CSVEncodingKOI8R       CSVEncoding = "KOI8R"
	CSVEncodingSHIFTJIS    CSVEncoding = "SHIFTJIS"
	CSVEncodingUTF8        CSVEncoding = "UTF8"
	CSVEncodingUTF16       CSVEncoding = "UTF16"
	CSVEncodingUTF16BE     CSVEncoding = "UTF16BE"
	CSVEncodingUTF16LE     CSVEncoding = "UTF16LE"
	CSVEncodingUTF32       CSVEncoding = "UTF32"
	CSVEncodingUTF32BE     CSVEncoding = "UTF32BE"
	CSVEncodingUTF32LE     CSVEncoding = "UTF32LE"
	CSVEncodingWINDOWS1250 CSVEncoding = "WINDOWS1250"
	CSVEncodingWINDOWS1251 CSVEncoding = "WINDOWS1251"
	CSVEncodingWINDOWS1252 CSVEncoding = "WINDOWS1252"
	CSVEncodingWINDOWS1253 CSVEncoding = "WINDOWS1253"
	CSVEncodingWINDOWS1254 CSVEncoding = "WINDOWS1254"
	CSVEncodingWINDOWS1255 CSVEncoding = "WINDOWS1255"
	CSVEncodingWINDOWS1256 CSVEncoding = "WINDOWS1256"
)

type Client

type Client struct {

	// System-Defined Functions
	ContextFunctions     ContextFunctions
	ConversionFunctions  ConversionFunctions
	SystemFunctions      SystemFunctions
	ReplicationFunctions ReplicationFunctions

	// DDL Commands
	Accounts         Accounts
	Alerts           Alerts
	Comments         Comments
	Databases        Databases
	FailoverGroups   FailoverGroups
	FileFormats      FileFormats
	Grants           Grants
	MaskingPolicies  MaskingPolicies
	PasswordPolicies PasswordPolicies
	ResourceMonitors ResourceMonitors
	Roles            Roles
	SessionPolicies  SessionPolicies
	Sessions         Sessions
	Shares           Shares
	Warehouses       Warehouses
	// contains filtered or unexported fields
}

func NewClient

func NewClient(cfg *gosnowflake.Config) (*Client, error)

func NewClientFromDB

func NewClientFromDB(db *sql.DB) *Client

func NewDefaultClient

func NewDefaultClient() (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) Ping

func (c *Client) Ping() error

type Clone added in v0.66.0

type Clone struct {
	SourceObject ObjectIdentifier `ddl:"identifier" sql:"CLONE"`
	At           *TimeTravel      `ddl:"list,parentheses,no_comma" sql:"AT"`
	Before       *TimeTravel      `ddl:"list,parentheses,no_comma" sql:"BEFORE"`
}

type CloudType added in v0.65.0

type CloudType string
const (
	CloudTypeAWS   CloudType = "aws"
	CloudTypeAzure CloudType = "azure"
	CloudTypeGCP   CloudType = "gcp"
)

type Comments added in v0.65.0

type Comments interface {
	Set(ctx context.Context, opts *SetCommentOptions) error
	SetColumn(ctx context.Context, opts *SetColumnCommentOptions) error
}

type ContextFunctions

type ContextFunctions interface {
	// Session functions.
	CurrentAccount(ctx context.Context) (string, error)
	CurrentRole(ctx context.Context) (string, error)
	CurrentRegion(ctx context.Context) (string, error)
	CurrentSession(ctx context.Context) (string, error)
	CurrentUser(ctx context.Context) (string, error)

	// Session Object functions.
	CurrentDatabase(ctx context.Context) (string, error)
	CurrentSchema(ctx context.Context) (string, error)
	CurrentWarehouse(ctx context.Context) (string, error)
	IsRoleInSession(ctx context.Context, role AccountObjectIdentifier) (bool, error)
}

type ConversionFunctions added in v0.66.0

type ConversionFunctions interface {
	ToTimestampLTZ(ctx context.Context, t time.Time) (time.Time, error)
	ToTimestampNTZ(ctx context.Context, t time.Time) (time.Time, error)
}

type CreateAccountOptions added in v0.66.0

type CreateAccountOptions struct {

	// Object properties
	AdminName          string         `ddl:"parameter,single_quotes" sql:"ADMIN_NAME"`
	AdminPassword      *string        `ddl:"parameter,single_quotes" sql:"ADMIN_PASSWORD"`
	AdminRSAPublicKey  *string        `ddl:"parameter,single_quotes" sql:"ADMIN_RSA_PUBLIC_KEY"`
	FirstName          *string        `ddl:"parameter,single_quotes" sql:"FIRST_NAME"`
	LastName           *string        `ddl:"parameter,single_quotes" sql:"LAST_NAME"`
	Email              string         `ddl:"parameter,single_quotes" sql:"EMAIL"`
	MustChangePassword *bool          `ddl:"parameter" sql:"MUST_CHANGE_PASSWORD"`
	Edition            AccountEdition `ddl:"parameter" sql:"EDITION"`
	RegionGroup        *string        `ddl:"parameter,single_quotes" sql:"REGION_GROUP"`
	Region             *string        `ddl:"parameter,single_quotes" sql:"REGION"`
	Comment            *string        `ddl:"parameter,single_quotes" sql:"COMMENT"`
	// contains filtered or unexported fields
}

type CreateAlertOptions added in v0.68.0

type CreateAlertOptions struct {
	OrReplace *bool `ddl:"keyword" sql:"OR REPLACE"`

	IfNotExists *bool `ddl:"keyword" sql:"IF NOT EXISTS"`

	// optional
	Comment *string `ddl:"parameter,single_quotes" sql:"COMMENT"`
	// contains filtered or unexported fields
}

type CreateDatabaseOptions added in v0.66.0

type CreateDatabaseOptions struct {
	OrReplace *bool `ddl:"keyword" sql:"OR REPLACE"`
	Transient *bool `ddl:"keyword" sql:"TRANSIENT"`

	IfNotExists                *bool            `ddl:"keyword" sql:"IF NOT EXISTS"`
	Clone                      *Clone           `ddl:"-"`
	DataRetentionTimeInDays    *int             `ddl:"parameter" sql:"DATA_RETENTION_TIME_IN_DAYS"`
	MaxDataExtensionTimeInDays *int             `ddl:"parameter" sql:"MAX_DATA_EXTENSION_TIME_IN_DAYS"`
	Comment                    *string          `ddl:"parameter,single_quotes" sql:"COMMENT"`
	Tag                        []TagAssociation `ddl:"keyword,parentheses" sql:"TAG"`
	// contains filtered or unexported fields
}

type CreateFailoverGroupOptions added in v0.66.0

type CreateFailoverGroupOptions struct {
	IfNotExists *bool `ddl:"keyword" sql:"IF NOT EXISTS"`

	AllowedDatabases        []AccountObjectIdentifier `ddl:"parameter" sql:"ALLOWED_DATABASES"`
	AllowedShares           []AccountObjectIdentifier `ddl:"parameter" sql:"ALLOWED_SHARES"`
	AllowedIntegrationTypes []IntegrationType         `ddl:"parameter" sql:"ALLOWED_INTEGRATION_TYPES"`

	IgnoreEditionCheck  *bool   `ddl:"keyword" sql:"IGNORE EDITION CHECK"`
	ReplicationSchedule *string `ddl:"parameter,single_quotes" sql:"REPLICATION_SCHEDULE"`
	// contains filtered or unexported fields
}

type CreateFileFormatOptions added in v0.68.0

type CreateFileFormatOptions struct {
	OrReplace *bool `ddl:"keyword" sql:"OR REPLACE"`
	Temporary *bool `ddl:"keyword" sql:"TEMPORARY"`

	IfNotExists *bool `ddl:"keyword" sql:"IF NOT EXISTS"`

	Type FileFormatType `ddl:"parameter" sql:"TYPE"`

	FileFormatTypeOptions
	// contains filtered or unexported fields
}

type CreateMaskingPolicyOptions added in v0.66.0

type CreateMaskingPolicyOptions struct {
	OrReplace *bool `ddl:"keyword" sql:"OR REPLACE"`

	IfNotExists *bool `ddl:"keyword" sql:"IF NOT EXISTS"`

	// optional
	Comment             *string `ddl:"parameter,single_quotes" sql:"COMMENT"`
	ExemptOtherPolicies *bool   `ddl:"parameter" sql:"EXEMPT_OTHER_POLICIES"`
	// contains filtered or unexported fields
}

type CreatePasswordPolicyOptions added in v0.66.0

type CreatePasswordPolicyOptions struct {
	OrReplace *bool `ddl:"keyword" sql:"OR REPLACE"`

	IfNotExists *bool `ddl:"keyword" sql:"IF NOT EXISTS"`

	PasswordMinLength         *int `ddl:"parameter" sql:"PASSWORD_MIN_LENGTH"`
	PasswordMaxLength         *int `ddl:"parameter" sql:"PASSWORD_MAX_LENGTH"`
	PasswordMinUpperCaseChars *int `ddl:"parameter" sql:"PASSWORD_MIN_UPPER_CASE_CHARS"`
	PasswordMinLowerCaseChars *int `ddl:"parameter" sql:"PASSWORD_MIN_LOWER_CASE_CHARS"`
	PasswordMinNumericChars   *int `ddl:"parameter" sql:"PASSWORD_MIN_NUMERIC_CHARS"`
	PasswordMinSpecialChars   *int `ddl:"parameter" sql:"PASSWORD_MIN_SPECIAL_CHARS"`
	PasswordMaxAgeDays        *int `ddl:"parameter" sql:"PASSWORD_MAX_AGE_DAYS"`
	PasswordMaxRetries        *int `ddl:"parameter" sql:"PASSWORD_MAX_RETRIES"`
	PasswordLockoutTimeMins   *int `ddl:"parameter" sql:"PASSWORD_LOCKOUT_TIME_MINS"`

	Comment *string `ddl:"parameter,single_quotes" sql:"COMMENT"`
	// contains filtered or unexported fields
}

type CreateResourceMonitorOptions added in v0.66.0

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

CreateResourceMonitorOptions contains options for creating a resource monitor.

type CreateSecondaryDatabaseOptions added in v0.66.0

type CreateSecondaryDatabaseOptions struct {
	DataRetentionTimeInDays *int `ddl:"parameter" sql:"DATA_RETENTION_TIME_IN_DAYS"`
	// contains filtered or unexported fields
}

type CreateSecondaryReplicationGroupOptions added in v0.66.0

type CreateSecondaryReplicationGroupOptions struct {
	IfNotExists *bool `ddl:"keyword" sql:"IF NOT EXISTS"`
	// contains filtered or unexported fields
}

type CreateSessionPolicyOptions added in v0.66.0

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

CreateSessionPolicyOptions contains options for creating a session policy.

type CreateShareOptions added in v0.66.0

type CreateShareOptions struct {
	OrReplace *bool `ddl:"keyword" sql:"OR REPLACE"`

	Comment *string `ddl:"parameter,single_quotes" sql:"COMMENT"`
	// contains filtered or unexported fields
}

type CreateSharedDatabaseOptions added in v0.66.0

type CreateSharedDatabaseOptions struct {
	Comment *string `ddl:"parameter,single_quotes" sql:"COMMENT"`
	// contains filtered or unexported fields
}

type CreateUserOptions added in v0.66.0

type CreateUserOptions struct{}

CreateUserOptions contains options for creating a user.

type CreateWarehouseOptions added in v0.66.0

type CreateWarehouseOptions struct {
	OrReplace *bool `ddl:"keyword" sql:"OR REPLACE"`

	IfNotExists *bool `ddl:"keyword" sql:"IF NOT EXISTS"`

	// Object properties
	WarehouseType                   *WarehouseType `ddl:"parameter,single_quotes" sql:"WAREHOUSE_TYPE"`
	WarehouseSize                   *WarehouseSize `ddl:"parameter,single_quotes" sql:"WAREHOUSE_SIZE"`
	MaxClusterCount                 *int           `ddl:"parameter" sql:"MAX_CLUSTER_COUNT"`
	MinClusterCount                 *int           `ddl:"parameter" sql:"MIN_CLUSTER_COUNT"`
	ScalingPolicy                   *ScalingPolicy `ddl:"parameter,single_quotes" sql:"SCALING_POLICY"`
	AutoSuspend                     *int           `ddl:"parameter" sql:"AUTO_SUSPEND"`
	AutoResume                      *bool          `ddl:"parameter" sql:"AUTO_RESUME"`
	InitiallySuspended              *bool          `ddl:"parameter" sql:"INITIALLY_SUSPENDED"`
	ResourceMonitor                 *string        `ddl:"parameter,double_quotes" sql:"RESOURCE_MONITOR"`
	Comment                         *string        `ddl:"parameter,single_quotes" sql:"COMMENT"`
	EnableQueryAcceleration         *bool          `ddl:"parameter" sql:"ENABLE_QUERY_ACCELERATION"`
	QueryAccelerationMaxScaleFactor *int           `ddl:"parameter" sql:"QUERY_ACCELERATION_MAX_SCALE_FACTOR"`

	// Object params
	MaxConcurrencyLevel             *int             `ddl:"parameter" sql:"MAX_CONCURRENCY_LEVEL"`
	StatementQueuedTimeoutInSeconds *int             `ddl:"parameter" sql:"STATEMENT_QUEUED_TIMEOUT_IN_SECONDS"`
	StatementTimeoutInSeconds       *int             `ddl:"parameter" sql:"STATEMENT_TIMEOUT_IN_SECONDS"`
	Tag                             []TagAssociation `ddl:"keyword,parentheses" sql:"TAG"`
	// contains filtered or unexported fields
}

type DataType

type DataType string
const (
	DataTypeNumber       DataType = "NUMBER"
	DataTypeFloat        DataType = "FLOAT"
	DataTypeVARCHAR      DataType = "VARCHAR"
	DataTypeBinary       DataType = "BINARY"
	DataTypeBoolean      DataType = "BOOLEAN"
	DataTypeDate         DataType = "DATE"
	DataTypeTime         DataType = "TIME"
	DataTypeTimestampLTZ DataType = "TIMESTAMP_LTZ"
	DataTypeTimestampNTZ DataType = "TIMESTAMP_NTZ"
	DataTypeTimestampTZ  DataType = "TIMESTAMP_TZ"
	DataTypeVariant      DataType = "VARIANT"
	DataTypeObject       DataType = "OBJECT"
	DataTypeArray        DataType = "ARRAY"
	DataTypeGeography    DataType = "GEOGRAPHY"
	DataTypeGeometry     DataType = "GEOMETRY"
)

func ToDataType added in v0.66.2

func ToDataType(s string) (DataType, error)

type Database

type Database struct {
	CreatedOn     time.Time
	Name          string
	IsDefault     bool
	IsCurrent     bool
	Origin        string
	Owner         string
	Comment       string
	Options       string
	RetentionTime int
	ResourceGroup string
	DroppedOn     time.Time
	Transient     bool
	Kind          string
}

func (*Database) ID

func (*Database) ObjectType added in v0.65.0

func (v *Database) ObjectType() ObjectType

type DatabaseDetails added in v0.65.0

type DatabaseDetails struct {
	Rows []DatabaseDetailsRow
}

type DatabaseDetailsRow added in v0.66.0

type DatabaseDetailsRow struct {
	CreatedOn time.Time
	Name      string
	Kind      string
}

type DatabaseSet added in v0.66.0

type DatabaseSet struct {
	DataRetentionTimeInDays    *int    `ddl:"parameter" sql:"DATA_RETENTION_TIME_IN_DAYS"`
	MaxDataExtensionTimeInDays *int    `ddl:"parameter" sql:"MAX_DATA_EXTENSION_TIME_IN_DAYS"`
	DefaultDDLCollation        *string `ddl:"parameter,single_quotes" sql:"DEFAULT_DDL_COLLATION"`
	Comment                    *string `ddl:"parameter,single_quotes" sql:"COMMENT"`
}

type DatabaseUnset added in v0.66.0

type DatabaseUnset struct {
	DataRetentionTimeInDays    *bool              `ddl:"keyword" sql:"DATA_RETENTION_TIME_IN_DAYS"`
	MaxDataExtensionTimeInDays *bool              `ddl:"keyword" sql:"MAX_DATA_EXTENSION_TIME_IN_DAYS"`
	DefaultDDLCollation        *bool              `ddl:"keyword" sql:"DEFAULT_DDL_COLLATION"`
	Comment                    *bool              `ddl:"keyword" sql:"COMMENT"`
	Tag                        []ObjectIdentifier `ddl:"keyword" sql:"TAG"`
}

type Databases added in v0.65.0

type Databases interface {
	// Create creates a database.
	Create(ctx context.Context, id AccountObjectIdentifier, opts *CreateDatabaseOptions) error
	// CreateShared creates a database from a shared database.
	CreateShared(ctx context.Context, id AccountObjectIdentifier, shareID ExternalObjectIdentifier, opts *CreateSharedDatabaseOptions) error
	// CreateSecondary creates a secondary database.
	CreateSecondary(ctx context.Context, id AccountObjectIdentifier, primaryID ExternalObjectIdentifier, opts *CreateSecondaryDatabaseOptions) error
	// Alter modifies an existing database
	Alter(ctx context.Context, id AccountObjectIdentifier, opts *AlterDatabaseOptions) error
	// AlterReplication modifies an existing database replica
	AlterReplication(ctx context.Context, id AccountObjectIdentifier, opts *AlterDatabaseReplicationOptions) error
	// AlterFailover modifies an existing database failover group
	AlterFailover(ctx context.Context, id AccountObjectIdentifier, opts *AlterDatabaseFailoverOptions) error
	// Drop removes a database.
	Drop(ctx context.Context, id AccountObjectIdentifier, opts *DropDatabaseOptions) error
	// Undrop restores the most recent version of a dropped database
	Undrop(ctx context.Context, id AccountObjectIdentifier) error
	// Show returns a list of databases.
	Show(ctx context.Context, opts *ShowDatabasesOptions) ([]*Database, error)
	// ShowByID returns a database by ID
	ShowByID(ctx context.Context, id AccountObjectIdentifier) (*Database, error)
	// Describe returns the details of a database.
	Describe(ctx context.Context, id AccountObjectIdentifier) (*DatabaseDetails, error)
	// Use sets the active database for the current session.
	Use(ctx context.Context, id AccountObjectIdentifier) error
}

type DisableFailover added in v0.66.0

type DisableFailover struct {
	ToAccounts []AccountIdentifier `ddl:"keyword,no_parentheses" sql:"TO ACCOUNTS"`
}

type DisableReplication added in v0.66.0

type DisableReplication struct {
	ToAccounts []AccountIdentifier `ddl:"keyword,no_parentheses" sql:"TO ACCOUNTS"`
}

type DropDatabaseOptions added in v0.66.0

type DropDatabaseOptions struct {
	IfExists *bool `ddl:"keyword" sql:"IF EXISTS"`
	// contains filtered or unexported fields
}

type DropFailoverGroupOptions added in v0.66.0

type DropFailoverGroupOptions struct {
	IfExists *bool `ddl:"keyword" sql:"IF EXISTS"`
	// contains filtered or unexported fields
}

type DropFileFormatOptions added in v0.68.0

type DropFileFormatOptions struct {
	IfExists *bool `ddl:"keyword" sql:"IF EXISTS"`
	// contains filtered or unexported fields
}

type DropMaskingPolicyOptions added in v0.66.0

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

type DropPasswordPolicyOptions added in v0.66.0

type DropPasswordPolicyOptions struct {
	IfExists *bool `ddl:"keyword" sql:"IF EXISTS"`
	// contains filtered or unexported fields
}

type DropSessionPolicyOptions added in v0.66.0

type DropSessionPolicyOptions struct {
	IfExists *bool `ddl:"keyword" sql:"IF EXISTS"`
	// contains filtered or unexported fields
}

DropSessionPolicyOptions contains options for dropping a session policy.

type DropUserOptions added in v0.66.0

type DropUserOptions struct{}

DropUserOptions contains options for dropping a user.

type DropWarehouseOptions added in v0.66.0

type DropWarehouseOptions struct {
	IfExists *bool `ddl:"keyword" sql:"IF EXISTS"`
	// contains filtered or unexported fields
}

type EnableFailover added in v0.66.0

type EnableFailover struct {
	ToAccounts []AccountIdentifier `ddl:"keyword,no_parentheses" sql:"TO ACCOUNTS"`
}

type EnableReplication added in v0.66.0

type EnableReplication struct {
	ToAccounts         []AccountIdentifier `ddl:"keyword,no_parentheses" sql:"TO ACCOUNTS"`
	IgnoreEditionCheck *bool               `ddl:"keyword" sql:"IGNORE EDITION CHECK"`
}

type ExternalObjectIdentifier added in v0.65.0

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

for objects that live in other accounts

func NewExternalObjectIdentifier added in v0.65.0

func NewExternalObjectIdentifier(accountIdentifier AccountIdentifier, objectIdentifier ObjectIdentifier) ExternalObjectIdentifier

func NewExternalObjectIdentifierFromFullyQualifiedName added in v0.65.0

func NewExternalObjectIdentifierFromFullyQualifiedName(fullyQualifiedName string) ExternalObjectIdentifier

func (ExternalObjectIdentifier) FullyQualifiedName added in v0.65.0

func (i ExternalObjectIdentifier) FullyQualifiedName() string

func (ExternalObjectIdentifier) Name added in v0.65.0

type FailoverGroup added in v0.65.0

type FailoverGroup struct {
	RegionGroup             string
	SnowflakeRegion         string
	CreatedOn               time.Time
	AccountName             string
	Name                    string
	Type                    string
	Comment                 string
	IsPrimary               bool
	Primary                 ExternalObjectIdentifier
	ObjectTypes             []PluralObjectType
	AllowedIntegrationTypes []IntegrationType
	AllowedAccounts         []AccountIdentifier
	OrganizationName        string
	AccountLocator          string
	ReplicationSchedule     string
	SecondaryState          FailoverGroupSecondaryState
	NextScheduledRefresh    string
	Owner                   string
}

FailoverGroups is a user friendly result for a CREATE FAILOVER GROUP query.

func (*FailoverGroup) ExternalID added in v0.65.0

func (v *FailoverGroup) ExternalID() ExternalObjectIdentifier

func (*FailoverGroup) ID added in v0.65.0

func (*FailoverGroup) ObjectType added in v0.65.0

func (v *FailoverGroup) ObjectType() ObjectType

type FailoverGroupAdd added in v0.65.0

type FailoverGroupAdd struct {
	AllowedDatabases   []AccountObjectIdentifier `ddl:"parameter,reverse" sql:"TO ALLOWED_DATABASES"`
	AllowedShares      []AccountObjectIdentifier `ddl:"parameter,reverse" sql:"TO ALLOWED_SHARES"`
	AllowedAccounts    []AccountIdentifier       `ddl:"parameter,reverse" sql:"TO ALLOWED_ACCOUNTS"`
	IgnoreEditionCheck *bool                     `ddl:"keyword" sql:"IGNORE_EDITION_CHECK"`
}

type FailoverGroupMove added in v0.65.0

type FailoverGroupMove struct {
	Databases []AccountObjectIdentifier `ddl:"parameter,no_equals" sql:"DATABASES"`
	Shares    []AccountObjectIdentifier `ddl:"parameter,no_equals" sql:"SHARES"`
	To        AccountObjectIdentifier   `ddl:"identifier" sql:"TO FAILOVER GROUP"`
}

type FailoverGroupRemove added in v0.65.0

type FailoverGroupRemove struct {
	AllowedDatabases []AccountObjectIdentifier `ddl:"parameter,reverse" sql:"FROM ALLOWED_DATABASES"`
	AllowedShares    []AccountObjectIdentifier `ddl:"parameter,reverse" sql:"FROM ALLOWED_SHARES"`
	AllowedAccounts  []AccountIdentifier       `ddl:"parameter,reverse" sql:"FROM ALLOWED_ACCOUNTS"`
}

type FailoverGroupSecondaryState added in v0.65.0

type FailoverGroupSecondaryState string
const (
	FailoverGroupSecondaryStateSuspended FailoverGroupSecondaryState = "SUSPENDED"
	FailoverGroupSecondaryStateStarted   FailoverGroupSecondaryState = "STARTED"
	FailoverGroupSecondaryStateNull      FailoverGroupSecondaryState = "NULL"
)

type FailoverGroupSet added in v0.65.0

type FailoverGroupSet struct {
	ObjectTypes             []PluralObjectType `ddl:"parameter" sql:"OBJECT_TYPES"`
	ReplicationSchedule     *string            `ddl:"parameter,single_quotes" sql:"REPLICATION_SCHEDULE"`
	AllowedIntegrationTypes []IntegrationType  `ddl:"parameter" sql:"ALLOWED_INTEGRATION_TYPES"`
}

type FailoverGroups added in v0.65.0

type FailoverGroups interface {
	// Create creates a new failover group.
	Create(ctx context.Context, id AccountObjectIdentifier, objectTypes []PluralObjectType, allowedAccounts []AccountIdentifier, opts *CreateFailoverGroupOptions) error
	// CreateSecondaryReplicationGroup creates a new secondary replication group.
	CreateSecondaryReplicationGroup(ctx context.Context, id AccountObjectIdentifier, primaryFailoverGroupID ExternalObjectIdentifier, opts *CreateSecondaryReplicationGroupOptions) error
	// Alter modifies an existing failover group in a source acount.
	AlterSource(ctx context.Context, id AccountObjectIdentifier, opts *AlterSourceFailoverGroupOptions) error
	// AlterTarget modifies an existing failover group in a target acount.
	AlterTarget(ctx context.Context, id AccountObjectIdentifier, opts *AlterTargetFailoverGroupOptions) error
	// Drop removes a failover group.
	Drop(ctx context.Context, id AccountObjectIdentifier, opts *DropFailoverGroupOptions) error
	// Show returns a list of failover groups.
	Show(ctx context.Context, opts *ShowFailoverGroupOptions) ([]*FailoverGroup, error)
	// ShowByID returns a failover group by ID
	ShowByID(ctx context.Context, id AccountObjectIdentifier) (*FailoverGroup, error)
	// ShowDatabases returns a list of databases in a failover group.
	ShowDatabases(ctx context.Context, id AccountObjectIdentifier) ([]AccountObjectIdentifier, error)
	// ShowShares returns a list of shares in a failover group.
	ShowShares(ctx context.Context, id AccountObjectIdentifier) ([]AccountObjectIdentifier, error)
}

FailoverGroups describes all the failover group related methods that the Snowflake API supports.

type FileFormat added in v0.68.0

type FileFormat struct {
	Name          SchemaObjectIdentifier
	CreatedOn     time.Time
	Type          FileFormatType
	Owner         string
	Comment       string
	OwnerRoleType string
	Options       FileFormatTypeOptions
}

func (*FileFormat) ID added in v0.68.0

func (*FileFormat) ObjectType added in v0.68.0

func (v *FileFormat) ObjectType() ObjectType

type FileFormatDetails added in v0.68.0

type FileFormatDetails struct {
	Type    FileFormatType
	Options FileFormatTypeOptions
}

type FileFormatDetailsRow added in v0.68.0

type FileFormatDetailsRow struct {
	Property         string
	Property_Type    string
	Property_Value   string
	Property_Default string
}

type FileFormatRow added in v0.68.0

type FileFormatRow struct {
	FormatOptions string    `db:"format_options"`
	CreatedOn     time.Time `db:"created_on"`
	Name          string    `db:"name"`
	DatabaseName  string    `db:"database_name"`
	SchemaName    string    `db:"schema_name"`
	FormatType    string    `db:"type"`
	Owner         string    `db:"owner"`
	Comment       string    `db:"comment"`
	OwnerRoleType string    `db:"owner_role_type"`
}

type FileFormatType added in v0.68.0

type FileFormatType string
const (
	FileFormatTypeCSV     FileFormatType = "CSV"
	FileFormatTypeJSON    FileFormatType = "JSON"
	FileFormatTypeAvro    FileFormatType = "AVRO"
	FileFormatTypeORC     FileFormatType = "ORC"
	FileFormatTypeParquet FileFormatType = "PARQUET"
	FileFormatTypeXML     FileFormatType = "XML"
)

type FileFormatTypeOptions added in v0.68.0

type FileFormatTypeOptions struct {
	// CSV type options
	CSVCompression                *CSVCompression `ddl:"parameter" sql:"COMPRESSION"`
	CSVRecordDelimiter            *string         `ddl:"parameter,single_quotes" sql:"RECORD_DELIMITER"`
	CSVFieldDelimiter             *string         `ddl:"parameter,single_quotes" sql:"FIELD_DELIMITER"`
	CSVFileExtension              *string         `ddl:"parameter,single_quotes" sql:"FILE_EXTENSION"`
	CSVParseHeader                *bool           `ddl:"parameter" sql:"PARSE_HEADER"`
	CSVSkipHeader                 *int            `ddl:"parameter" sql:"SKIP_HEADER"`
	CSVSkipBlankLines             *bool           `ddl:"parameter" sql:"SKIP_BLANK_LINES"`
	CSVDateFormat                 *string         `ddl:"parameter,single_quotes" sql:"DATE_FORMAT"`
	CSVTimeFormat                 *string         `ddl:"parameter,single_quotes" sql:"TIME_FORMAT"`
	CSVTimestampFormat            *string         `ddl:"parameter,single_quotes" sql:"TIMESTAMP_FORMAT"`
	CSVBinaryFormat               *BinaryFormat   `ddl:"parameter" sql:"BINARY_FORMAT"`
	CSVEscape                     *string         `ddl:"parameter,single_quotes" sql:"ESCAPE"`
	CSVEscapeUnenclosedField      *string         `ddl:"parameter,single_quotes" sql:"ESCAPE_UNENCLOSED_FIELD"`
	CSVTrimSpace                  *bool           `ddl:"parameter" sql:"TRIM_SPACE"`
	CSVFieldOptionallyEnclosedBy  *string         `ddl:"parameter,single_quotes" sql:"FIELD_OPTIONALLY_ENCLOSED_BY"`
	CSVNullIf                     *[]NullString   `ddl:"parameter,parentheses" sql:"NULL_IF"`
	CSVErrorOnColumnCountMismatch *bool           `ddl:"parameter" sql:"ERROR_ON_COLUMN_COUNT_MISMATCH"`
	CSVReplaceInvalidCharacters   *bool           `ddl:"parameter" sql:"REPLACE_INVALID_CHARACTERS"`
	CSVEmptyFieldAsNull           *bool           `ddl:"parameter" sql:"EMPTY_FIELD_AS_NULL"`
	CSVSkipByteOrderMark          *bool           `ddl:"parameter" sql:"SKIP_BYTE_ORDER_MARK"`
	CSVEncoding                   *CSVEncoding    `ddl:"parameter,single_quotes" sql:"ENCODING"`

	// JSON type options
	JSONCompression              *JSONCompression `ddl:"parameter" sql:"COMPRESSION"`
	JSONDateFormat               *string          `ddl:"parameter,single_quotes" sql:"DATE_FORMAT"`
	JSONTimeFormat               *string          `ddl:"parameter,single_quotes" sql:"TIME_FORMAT"`
	JSONTimestampFormat          *string          `ddl:"parameter,single_quotes" sql:"TIMESTAMP_FORMAT"`
	JSONBinaryFormat             *BinaryFormat    `ddl:"parameter" sql:"BINARY_FORMAT"`
	JSONTrimSpace                *bool            `ddl:"parameter" sql:"TRIM_SPACE"`
	JSONNullIf                   *[]NullString    `ddl:"parameter,parentheses" sql:"NULL_IF"`
	JSONFileExtension            *string          `ddl:"parameter,single_quotes" sql:"FILE_EXTENSION"`
	JSONEnableOctal              *bool            `ddl:"parameter" sql:"ENABLE_OCTAL"`
	JSONAllowDuplicate           *bool            `ddl:"parameter" sql:"ALLOW_DUPLICATE"`
	JSONStripOuterArray          *bool            `ddl:"parameter" sql:"STRIP_OUTER_ARRAY"`
	JSONStripNullValues          *bool            `ddl:"parameter" sql:"STRIP_NULL_VALUES"`
	JSONReplaceInvalidCharacters *bool            `ddl:"parameter" sql:"REPLACE_INVALID_CHARACTERS"`
	JSONIgnoreUTF8Errors         *bool            `ddl:"parameter" sql:"IGNORE_UTF8_ERRORS"`
	JSONSkipByteOrderMark        *bool            `ddl:"parameter" sql:"SKIP_BYTE_ORDER_MARK"`

	// AVRO type options
	AvroCompression              *AvroCompression `ddl:"parameter" sql:"COMPRESSION"`
	AvroTrimSpace                *bool            `ddl:"parameter" sql:"TRIM_SPACE"`
	AvroReplaceInvalidCharacters *bool            `ddl:"parameter" sql:"REPLACE_INVALID_CHARACTERS"`
	AvroNullIf                   *[]NullString    `ddl:"parameter,parentheses" sql:"NULL_IF"`

	// ORC type options
	ORCTrimSpace                *bool         `ddl:"parameter" sql:"TRIM_SPACE"`
	ORCReplaceInvalidCharacters *bool         `ddl:"parameter" sql:"REPLACE_INVALID_CHARACTERS"`
	ORCNullIf                   *[]NullString `ddl:"parameter,parentheses" sql:"NULL_IF"`

	// PARQUET type options
	ParquetCompression              *ParquetCompression `ddl:"parameter" sql:"COMPRESSION"`
	ParquetSnappyCompression        *bool               `ddl:"parameter" sql:"SNAPPY_COMPRESSION"`
	ParquetBinaryAsText             *bool               `ddl:"parameter" sql:"BINARY_AS_TEXT"`
	ParquetTrimSpace                *bool               `ddl:"parameter" sql:"TRIM_SPACE"`
	ParquetReplaceInvalidCharacters *bool               `ddl:"parameter" sql:"REPLACE_INVALID_CHARACTERS"`
	ParquetNullIf                   *[]NullString       `ddl:"parameter,parentheses" sql:"NULL_IF"`

	// XML type options
	XMLCompression              *XMLCompression `ddl:"parameter" sql:"COMPRESSION"`
	XMLIgnoreUTF8Errors         *bool           `ddl:"parameter" sql:"IGNORE_UTF8_ERRORS"`
	XMLPreserveSpace            *bool           `ddl:"parameter" sql:"PRESERVE_SPACE"`
	XMLStripOuterElement        *bool           `ddl:"parameter" sql:"STRIP_OUTER_ELEMENT"`
	XMLDisableSnowflakeData     *bool           `ddl:"parameter" sql:"DISABLE_SNOWFLAKE_DATA"`
	XMLDisableAutoConvert       *bool           `ddl:"parameter" sql:"DISABLE_AUTO_CONVERT"`
	XMLReplaceInvalidCharacters *bool           `ddl:"parameter" sql:"REPLACE_INVALID_CHARACTERS"`
	XMLSkipByteOrderMark        *bool           `ddl:"parameter" sql:"SKIP_BYTE_ORDER_MARK"`

	Comment *string `ddl:"parameter,single_quotes" sql:"COMMENT"`
}

type FileFormats added in v0.68.0

type FileFormats interface {
	// Create creates a FileFormat.
	Create(ctx context.Context, id SchemaObjectIdentifier, opts *CreateFileFormatOptions) error
	// Alter modifies an existing FileFormat
	Alter(ctx context.Context, id SchemaObjectIdentifier, opts *AlterFileFormatOptions) error
	// Drop removes a FileFormat.
	Drop(ctx context.Context, id SchemaObjectIdentifier, opts *DropFileFormatOptions) error
	// Show returns a list of fileFormats.
	Show(ctx context.Context, opts *ShowFileFormatsOptions) ([]*FileFormat, error)
	// ShowByID returns a FileFormat by ID
	ShowByID(ctx context.Context, id SchemaObjectIdentifier) (*FileFormat, error)
	// Describe returns the details of a FileFormat.
	Describe(ctx context.Context, id SchemaObjectIdentifier) (*FileFormatDetails, error)
}

type GeographyOutputFormat added in v0.65.0

type GeographyOutputFormat string
const (
	GeographyOutputFormatGeoJSON GeographyOutputFormat = "GeoJSON"
	GeographyOutputFormatWKT     GeographyOutputFormat = "WKT"
	GeographyOutputFormatWKB     GeographyOutputFormat = "WKB"
	GeographyOutputFormatEWKT    GeographyOutputFormat = "EWKT"
)

type GlobalPrivilege added in v0.68.0

type GlobalPrivilege string
const (
	// CREATE {
	//	ACCOUNT | DATA EXCHANGE LISTING | DATABASE | FAILOVER GROUP | INTEGRATION
	//	| NETWORK POLICY | REPLICATION GROUP | ROLE | SHARE | USER | WAREHOUSE
	// }
	GlobalPrivilegeCreateAccount             GlobalPrivilege = "CREATE ACCOUNT"
	GlobalPrivilegeCreateDataExchangeListing GlobalPrivilege = "CREATE DATA EXCHANGE LISTING"
	GlobalPrivilegeCreateDatabase            GlobalPrivilege = "CREATE DATABASE"
	GlobalPrivilegeCreateFailoverGroup       GlobalPrivilege = "CREATE FAILOVER GROUP"
	GlobalPrivilegeCreateIntegration         GlobalPrivilege = "CREATE INTEGRATION"
	GlobalPrivilegeCreateNetworkPolicy       GlobalPrivilege = "CREATE NETWORK POLICY"
	GlobalPrivilegeCreateReplicationGroup    GlobalPrivilege = "CREATE REPLICATION GROUP"
	GlobalPrivilegeCreateRole                GlobalPrivilege = "CREATE ROLE"
	GlobalPrivilegeCreateShare               GlobalPrivilege = "CREATE SHARE"
	GlobalPrivilegeCreateUser                GlobalPrivilege = "CREATE USER"
	GlobalPrivilegeCreateWarehouse           GlobalPrivilege = "CREATE WAREHOUSE"

	// | APPLY { { MASKING | PASSWORD | ROW ACCESS | SESSION } POLICY | TAG }
	GlobalPrivilegeApplyMaskingPolicy   GlobalPrivilege = "APPLY MASKING POLICY"
	GlobalPrivilegeApplyPasswordPolicy  GlobalPrivilege = "APPLY PASSWORD POLICY"
	GlobalPrivilegeApplyRowAccessPolicy GlobalPrivilege = "APPLY ROW ACCESS POLICY"
	GlobalPrivilegeApplySessionPolicy   GlobalPrivilege = "APPLY SESSION POLICY"
	GlobalPrivilegeApplyTag             GlobalPrivilege = "APPLY TAG"

	// | ATTACH POLICY | AUDIT |
	GlobalPrivilegeAttachPolicy GlobalPrivilege = "ATTACH POLICY"
	GlobalPrivilegeAudit        GlobalPrivilege = "AUDIT"

	// | EXECUTE { ALERT | TASK }
	GlobalPrivilegeExecuteAlert GlobalPrivilege = "EXECUTE ALERT"
	GlobalPrivilegeExecuteTask  GlobalPrivilege = "EXECUTE TASK"
	// | IMPORT SHARE
	GlobalPrivilegeImportShare GlobalPrivilege = "IMPORT SHARE"
	// | MANAGE GRANTS
	GlobalPrivilegeManageGrants GlobalPrivilege = "MANAGE GRANTS"

	// | MODIFY { LOG LEVEL | TRACE LEVEL | SESSION LOG LEVEL | SESSION TRACE LEVEL }
	GlobalPrivilegeModifyLogLevel          GlobalPrivilege = "MODIFY LOG LEVEL"
	GlobalPrivilegeModifyTraceLevel        GlobalPrivilege = "MODIFY TRACE LEVEL"
	GlobalPrivilegeModifySessionLogLevel   GlobalPrivilege = "MODIFY SESSION LOG LEVEL"
	GlobalPrivilegeModifySessionTraceLevel GlobalPrivilege = "MODIFY SESSION TRACE LEVEL"

	// | MONITOR { EXECUTION | USAGE }
	GlobalPrivilegeMonitorExecution GlobalPrivilege = "MONITOR EXECUTION"
	GlobalPrivilegeMonitorUsage     GlobalPrivilege = "MONITOR USAGE"

	// | OVERRIDE SHARE RESTRICTIONS | RESOLVE ALL
	GlobalPrivilegeOverrideShareRestrictions GlobalPrivilege = "OVERRIDE SHARE RESTRICTIONS"
	GlobalPrivilegeResolveAll                GlobalPrivilege = "RESOLVE ALL"
)

func (GlobalPrivilege) String added in v0.68.0

func (p GlobalPrivilege) String() string

type Grant added in v0.65.0

type Grant struct {
	CreatedOn   time.Time
	Privilege   string
	GrantedOn   ObjectType
	Name        ObjectIdentifier
	GrantedTo   ObjectType
	GranteeName AccountObjectIdentifier
	GrantOption bool
	GrantedBy   AccountObjectIdentifier
}

func (*Grant) ID added in v0.65.0

func (v *Grant) ID() ObjectIdentifier

type GrantOnAccountObject added in v0.68.0

type GrantOnAccountObject struct {
	User             *AccountObjectIdentifier `ddl:"identifier" sql:"USER"`
	ResourceMonitor  *AccountObjectIdentifier `ddl:"identifier" sql:"RESOURCE MONITOR"`
	Warehouse        *AccountObjectIdentifier `ddl:"identifier" sql:"WAREHOUSE"`
	Database         *AccountObjectIdentifier `ddl:"identifier" sql:"DATABASE"`
	Integration      *AccountObjectIdentifier `ddl:"identifier" sql:"INTEGRATION"`
	FailoverGroup    *AccountObjectIdentifier `ddl:"identifier" sql:"FAILOVER GROUP"`
	ReplicationGroup *AccountObjectIdentifier `ddl:"identifier" sql:"REPLICATION GROUP"`
}

type GrantOnSchema added in v0.68.0

type GrantOnSchema struct {
	Schema                  *SchemaIdentifier        `ddl:"identifier" sql:"SCHEMA"`
	AllSchemasInDatabase    *AccountObjectIdentifier `ddl:"identifier" sql:"ALL SCHEMAS IN DATABASE"`
	FutureSchemasInDatabase *AccountObjectIdentifier `ddl:"identifier" sql:"FUTURE SCHEMAS IN DATABASE"`
}

type GrantOnSchemaObject added in v0.68.0

type GrantOnSchemaObject struct {
	SchemaObject *Object                `ddl:"-"`
	All          *GrantOnSchemaObjectIn `ddl:"keyword" sql:"ALL"`
	Future       *GrantOnSchemaObjectIn `ddl:"keyword" sql:"FUTURE"`
}

type GrantOnSchemaObjectIn added in v0.68.0

type GrantOnSchemaObjectIn struct {
	PluralObjectType PluralObjectType         `ddl:"keyword" sql:"ALL"`
	InDatabase       *AccountObjectIdentifier `ddl:"identifier" sql:"IN DATABASE"`
	InSchema         *SchemaIdentifier        `ddl:"identifier" sql:"IN SCHEMA"`
}

type GrantPrivilegeToShareOn added in v0.65.0

type GrantPrivilegeToShareOn struct {
	Database AccountObjectIdentifier `ddl:"identifier" sql:"DATABASE"`
	Schema   SchemaIdentifier        `ddl:"identifier" sql:"SCHEMA"`
	Function SchemaObjectIdentifier  `ddl:"identifier" sql:"FUNCTION"`
	Table    *OnTable                `ddl:"-"`
	View     SchemaObjectIdentifier  `ddl:"identifier" sql:"VIEW"`
}

type GrantPrivilegesToAccountRoleOptions added in v0.68.0

type GrantPrivilegesToAccountRoleOptions struct {
	WithGrantOption *bool `ddl:"keyword" sql:"WITH GRANT OPTION"`
	// contains filtered or unexported fields
}

type Grants added in v0.65.0

type Grants interface {
	GrantPrivilegesToAccountRole(ctx context.Context, privileges *AccountRoleGrantPrivileges, on *AccountRoleGrantOn, role AccountObjectIdentifier, opts *GrantPrivilegesToAccountRoleOptions) error
	RevokePrivilegesFromAccountRole(ctx context.Context, privileges *AccountRoleGrantPrivileges, on *AccountRoleGrantOn, role AccountObjectIdentifier, opts *RevokePrivilegesFromAccountRoleOptions) error
	// todo: GrantPrivilegesToDatabaseRole and RevokePrivilegesFromDatabaseRole
	GrantPrivilegeToShare(ctx context.Context, privilege ObjectPrivilege, on *GrantPrivilegeToShareOn, to AccountObjectIdentifier) error
	RevokePrivilegeFromShare(ctx context.Context, privilege ObjectPrivilege, on *RevokePrivilegeFromShareOn, from AccountObjectIdentifier) error
	Show(ctx context.Context, opts *ShowGrantOptions) ([]*Grant, error)
}

type Identifier added in v0.65.0

type Identifier interface {
	Name() string
}

type In

type In struct {
	Account  *bool                   `ddl:"keyword" sql:"ACCOUNT"`
	Database AccountObjectIdentifier `ddl:"identifier" sql:"DATABASE"`
	Schema   SchemaIdentifier        `ddl:"identifier" sql:"SCHEMA"`
}

type IntProperty

type IntProperty struct {
	Value        int
	DefaultValue int
	Description  string
}

type IntegrationType added in v0.65.0

type IntegrationType string

IntegrationType is the type of integration.

const (
	IntegrationTypeSecurityIntegrations     IntegrationType = "SECURITY INTEGRATIONS"
	IntegrationTypeAPIIntegrations          IntegrationType = "API INTEGRATIONS"
	IntegrationTypeNotificationIntegrations IntegrationType = "NOTIFICATION INTEGRATIONS"
)

type JSONCompression added in v0.68.0

type JSONCompression string
var (
	JSONCompressionAuto       JSONCompression = "AUTO"
	JSONCompressionGzip       JSONCompression = "GZIP"
	JSONCompressionBz2        JSONCompression = "BZ2"
	JSONCompressionBrotli     JSONCompression = "BROTLI"
	JSONCompressionZstd       JSONCompression = "ZSTD"
	JSONCompressionDeflate    JSONCompression = "DEFLATE"
	JSONCompressionRawDeflate JSONCompression = "RAW_DEFLATE"
	JSONCompressionNone       JSONCompression = "NONE"
)

type Like

type Like struct {
	Pattern *string `ddl:"keyword,single_quotes"`
}

type LimitFrom added in v0.65.0

type LimitFrom struct {
	Rows *int    `ddl:"keyword"`
	From *string `ddl:"parameter,no_equals,single_quotes" sql:"FROM"`
}

type LogLevel added in v0.65.0

type LogLevel string
const (
	LogLevelTrace LogLevel = "TRACE"
	LogLevelDebug LogLevel = "DEBUG"
	LogLevelInfo  LogLevel = "INFO"
	LogLevelWarn  LogLevel = "WARN"
	LogLevelError LogLevel = "ERROR"
	LogLevelFatal LogLevel = "FATAL"
	LogLevelOff   LogLevel = "OFF"
)

type MaskingPolicies

type MaskingPolicies interface {
	// Create creates a new masking policy.
	Create(ctx context.Context, id SchemaObjectIdentifier, signature []TableColumnSignature, returns DataType, expression string, opts *CreateMaskingPolicyOptions) error
	// Alter modifies an existing masking policy.
	Alter(ctx context.Context, id SchemaObjectIdentifier, opts *AlterMaskingPolicyOptions) error
	// Drop removes a masking policy.
	Drop(ctx context.Context, id SchemaObjectIdentifier) error
	// Show returns a list of masking policies.
	Show(ctx context.Context, opts *ShowMaskingPolicyOptions) ([]*MaskingPolicy, error)
	// ShowByID returns a masking policy by ID
	ShowByID(ctx context.Context, id SchemaObjectIdentifier) (*MaskingPolicy, error)
	// Describe returns the details of a masking policy.
	Describe(ctx context.Context, id SchemaObjectIdentifier) (*MaskingPolicyDetails, error)
}

MaskingPolicies describes all the masking policy related methods that the Snowflake API supports.

type MaskingPolicy

type MaskingPolicy struct {
	CreatedOn           time.Time
	Name                string
	DatabaseName        string
	SchemaName          string
	Kind                string
	Owner               string
	Comment             string
	ExemptOtherPolicies bool
}

MaskingPolicys is a user friendly result for a CREATE MASKING POLICY query.

func (*MaskingPolicy) ID

func (*MaskingPolicy) ObjectType added in v0.65.0

func (v *MaskingPolicy) ObjectType() ObjectType

type MaskingPolicyDetails

type MaskingPolicyDetails struct {
	Name       string
	Signature  []TableColumnSignature
	ReturnType DataType
	Body       string
}

type MaskingPolicySet

type MaskingPolicySet struct {
	Body    *string          `ddl:"parameter,no_equals" sql:"BODY ->"`
	Tag     []TagAssociation `ddl:"keyword" sql:"TAG"`
	Comment *string          `ddl:"parameter,single_quotes" sql:"COMMENT"`
}

type MaskingPolicyUnset

type MaskingPolicyUnset struct {
	Tag     []ObjectIdentifier `ddl:"keyword" sql:"TAG"`
	Comment *bool              `ddl:"keyword" sql:"COMMENT"`
}

type NullString added in v0.68.0

type NullString struct {
	S string `ddl:"parameter,no_equals,single_quotes"`
}

type Object added in v0.65.0

type Object struct {
	ObjectType ObjectType       `ddl:"keyword"`
	Name       ObjectIdentifier `ddl:"identifier"`
}

Object bundles together the object type and name. Its used for DDL statements.

type ObjectIdentifier

type ObjectIdentifier interface {
	Identifier
	FullyQualifiedName() string
}

func NewObjectIdentifierFromFullyQualifiedName added in v0.65.0

func NewObjectIdentifierFromFullyQualifiedName(fullyQualifiedName string) ObjectIdentifier

type ObjectParameter added in v0.65.0

type ObjectParameter string
const (
	// Object Parameters
	ObjectParameterDataRetentionTimeInDays             ObjectParameter = "DATA_RETENTION_TIME_IN_DAYS"
	ObjectParameterDefaultDDLCollation                 ObjectParameter = "DEFAULT_DDL_COLLATION"
	ObjectParameterLogLevel                            ObjectParameter = "LOG_LEVEL"
	ObjectParameterMaxConcurrencyLevel                 ObjectParameter = "MAX_CONCURRENCY_LEVEL"
	ObjectParameterMaxDataExtensionTimeInDays          ObjectParameter = "MAX_DATA_EXTENSION_TIME_IN_DAYS"
	ObjectParameterPipeExecutionPaused                 ObjectParameter = "PIPE_EXECUTION_PAUSED"
	ObjectParameterPreventUnloadToInternalStages       ObjectParameter = "PREVENT_UNLOAD_TO_INTERNAL_STAGES" // also an account param
	ObjectParameterStatementQueuedTimeoutInSeconds     ObjectParameter = "STATEMENT_QUEUED_TIMEOUT_IN_SECONDS"
	ObjectParameterNetworkPolicy                       ObjectParameter = "NETWORK_POLICY" // also an account param
	ObjectParameterShareRestrictions                   ObjectParameter = "SHARE_RESTRICTIONS"
	ObjectParameterSuspendTaskAfterNumFailures         ObjectParameter = "SUSPEND_TASK_AFTER_NUM_FAILURES"
	ObjectParameterTraceLevel                          ObjectParameter = "TRACE_LEVEL"
	ObjectParameterUserTaskManagedInitialWarehouseSize ObjectParameter = "USER_TASK_MANAGED_INITIAL_WAREHOUSE_SIZE"
	ObjectParameterUserTaskTimeoutMs                   ObjectParameter = "USER_TASK_TIMEOUT_MS"

	// User Parameters
	ObjectParameterEnableUnredactedQuerySyntaxError ObjectParameter = "ENABLE_UNREDACTED_QUERY_SYNTAX_ERROR"
)

type ObjectParameters added in v0.65.0

type ObjectParameters struct {
	DataRetentionTimeInDays             *int           `ddl:"parameter" sql:"DATA_RETENTION_TIME_IN_DAYS"`
	DefaultDDLCollation                 *string        `ddl:"parameter,single_quotes" sql:"DEFAULT_DDL_COLLATION"`
	LogLevel                            *LogLevel      `ddl:"parameter" sql:"LOG_LEVEL"`
	MaxConcurrencyLevel                 *int           `ddl:"parameter" sql:"MAX_CONCURRENCY_LEVEL"`
	MaxDataExtensionTimeInDays          *int           `ddl:"parameter" sql:"MAX_DATA_EXTENSION_TIME_IN_DAYS"`
	PipeExecutionPaused                 *bool          `ddl:"parameter" sql:"PIPE_EXECUTION_PAUSED"`
	PreventUnloadToInternalStages       *bool          `ddl:"parameter" sql:"PREVENT_UNLOAD_TO_INTERNAL_STAGES"`
	StatementQueuedTimeoutInSeconds     *int           `ddl:"parameter" sql:"STATEMENT_QUEUED_TIMEOUT_IN_SECONDS"`
	NetworkPolicy                       *string        `ddl:"parameter,single_quotes" sql:"NETWORK_POLICY"`
	ShareRestrictions                   *bool          `ddl:"parameter" sql:"SHARE_RESTRICTIONS"`
	SuspendTaskAfterNumFailures         *int           `ddl:"parameter" sql:"SUSPEND_TASK_AFTER_NUM_FAILURES"`
	TraceLevel                          *TraceLevel    `ddl:"parameter" sql:"TRACE_LEVEL"`
	UserTaskManagedInitialWarehouseSize *WarehouseSize `ddl:"parameter" sql:"USER_TASK_MANAGED_INITIAL_WAREHOUSE_SIZE"`
	UserTaskTimeoutMs                   *int           `ddl:"parameter" sql:"USER_TASK_TIMEOUT_MS"`
}

type ObjectParametersUnset added in v0.65.0

type ObjectParametersUnset struct {
	DataRetentionTimeInDays             *bool `ddl:"keyword" sql:"DATA_RETENTION_TIME_IN_DAYS"`
	DefaultDDLCollation                 *bool `ddl:"keyword" sql:"DEFAULT_DDL_COLLATION"`
	LogLevel                            *bool `ddl:"keyword" sql:"LOG_LEVEL"`
	MaxConcurrencyLevel                 *bool `ddl:"keyword" sql:"MAX_CONCURRENCY_LEVEL"`
	MaxDataExtensionTimeInDays          *bool `ddl:"keyword" sql:"MAX_DATA_EXTENSION_TIME_IN_DAYS"`
	PipeExecutionPaused                 *bool `ddl:"keyword" sql:"PIPE_EXECUTION_PAUSED"`
	PreventUnloadToInternalStages       *bool `ddl:"keyword" sql:"PREVENT_UNLOAD_TO_INTERNAL_STAGES"`
	StatementQueuedTimeoutInSeconds     *bool `ddl:"keyword" sql:"STATEMENT_QUEUED_TIMEOUT_IN_SECONDS"`
	NetworkPolicy                       *bool `ddl:"keyword,single_quotes" sql:"NETWORK_POLICY"`
	ShareRestrictions                   *bool `ddl:"keyword" sql:"SHARE_RESTRICTIONS"`
	SuspendTaskAfterNumFailures         *bool `ddl:"keyword" sql:"SUSPEND_TASK_AFTER_NUM_FAILURES"`
	TraceLevel                          *bool `ddl:"keyword" sql:"TRACE_LEVEL"`
	UserTaskManagedInitialWarehouseSize *bool `ddl:"keyword" sql:"USER_TASK_MANAGED_INITIAL_WAREHOUSE_SIZE"`
	UserTaskTimeoutMs                   *bool `ddl:"keyword" sql:"USER_TASK_TIMEOUT_MS"`
}

type ObjectPrivilege added in v0.68.0

type ObjectPrivilege string
const (
	ObjectPrivilegeUsage          ObjectPrivilege = "USAGE"
	ObjectPrivilegeSelect         ObjectPrivilege = "SELECT"
	ObjectPrivilegeReferenceUsage ObjectPrivilege = "REFERENCE_USAGE"
)

func (ObjectPrivilege) String added in v0.68.0

func (p ObjectPrivilege) String() string

type ObjectType

type ObjectType string

ObjectType is the type of object.

const (
	ObjectTypeAccount          ObjectType = "ACCOUNT"
	ObjectTypeAlert            ObjectType = "ALERT"
	ObjectTypeAccountParameter ObjectType = "ACCOUNT PARAMETER"
	ObjectTypeDatabase         ObjectType = "DATABASE"
	ObjectTypeFailoverGroup    ObjectType = "FAILOVER GROUP"
	ObjectTypeFileFormat       ObjectType = "FILE FORMAT"
	ObjectTypeIntegration      ObjectType = "INTEGRATION"
	ObjectTypeMaskingPolicy    ObjectType = "MASKING POLICY"
	ObjectTypeNetworkPolicy    ObjectType = "NETWORK POLICY"
	ObjectTypePasswordPolicy   ObjectType = "PASSWORD POLICY"
	ObjectTypeReplicationGroup ObjectType = "REPLICATION GROUP"
	ObjectTypeResourceMonitor  ObjectType = "RESOURCE MONITOR"
	ObjectTypeRole             ObjectType = "ROLE"
	ObjectTypeSchema           ObjectType = "SCHEMA"
	ObjectTypeSessionPolicy    ObjectType = "SESSION POLICY"
	ObjectTypeShare            ObjectType = "SHARE"
	ObjectTypeTable            ObjectType = "TABLE"
	ObjectTypeTag              ObjectType = "TAG"
	ObjectTypeTask             ObjectType = "TASK"
	ObjectTypeUser             ObjectType = "USER"
	ObjectTypeWarehouse        ObjectType = "WAREHOUSE"
)

func (ObjectType) GetObjectIdentifier added in v0.65.0

func (o ObjectType) GetObjectIdentifier(fullyQualifiedName string) ObjectIdentifier

GetObjectIdentifier returns the ObjectIdentifier for the ObjectType and fully qualified name.

func (ObjectType) Plural added in v0.65.0

func (o ObjectType) Plural() PluralObjectType

func (ObjectType) String

func (o ObjectType) String() string

type OnTable added in v0.65.0

type OnTable struct {
	Name        SchemaObjectIdentifier `ddl:"identifier" sql:"TABLE"`
	AllInSchema SchemaIdentifier       `ddl:"identifier" sql:"ALL TABLES IN SCHEMA"`
}

type OnView added in v0.65.0

type OnView struct {
	Name        SchemaObjectIdentifier `ddl:"identifier" sql:"VIEW"`
	AllInSchema SchemaIdentifier       `ddl:"identifier" sql:"ALL VIEWS IN SCHEMA"`
}

type Parameter added in v0.65.0

type Parameter struct {
	Key         string
	Value       string
	Default     string
	Level       ParameterType
	Description string
}

type ParameterType added in v0.65.0

type ParameterType string
const (
	ParameterTypeAccount ParameterType = "ACCOUNT"
	ParameterTypeUser    ParameterType = "USER"
	ParameterTypeSession ParameterType = "SESSION"
	ParameterTypeObject  ParameterType = "OBJECT"
)

type ParametersIn added in v0.65.0

type ParametersIn struct {
	Session   *bool                   `ddl:"keyword" sql:"SESSION"`
	Account   *bool                   `ddl:"keyword" sql:"ACCOUNT"`
	User      AccountObjectIdentifier `ddl:"identifier" sql:"USER"`
	Warehouse AccountObjectIdentifier `ddl:"identifier" sql:"WAREHOUSE"`
	Database  AccountObjectIdentifier `ddl:"identifier" sql:"DATABASE"`
	Schema    SchemaIdentifier        `ddl:"identifier" sql:"SCHEMA"`
	Task      SchemaObjectIdentifier  `ddl:"identifier" sql:"TASK"`
	Table     SchemaObjectIdentifier  `ddl:"identifier" sql:"TABLE"`
}

type ParquetCompression added in v0.68.0

type ParquetCompression string
var (
	ParquetCompressionAuto   ParquetCompression = "AUTO"
	ParquetCompressionLzo    ParquetCompression = "LZO"
	ParquetCompressionSnappy ParquetCompression = "SNAPPY"
	ParquetCompressionNone   ParquetCompression = "NONE"
)

type PasswordPolicies

type PasswordPolicies interface {
	// Create creates a new password policy.
	Create(ctx context.Context, id SchemaObjectIdentifier, opts *CreatePasswordPolicyOptions) error
	// Alter modifies an existing password policy.
	Alter(ctx context.Context, id SchemaObjectIdentifier, opts *AlterPasswordPolicyOptions) error
	// Drop removes a password policy.
	Drop(ctx context.Context, id SchemaObjectIdentifier, opts *DropPasswordPolicyOptions) error
	// Show returns a list of password policies.
	Show(ctx context.Context, opts *PasswordPolicyShowOptions) ([]*PasswordPolicy, error)
	// ShowByID returns a password policy by ID.
	ShowByID(ctx context.Context, id SchemaObjectIdentifier) (*PasswordPolicy, error)
	// Describe returns the details of a password policy.
	Describe(ctx context.Context, id SchemaObjectIdentifier) (*PasswordPolicyDetails, error)
}

PasswordPolicies describes all the password policy related methods that the Snowflake API supports.

type PasswordPolicy

type PasswordPolicy struct {
	CreatedOn    time.Time
	Name         string
	DatabaseName string
	SchemaName   string
	Kind         string
	Owner        string
	Comment      string
}

PasswordPolicys is a user friendly result for a CREATE PASSWORD POLICY query.

func (*PasswordPolicy) ID

func (*PasswordPolicy) ObjectType added in v0.65.0

func (v *PasswordPolicy) ObjectType() ObjectType

type PasswordPolicyDetails

type PasswordPolicyDetails struct {
	Name                      *StringProperty
	Owner                     *StringProperty
	Comment                   *StringProperty
	PasswordMinLength         *IntProperty
	PasswordMaxLength         *IntProperty
	PasswordMinUpperCaseChars *IntProperty
	PasswordMinLowerCaseChars *IntProperty
	PasswordMinNumericChars   *IntProperty
	PasswordMinSpecialChars   *IntProperty
	PasswordMaxAgeDays        *IntProperty
	PasswordMaxRetries        *IntProperty
	PasswordLockoutTimeMins   *IntProperty
}

type PasswordPolicySet

type PasswordPolicySet struct {
	PasswordMinLength         *int    `ddl:"parameter" sql:"PASSWORD_MIN_LENGTH"`
	PasswordMaxLength         *int    `ddl:"parameter" sql:"PASSWORD_MAX_LENGTH"`
	PasswordMinUpperCaseChars *int    `ddl:"parameter" sql:"PASSWORD_MIN_UPPER_CASE_CHARS"`
	PasswordMinLowerCaseChars *int    `ddl:"parameter" sql:"PASSWORD_MIN_LOWER_CASE_CHARS"`
	PasswordMinNumericChars   *int    `ddl:"parameter" sql:"PASSWORD_MIN_NUMERIC_CHARS"`
	PasswordMinSpecialChars   *int    `ddl:"parameter" sql:"PASSWORD_MIN_SPECIAL_CHARS"`
	PasswordMaxAgeDays        *int    `ddl:"parameter" sql:"PASSWORD_MAX_AGE_DAYS"`
	PasswordMaxRetries        *int    `ddl:"parameter" sql:"PASSWORD_MAX_RETRIES"`
	PasswordLockoutTimeMins   *int    `ddl:"parameter" sql:"PASSWORD_LOCKOUT_TIME_MINS"`
	Comment                   *string `ddl:"parameter,single_quotes" sql:"COMMENT"`
}

type PasswordPolicyShowOptions

type PasswordPolicyShowOptions struct {
	Like  *Like `ddl:"keyword" sql:"LIKE"`
	In    *In   `ddl:"keyword" sql:"IN"`
	Limit *int  `ddl:"parameter,no_equals" sql:"LIMIT"`
	// contains filtered or unexported fields
}

PasswordPolicyShowOptions represents the options for listing password policies.

type PasswordPolicyUnset

type PasswordPolicyUnset struct {
	PasswordMinLength         *bool `ddl:"keyword" sql:"PASSWORD_MIN_LENGTH"`
	PasswordMaxLength         *bool `ddl:"keyword" sql:"PASSWORD_MAX_LENGTH"`
	PasswordMinUpperCaseChars *bool `ddl:"keyword" sql:"PASSWORD_MIN_UPPER_CASE_CHARS"`
	PasswordMinLowerCaseChars *bool `ddl:"keyword" sql:"PASSWORD_MIN_LOWER_CASE_CHARS"`
	PasswordMinNumericChars   *bool `ddl:"keyword" sql:"PASSWORD_MIN_NUMERIC_CHARS"`
	PasswordMinSpecialChars   *bool `ddl:"keyword" sql:"PASSWORD_MIN_SPECIAL_CHARS"`
	PasswordMaxAgeDays        *bool `ddl:"keyword" sql:"PASSWORD_MAX_AGE_DAYS"`
	PasswordMaxRetries        *bool `ddl:"keyword" sql:"PASSWORD_MAX_RETRIES"`
	PasswordLockoutTimeMins   *bool `ddl:"keyword" sql:"PASSWORD_LOCKOUT_TIME_MINS"`
	Comment                   *bool `ddl:"keyword" sql:"COMMENT"`
}

type PluralObjectType added in v0.65.0

type PluralObjectType string
const (
	PluralObjectTypeAccountParameters  PluralObjectType = "ACCOUNT PARAMETERS"
	PluralObjectTypeDatabases          PluralObjectType = "DATABASES"
	PluralObjectTypeTypeFailoverGroups PluralObjectType = "FAILOVER GROUPS"
	PluralObjectTypeIntegrations       PluralObjectType = "INTEGRATIONS"
	PluralObjectTypeMaskingPolicies    PluralObjectType = "MASKING POLICIES"
	PluralObjectTypeNetworkPolicies    PluralObjectType = "NETWORK POLICIES"
	PluralObjectTypePasswordPolicies   PluralObjectType = "PASSWORD POLICIES"
	PluralObjectTypeReplicationGroups  PluralObjectType = "REPLICATION GROUPS"
	PluralObjectTypeResourceMonitors   PluralObjectType = "RESOURCE MONITORS"
	PluralObjectTypeRoles              PluralObjectType = "ROLES"
	PluralObjectTypeSchemas            PluralObjectType = "SCHEMAS"
	PluralObjectTypeSessionPolicies    PluralObjectType = "SESSION POLICIES"
	PluralObjectTypeShares             PluralObjectType = "SHARES"
	PluralObjectTypeTables             PluralObjectType = "TABLES"
	PluralObjectTypeTags               PluralObjectType = "TAGS"
	PluralObjectTypeTasks              PluralObjectType = "TASKS"
	PluralObjectTypeUsers              PluralObjectType = "USERS"
	PluralObjectTypeWarehouses         PluralObjectType = "WAREHOUSES"
)

func (PluralObjectType) Singular added in v0.65.0

func (p PluralObjectType) Singular() ObjectType

func (PluralObjectType) String added in v0.65.0

func (p PluralObjectType) String() string

type Region added in v0.65.0

type Region struct {
	RegionGroup     string
	SnowflakeRegion string
	CloudType       CloudType
	Region          string
	DisplayName     string
}

type ReplicationAccount added in v0.65.0

type ReplicationAccount struct {
	SnowflakeRegion  string    `db:"snowflake_region"`
	CreatedOn        time.Time `db:"created_on"`
	AccountName      string    `db:"account_name"`
	AccountLocator   string    `db:"account_locator"`
	Comment          string    `db:"comment"`
	OrganizationName string    `db:"organization_name"`
	IsOrgAdmin       bool      `db:"is_org_admin"`
}

func (*ReplicationAccount) ID added in v0.65.0

type ReplicationFunctions added in v0.65.0

type ReplicationFunctions interface {
	ShowReplicationAcccounts(ctx context.Context) ([]*ReplicationAccount, error)
	// todo: ShowReplicationDatabases(ctx context.Context, opts *ShowReplicationDatabasesOptions) ([]*ReplicationDatabase, error)
	ShowRegions(ctx context.Context, opts *ShowRegionsOptions) ([]*Region, error)
}

type ResourceMonitor added in v0.65.0

type ResourceMonitor struct {
	Name string
}

func (*ResourceMonitor) ID added in v0.65.0

func (*ResourceMonitor) ObjectType added in v0.65.0

func (v *ResourceMonitor) ObjectType() ObjectType

type ResourceMonitors added in v0.65.0

type ResourceMonitors interface {
	// Create creates a resource monitor.
	Create(ctx context.Context, id AccountObjectIdentifier, opts *CreateResourceMonitorOptions) error
	// Alter modifies an existing resource monitor
	Alter(ctx context.Context, id AccountObjectIdentifier, opts *AlterResourceMonitorOptions) error
	// Drop removes a resource monitor.
	Drop(ctx context.Context, id AccountObjectIdentifier) error
	// Show returns a list of resource monitor.
	Show(ctx context.Context, opts *ShowResourceMonitorOptions) ([]*ResourceMonitor, error)
	// ShowByID returns a resource monitor by ID
	ShowByID(ctx context.Context, id AccountObjectIdentifier) (*ResourceMonitor, error)
}

type RevokePrivilegeFromShareOn added in v0.65.0

type RevokePrivilegeFromShareOn struct {
	Database AccountObjectIdentifier `ddl:"identifier" sql:"DATABASE"`
	Schema   SchemaIdentifier        `ddl:"identifier" sql:"SCHEMA"`
	Table    *OnTable                `ddl:"-"`
	View     *OnView                 `ddl:"-"`
}

type RevokePrivilegesFromAccountRoleOptions added in v0.68.0

type RevokePrivilegesFromAccountRoleOptions struct {
	GrantOptionFor *bool `ddl:"keyword" sql:"GRANT OPTION FOR"`

	Restrict *bool `ddl:"keyword" sql:"RESTRICT"`
	Cascade  *bool `ddl:"keyword" sql:"CASCADE"`
	// contains filtered or unexported fields
}

type Role added in v0.65.0

type Role struct {
	Name string `db:"name"`
}

func (*Role) ID added in v0.65.0

func (v *Role) ID() AccountObjectIdentifier

func (*Role) ObjectType added in v0.65.0

func (v *Role) ObjectType() ObjectType

type RoleAlterOptions added in v0.65.0

type RoleAlterOptions struct{}

RoleAlterOptions contains options for altering a user.

type RoleCreateOptions added in v0.65.0

type RoleCreateOptions struct{}

RoleCreateOptions contains options for creating a role.

type RoleDropOptions added in v0.65.0

type RoleDropOptions struct{}

RoleDropOptions contains options for dropping a role.

type RoleShowOptions added in v0.65.0

type RoleShowOptions struct{}

RoleShowOptions contains options for listing roles.

type Roles added in v0.65.0

type Roles interface {
	// Create creates a role.
	Create(ctx context.Context, id AccountObjectIdentifier, opts *RoleCreateOptions) error
	// Alter modifies an existing role
	Alter(ctx context.Context, id AccountObjectIdentifier, opts *RoleAlterOptions) error
	// Drop removes a role.
	Drop(ctx context.Context, id AccountObjectIdentifier, opts *RoleDropOptions) error
	// Show returns a list of roles.
	Show(ctx context.Context, opts *RoleShowOptions) ([]*Role, error)
	// ShowByID returns a user by ID
	ShowByID(ctx context.Context, id AccountObjectIdentifier) (*Role, error)
}

type ScalingPolicy added in v0.65.0

type ScalingPolicy string
var (
	ScalingPolicyStandard ScalingPolicy = "STANDARD"
	ScalingPolicyEconomy  ScalingPolicy = "ECONOMY"
)

type Schema

type Schema struct {
	DatabaseName string
	Name         string
}

placeholder for the real implementation.

func (*Schema) ID

func (v *Schema) ID() SchemaIdentifier

func (*Schema) ObjectType added in v0.65.0

func (v *Schema) ObjectType() ObjectType

type SchemaIdentifier

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

func NewSchemaIdentifier

func NewSchemaIdentifier(databaseName, schemaName string) SchemaIdentifier

func NewSchemaIdentifierFromFullyQualifiedName

func NewSchemaIdentifierFromFullyQualifiedName(fullyQualifiedName string) SchemaIdentifier

func (SchemaIdentifier) DatabaseName

func (i SchemaIdentifier) DatabaseName() string

func (SchemaIdentifier) FullyQualifiedName

func (i SchemaIdentifier) FullyQualifiedName() string

func (SchemaIdentifier) Name

func (i SchemaIdentifier) Name() string

type SchemaObjectIdentifier

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

func NewSchemaObjectIdentifier

func NewSchemaObjectIdentifier(databaseName, schemaName, name string) SchemaObjectIdentifier

func NewSchemaObjectIdentifierFromFullyQualifiedName

func NewSchemaObjectIdentifierFromFullyQualifiedName(fullyQualifiedName string) SchemaObjectIdentifier

func (SchemaObjectIdentifier) DatabaseName

func (i SchemaObjectIdentifier) DatabaseName() string

func (SchemaObjectIdentifier) FullyQualifiedName

func (i SchemaObjectIdentifier) FullyQualifiedName() string

func (SchemaObjectIdentifier) Name

func (i SchemaObjectIdentifier) Name() string

func (SchemaObjectIdentifier) SchemaName

func (i SchemaObjectIdentifier) SchemaName() string

type SchemaObjectPrivilege added in v0.68.0

type SchemaObjectPrivilege string
const (
	// -- For ALERT
	// OPERATE [ , ... ]
	SchemaObjectPrivilegeOperate SchemaObjectPrivilege = "OPERATE"

	// -- For EVENT TABLE
	// { SELECT | INSERT } [ , ... ]
	SchemaObjectPrivilegeSelect SchemaObjectPrivilege = "SELECT"
	SchemaObjectPrivilegeInsert SchemaObjectPrivilege = "INSERT"

	// -- For FILE FORMAT, FUNCTION (UDF or external function), PROCEDURE, SECRET, or SEQUENCE
	// USAGE [ , ... ]
	SchemaObjectPrivilegeUsage SchemaObjectPrivilege = "USAGE"

	// -- For PIPE
	// { MONITOR | OPERATE } [ , ... ]
	SchemaObjectPrivilegeMonitor SchemaObjectPrivilege = "MONITOR"

	// -- For { MASKING | PASSWORD | ROW ACCESS | SESSION } POLICY or TAG
	// APPLY [ , ... ]
	SchemaObjectPrivilegeApply SchemaObjectPrivilege = "APPLY"

	// -- For internal STAGE
	// READ [ , WRITE ] [ , ... ]
	SchemaObjectPrivilegeRead  SchemaObjectPrivilege = "READ"
	SchemaObjectPrivilegeWrite SchemaObjectPrivilege = "WRITE"

	// -- For TABLE
	// { SELECT | INSERT | UPDATE | DELETE | TRUNCATE | REFERENCES } [ , ... ]
	// SchemaObjectPrivilegeSelect SchemaObjectPrivilege = "SELECT" (duplicate)
	// SchemaObjectPrivilegeInsert SchemaObjectPrivilege = "INSERT" (duplicate)
	SchemaObjectPrivilegeUpdate     SchemaObjectPrivilege = "UPDATE"
	SchemaObjectPrivilegeDelete     SchemaObjectPrivilege = "DELETE"
	SchemaObjectPrivilegeTruncate   SchemaObjectPrivilege = "TRUNCATE"
	SchemaObjectPrivilegeReferences SchemaObjectPrivilege = "REFERENCES"
)

func (SchemaObjectPrivilege) String added in v0.68.0

func (p SchemaObjectPrivilege) String() string

type SchemaPrivilege added in v0.68.0

type SchemaPrivilege string
const (
	/*
		ADD SEARCH OPTIMIZATION
		| CREATE {
			ALERT | EXTERNAL TABLE | FILE FORMAT | FUNCTION
			| MATERIALIZED VIEW | PIPE | PROCEDURE
			| { MASKING | PASSWORD | ROW ACCESS | SESSION } POLICY
			| SECRET | SEQUENCE | STAGE | STREAM
			| TAG | TABLE | TASK | VIEW
		  }
		| MODIFY | MONITOR | USAGE
		[ , ... ]
	*/
	SchemaPrivilegeAddSearchOptimization  SchemaPrivilege = "ADD SEARCH OPTIMIZATION"
	SchemaPrivilegeCreateAlert            SchemaPrivilege = "CREATE ALERT"
	SchemaPrivilegeCreateExternalTable    SchemaPrivilege = "CREATE EXTERNAL TABLE"
	SchemaPrivilegeCreateFileFormat       SchemaPrivilege = "CREATE FILE FORMAT"
	SchemaPrivilegeCreateFunction         SchemaPrivilege = "CREATE FUNCTION"
	SchemaPrivilegeCreateMaterializedView SchemaPrivilege = "CREATE MATERIALIZED VIEW"
	SchemaPrivilegeCreatePipe             SchemaPrivilege = "CREATE PIPE"
	SchemaPrivilegeCreateProcedure        SchemaPrivilege = "CREATE PROCEDURE"
	SchemaPrivilegeCreateMaskingPolicy    SchemaPrivilege = "CREATE MASKING POLICY"
	SchemaPrivilegeCreatePasswordPolicy   SchemaPrivilege = "CREATE PASSWORD POLICY"
	SchemaPrivilegeCreateRowAccessPolicy  SchemaPrivilege = "CREATE ROW ACCESS POLICY"
	SchemaPrivilegeCreateSessionPolicy    SchemaPrivilege = "CREATE SESSION POLICY"
	SchemaPrivilegeCreateSecret           SchemaPrivilege = "CREATE SECRET"
	SchemaPrivilegeCreateSequence         SchemaPrivilege = "CREATE SEQUENCE"
	SchemaPrivilegeCreateStage            SchemaPrivilege = "CREATE STAGE"
	SchemaPrivilegeCreateStream           SchemaPrivilege = "CREATE STREAM"
	SchemaPrivilegeCreateTag              SchemaPrivilege = "CREATE TAG"
	SchemaPrivilegeCreateTable            SchemaPrivilege = "CREATE TABLE"
	SchemaPrivilegeCreateTask             SchemaPrivilege = "CREATE TASK"
	SchemaPrivilegeCreateView             SchemaPrivilege = "CREATE VIEW"
	SchemaPrivilegeModify                 SchemaPrivilege = "MODIFY"
	SchemaPrivilegeMonitor                SchemaPrivilege = "MONITOR"
	SchemaPrivilegeUsage                  SchemaPrivilege = "USAGE"
)

func (SchemaPrivilege) String added in v0.68.0

func (p SchemaPrivilege) String() string

type SessionParameter added in v0.65.0

type SessionParameter string
const (
	SessionParameterAbortDetachedQuery               SessionParameter = "ABORT_DETACHED_QUERY"
	SessionParameterAutocommit                       SessionParameter = "AUTOCOMMIT"
	SessionParameterBinaryInputFormat                SessionParameter = "BINARY_INPUT_FORMAT"
	SessionParameterBinaryOutputFormat               SessionParameter = "BINARY_OUTPUT_FORMAT"
	SessionParameterDateInputFormat                  SessionParameter = "DATE_INPUT_FORMAT"
	SessionParameterDateOutputFormat                 SessionParameter = "DATE_OUTPUT_FORMAT"
	SessionParameterErrorOnNondeterministicMerge     SessionParameter = "ERROR_ON_NONDETERMINISTIC_MERGE"
	SessionParameterErrorOnNondeterministicUpdate    SessionParameter = "ERROR_ON_NONDETERMINISTIC_UPDATE"
	SessionParameterGeographyOutputFormat            SessionParameter = "GEOGRAPHY_OUTPUT_FORMAT"
	SessionParameterJSONIndent                       SessionParameter = "JSON_INDENT"
	SessionParameterLockTimeout                      SessionParameter = "LOCK_TIMEOUT"
	SessionParameterQueryTag                         SessionParameter = "QUERY_TAG"
	SessionParameterRowsPerResultset                 SessionParameter = "ROWS_PER_RESULTSET"
	SessionParameterSimulatedDataSharingConsumer     SessionParameter = "SIMULATED_DATA_SHARING_CONSUMER"
	SessionParameterStatementTimeoutInSeconds        SessionParameter = "STATEMENT_TIMEOUT_IN_SECONDS"
	SessionParameterStrictJSONOutput                 SessionParameter = "STRICT_JSON_OUTPUT"
	SessionParameterTimestampDayIsAlways24h          SessionParameter = "TIMESTAMP_DAY_IS_ALWAYS_24H"
	SessionParameterTimestampInputFormat             SessionParameter = "TIMESTAMP_INPUT_FORMAT"
	SessionParameterTimestampLTZOutputFormat         SessionParameter = "TIMESTAMP_LTZ_OUTPUT_FORMAT"
	SessionParameterTimestampNTZOutputFormat         SessionParameter = "TIMESTAMP_NTZ_OUTPUT_FORMAT"
	SessionParameterTimestampOutputFormat            SessionParameter = "TIMESTAMP_OUTPUT_FORMAT"
	SessionParameterTimestampTypeMapping             SessionParameter = "TIMESTAMP_TYPE_MAPPING"
	SessionParameterTimestampTZOutputFormat          SessionParameter = "TIMESTAMP_TZ_OUTPUT_FORMAT"
	SessionParameterTimezone                         SessionParameter = "TIMEZONE"
	SessionParameterTimeInputFormat                  SessionParameter = "TIME_INPUT_FORMAT"
	SessionParameterTimeOutputFormat                 SessionParameter = "TIME_OUTPUT_FORMAT"
	SessionParameterTransactionDefaultIsolationLevel SessionParameter = "TRANSACTION_DEFAULT_ISOLATION_LEVEL"
	SessionParameterTwoDigitCenturyStart             SessionParameter = "TWO_DIGIT_CENTURY_START"
	SessionParameterUnsupportedDDLAction             SessionParameter = "UNSUPPORTED_DDL_ACTION"
	SessionParameterUseCachedResult                  SessionParameter = "USE_CACHED_RESULT"
	SessionParameterWeekOfYearPolicy                 SessionParameter = "WEEK_OF_YEAR_POLICY"
	SessionParameterWeekStart                        SessionParameter = "WEEK_START"
)

type SessionParameters added in v0.65.0

type SessionParameters struct {
	AbortDetachedQuery               *bool                             `ddl:"parameter" sql:"ABORT_DETACHED_QUERY"`
	Autocommit                       *bool                             `ddl:"parameter" sql:"AUTOCOMMIT"`
	BinaryInputFormat                *string                           `ddl:"parameter,single_quotes" sql:"BINARY_INPUT_FORMAT"`
	BinaryOutputFormat               *BinaryInputFormat                `ddl:"parameter,single_quotes" sql:"BINARY_OUTPUT_FORMAT"`
	DateInputFormat                  *string                           `ddl:"parameter,single_quotes" sql:"DATE_INPUT_FORMAT"`
	DateOutputFormat                 *string                           `ddl:"parameter,single_quotes" sql:"DATE_OUTPUT_FORMAT"`
	ErrorOnNondeterministicMerge     *bool                             `ddl:"parameter" sql:"ERROR_ON_NONDETERMINISTIC_MERGE"`
	ErrorOnNondeterministicUpdate    *bool                             `ddl:"parameter" sql:"ERROR_ON_NONDETERMINISTIC_UPDATE"`
	GeographyOutputFormat            *GeographyOutputFormat            `ddl:"parameter,single_quotes" sql:"GEOGRAPHY_OUTPUT_FORMAT"`
	JSONIndent                       *int                              `ddl:"parameter" sql:"JSON_INDENT"`
	LockTimeout                      *int                              `ddl:"parameter" sql:"LOCK_TIMEOUT"`
	QueryTag                         *string                           `ddl:"parameter,single_quotes" sql:"QUERY_TAG"`
	RowsPerResultset                 *int                              `ddl:"parameter" sql:"ROWS_PER_RESULTSET"`
	SimulatedDataSharingConsumer     *string                           `ddl:"parameter,single_quotes" sql:"SIMULATED_DATA_SHARING_CONSUMER"`
	StatementTimeoutInSeconds        *int                              `ddl:"parameter" sql:"STATEMENT_TIMEOUT_IN_SECONDS"`
	StrictJSONOutput                 *bool                             `ddl:"parameter" sql:"STRICT_JSON_OUTPUT"`
	TimestampDayIsAlways24h          *bool                             `ddl:"parameter" sql:"TIMESTAMP_DAY_IS_ALWAYS_24H"`
	TimestampInputFormat             *string                           `ddl:"parameter,single_quotes" sql:"TIMESTAMP_INPUT_FORMAT"`
	TimestampLTZOutputFormat         *string                           `ddl:"parameter,single_quotes" sql:"TIMESTAMP_LTZ_OUTPUT_FORMAT"`
	TimestampNTZOutputFormat         *string                           `ddl:"parameter,single_quotes" sql:"TIMESTAMP_NTZ_OUTPUT_FORMAT"`
	TimestampOutputFormat            *string                           `ddl:"parameter,single_quotes" sql:"TIMESTAMP_OUTPUT_FORMAT"`
	TimestampTypeMapping             *string                           `ddl:"parameter,single_quotes" sql:"TIMESTAMP_TYPE_MAPPING"`
	TimestampTZOutputFormat          *string                           `ddl:"parameter,single_quotes" sql:"TIMESTAMP_TZ_OUTPUT_FORMAT"`
	Timezone                         *string                           `ddl:"parameter,single_quotes" sql:"TIMEZONE"`
	TimeInputFormat                  *string                           `ddl:"parameter,single_quotes" sql:"TIME_INPUT_FORMAT"`
	TimeOutputFormat                 *string                           `ddl:"parameter,single_quotes" sql:"TIME_OUTPUT_FORMAT"`
	TransactionDefaultIsolationLevel *TransactionDefaultIsolationLevel `ddl:"parameter,single_quotes" sql:"TRANSACTION_DEFAULT_ISOLATION_LEVEL"`
	TwoDigitCenturyStart             *int                              `ddl:"parameter" sql:"TWO_DIGIT_CENTURY_START"`
	UnsupportedDDLAction             *UnsupportedDDLAction             `ddl:"parameter,single_quotes" sql:"UNSUPPORTED_DDL_ACTION"`
	UseCachedResult                  *bool                             `ddl:"parameter" sql:"USE_CACHED_RESULT"`
	WeekOfYearPolicy                 *int                              `ddl:"parameter" sql:"WEEK_OF_YEAR_POLICY"`
	WeekStart                        *int                              `ddl:"parameter" sql:"WEEK_START"`
}

type SessionParametersUnset added in v0.65.0

type SessionParametersUnset struct {
	AbortDetachedQuery               *bool `ddl:"keyword" sql:"ABORT_DETACHED_QUERY"`
	Autocommit                       *bool `ddl:"keyword" sql:"AUTOCOMMIT"`
	BinaryInputFormat                *bool `ddl:"keyword" sql:"BINARY_INPUT_FORMAT"`
	BinaryOutputFormat               *bool `ddl:"keyword" sql:"BINARY_OUTPUT_FORMAT"`
	DateInputFormat                  *bool `ddl:"keyword" sql:"DATE_INPUT_FORMAT"`
	DateOutputFormat                 *bool `ddl:"keyword" sql:"DATE_OUTPUT_FORMAT"`
	ErrorOnNondeterministicMerge     *bool `ddl:"keyword" sql:"ERROR_ON_NONDETERMINISTIC_MERGE"`
	ErrorOnNondeterministicUpdate    *bool `ddl:"keyword" sql:"ERROR_ON_NONDETERMINISTIC_UPDATE"`
	GeographyOutputFormat            *bool `ddl:"keyword" sql:"GEOGRAPHY_OUTPUT_FORMAT"`
	JSONIndent                       *bool `ddl:"keyword" sql:"JSON_INDENT"`
	LockTimeout                      *bool `ddl:"keyword" sql:"LOCK_TIMEOUT"`
	QueryTag                         *bool `ddl:"keyword" sql:"QUERY_TAG"`
	RowsPerResultset                 *bool `ddl:"keyword" sql:"ROWS_PER_RESULTSET"`
	SimulatedDataSharingConsumer     *bool `ddl:"keyword" sql:"SIMULATED_DATA_SHARING_CONSUMER"`
	StatementTimeoutInSeconds        *bool `ddl:"keyword" sql:"STATEMENT_TIMEOUT_IN_SECONDS"`
	StrictJSONOutput                 *bool `ddl:"keyword" sql:"STRICT_JSON_OUTPUT"`
	TimestampDayIsAlways24h          *bool `ddl:"keyword" sql:"TIMESTAMP_DAY_IS_ALWAYS_24H"`
	TimestampInputFormat             *bool `ddl:"keyword" sql:"TIMESTAMP_INPUT_FORMAT"`
	TimestampLTZOutputFormat         *bool `ddl:"keyword" sql:"TIMESTAMP_LTZ_OUTPUT_FORMAT"`
	TimestampNTZOutputFormat         *bool `ddl:"keyword" sql:"TIMESTAMP_NTZ_OUTPUT_FORMAT"`
	TimestampOutputFormat            *bool `ddl:"keyword" sql:"TIMESTAMP_OUTPUT_FORMAT"`
	TimestampTypeMapping             *bool `ddl:"keyword" sql:"TIMESTAMP_TYPE_MAPPING"`
	TimestampTZOutputFormat          *bool `ddl:"keyword" sql:"TIMESTAMP_TZ_OUTPUT_FORMAT"`
	Timezone                         *bool `ddl:"keyword" sql:"TIMEZONE"`
	TimeInputFormat                  *bool `ddl:"keyword" sql:"TIME_INPUT_FORMAT"`
	TimeOutputFormat                 *bool `ddl:"keyword" sql:"TIME_OUTPUT_FORMAT"`
	TransactionDefaultIsolationLevel *bool `ddl:"keyword" sql:"TRANSACTION_DEFAULT_ISOLATION_LEVEL"`
	TwoDigitCenturyStart             *bool `ddl:"keyword" sql:"TWO_DIGIT_CENTURY_START"`
	UnsupportedDDLAction             *bool `ddl:"keyword" sql:"UNSUPPORTED_DDL_ACTION"`
	UseCachedResult                  *bool `ddl:"keyword" sql:"USE_CACHED_RESULT"`
	WeekOfYearPolicy                 *bool `ddl:"keyword" sql:"WEEK_OF_YEAR_POLICY"`
	WeekStart                        *bool `ddl:"keyword" sql:"WEEK_START"`
}

type SessionPolicies added in v0.65.0

type SessionPolicies interface {
	// Create creates a session policy.
	Create(ctx context.Context, id SchemaObjectIdentifier, opts *CreateSessionPolicyOptions) error
	// Alter modifies an existing session policy
	Alter(ctx context.Context, id SchemaObjectIdentifier, opts *AlterSessionPolicyOptions) error
	// Drop removes a session policy.
	Drop(ctx context.Context, id SchemaObjectIdentifier, opts *DropSessionPolicyOptions) error
	// Show returns a list of session policy.
	Show(ctx context.Context) ([]*SessionPolicy, error)
	// ShowByID returns a session policy by ID
	ShowByID(ctx context.Context, id SchemaObjectIdentifier) (*SessionPolicy, error)
	// Describe returns the details of a session policy.
	Describe(ctx context.Context, id SchemaObjectIdentifier) (*SessionPolicyDetails, error)
}

type SessionPolicy added in v0.65.0

type SessionPolicy struct {
	Name         string
	DatabaseName string
	SchemaName   string
}

func (*SessionPolicy) ID added in v0.65.0

func (*SessionPolicy) ObjectType added in v0.65.0

func (v *SessionPolicy) ObjectType() ObjectType

type SessionPolicyDetails added in v0.65.0

type SessionPolicyDetails struct{}

type SessionSet added in v0.65.0

type SessionSet struct {
	SessionParameters *SessionParameters `ddl:"list"`
}

type SessionUnset added in v0.65.0

type SessionUnset struct {
	SessionParametersUnset *SessionParametersUnset `ddl:"list"`
}

type Sessions

type Sessions interface {
	// Parameters
	AlterSession(ctx context.Context, opts *AlterSessionOptions) error
	ShowParameters(ctx context.Context, opts *ShowParametersOptions) ([]*Parameter, error)
	ShowAccountParameter(ctx context.Context, parameter AccountParameter) (*Parameter, error)
	ShowSessionParameter(ctx context.Context, parameter SessionParameter) (*Parameter, error)
	ShowUserParameter(ctx context.Context, parameter UserParameter, user AccountObjectIdentifier) (*Parameter, error)
	ShowObjectParameter(ctx context.Context, parameter ObjectParameter, objectType ObjectType, objectID Identifier) (*Parameter, error)

	// Context
	UseWarehouse(ctx context.Context, warehouse AccountObjectIdentifier) error
	UseDatabase(ctx context.Context, database AccountObjectIdentifier) error
	UseSchema(ctx context.Context, schema SchemaIdentifier) error
}

type SetColumnCommentOptions added in v0.66.0

type SetColumnCommentOptions struct {
	IfExists *bool `ddl:"keyword" sql:"IF EXISTS"`

	Column ObjectIdentifier `ddl:"identifier" sql:"COLUMN"`
	Value  *string          `ddl:"parameter,single_quotes,no_equals" sql:"IS"`
	// contains filtered or unexported fields
}

type SetCommentOptions added in v0.66.0

type SetCommentOptions struct {
	IfExists *bool `ddl:"keyword" sql:"IF EXISTS"`

	ObjectType ObjectType       `ddl:"keyword"`
	ObjectName ObjectIdentifier `ddl:"identifier"`
	Value      *string          `ddl:"parameter,single_quotes,no_equals" sql:"IS"`
	// contains filtered or unexported fields
}

type Share added in v0.65.0

type Share struct {
	CreatedOn    time.Time
	Kind         ShareKind
	Name         ExternalObjectIdentifier
	DatabaseName AccountObjectIdentifier
	To           []AccountIdentifier
	Owner        string
	Comment      string
}

func (*Share) ExternalID added in v0.65.0

func (v *Share) ExternalID() ExternalObjectIdentifier

func (*Share) ID added in v0.65.0

func (*Share) ObjectType added in v0.65.0

func (v *Share) ObjectType() ObjectType

type ShareAdd added in v0.65.0

type ShareAdd struct {
	Accounts          []AccountIdentifier `ddl:"parameter" sql:"ACCOUNTS"`
	ShareRestrictions *bool               `ddl:"parameter" sql:"SHARE_RESTRICTIONS"`
}

type ShareDetails added in v0.65.0

type ShareDetails struct {
	SharedObjects []ShareInfo
}

type ShareInfo added in v0.65.0

type ShareInfo struct {
	Kind     ObjectType
	Name     ObjectIdentifier
	SharedOn time.Time
}

type ShareKind added in v0.65.0

type ShareKind string
const (
	ShareKindInbound  ShareKind = "INBOUND"
	ShareKindOutbound ShareKind = "OUTBOUND"
)

type ShareRemove added in v0.65.0

type ShareRemove struct {
	Accounts []AccountIdentifier `ddl:"parameter" sql:"ACCOUNTS"`
}

type ShareSet added in v0.65.0

type ShareSet struct {
	Accounts []AccountIdentifier `ddl:"parameter" sql:"ACCOUNTS"`
	Comment  *string             `ddl:"parameter,single_quotes" sql:"COMMENT"`
	Tag      []TagAssociation    `ddl:"keyword" sql:"TAG"`
}

type ShareUnset added in v0.65.0

type ShareUnset struct {
	Tag     []ObjectIdentifier `ddl:"keyword" sql:"TAG"`
	Comment *bool              `ddl:"keyword" sql:"COMMENT"`
}

type Shares added in v0.65.0

type Shares interface {
	// Create creates a share.
	Create(ctx context.Context, id AccountObjectIdentifier, opts *CreateShareOptions) error
	// Alter modifies an existing share
	Alter(ctx context.Context, id AccountObjectIdentifier, opts *AlterShareOptions) error
	// Drop removes a share.
	Drop(ctx context.Context, id AccountObjectIdentifier) error
	// Show returns a list of shares.
	Show(ctx context.Context, opts *ShowShareOptions) ([]*Share, error)
	// ShowByID returns a share by ID.
	ShowByID(ctx context.Context, id AccountObjectIdentifier) (*Share, error)
	// Describe returns the details of an outbound share.
	DescribeProvider(ctx context.Context, id AccountObjectIdentifier) (*ShareDetails, error)
	// Describe returns the details of an inbound share.
	DescribeConsumer(ctx context.Context, id ExternalObjectIdentifier) (*ShareDetails, error)
}

type ShowAccountOptions added in v0.66.0

type ShowAccountOptions struct {
	Like *Like `ddl:"keyword" sql:"LIKE"`
	// contains filtered or unexported fields
}

type ShowAlertOptions added in v0.68.0

type ShowAlertOptions struct {
	Terse *bool `ddl:"keyword" sql:"TERSE"`

	// optional
	Like       *Like   `ddl:"keyword" sql:"LIKE"`
	In         *In     `ddl:"keyword" sql:"IN"`
	StartsWith *string `ddl:"parameter,no_equals,single_quotes" sql:"STARTS WITH"`
	Limit      *int    `ddl:"parameter,no_equals" sql:"LIMIT"`
	// contains filtered or unexported fields
}

type ShowDatabasesOptions added in v0.66.0

type ShowDatabasesOptions struct {
	Terse *bool `ddl:"keyword" sql:"TERSE"`

	History    *bool      `ddl:"keyword" sql:"HISTORY"`
	Like       *Like      `ddl:"keyword" sql:"LIKE"`
	StartsWith *string    `ddl:"parameter,single_quotes,no_equals" sql:"STARTS WITH"`
	LimitFrom  *LimitFrom `ddl:"keyword" sql:"LIMIT"`
	// contains filtered or unexported fields
}

type ShowFailoverGroupOptions added in v0.66.0

type ShowFailoverGroupOptions struct {
	InAccount AccountIdentifier `ddl:"identifier" sql:"IN ACCOUNT"`
	// contains filtered or unexported fields
}

ShowFailoverGroupOptions represents the options for listing failover groups.

type ShowFileFormatsOptions added in v0.68.0

type ShowFileFormatsOptions struct {
	Like *Like `ddl:"keyword" sql:"LIKE"`
	In   *In   `ddl:"keyword" sql:"IN"`
	// contains filtered or unexported fields
}

type ShowGrantOptions added in v0.66.0

type ShowGrantOptions struct {
	Future *bool `ddl:"keyword" sql:"FUTURE"`

	On *ShowGrantsOn `ddl:"keyword" sql:"ON"`
	To *ShowGrantsTo `ddl:"keyword" sql:"TO"`
	Of *ShowGrantsOf `ddl:"keyword" sql:"OF"`
	In *ShowGrantsIn `ddl:"keyword" sql:"IN"`
	// contains filtered or unexported fields
}

type ShowGrantsIn added in v0.68.0

type ShowGrantsIn struct {
	Schema   *SchemaIdentifier        `ddl:"identifier" sql:"SCHEMA"`
	Database *AccountObjectIdentifier `ddl:"identifier" sql:"DATABASE"`
}

type ShowGrantsOf added in v0.65.0

type ShowGrantsOf struct {
	Role  AccountObjectIdentifier `ddl:"identifier" sql:"ROLE"`
	Share AccountObjectIdentifier `ddl:"identifier" sql:"SHARE"`
}

type ShowGrantsOn added in v0.65.0

type ShowGrantsOn struct {
	Account *bool `ddl:"keyword" sql:"ACCOUNT"`
	Object  *Object
}

type ShowGrantsTo added in v0.65.0

type ShowGrantsTo struct {
	Role  AccountObjectIdentifier `ddl:"identifier" sql:"ROLE"`
	User  AccountObjectIdentifier `ddl:"identifier" sql:"USER"`
	Share AccountObjectIdentifier `ddl:"identifier" sql:"SHARE"`
}

type ShowMaskingPolicyOptions added in v0.66.0

type ShowMaskingPolicyOptions struct {
	Like  *Like `ddl:"keyword" sql:"LIKE"`
	In    *In   `ddl:"keyword" sql:"IN"`
	Limit *int  `ddl:"parameter,no_equals" sql:"LIMIT"`
	// contains filtered or unexported fields
}

ShowMaskingPolicyOptions represents the options for listing masking policies.

type ShowParametersOptions added in v0.65.0

type ShowParametersOptions struct {
	Like *Like         `ddl:"keyword" sql:"LIKE"`
	In   *ParametersIn `ddl:"keyword" sql:"IN"`
	// contains filtered or unexported fields
}

type ShowRegionsOptions added in v0.65.0

type ShowRegionsOptions struct {
	Like *Like `ddl:"keyword" sql:"LIKE"`
	// contains filtered or unexported fields
}

type ShowResourceMonitorOptions added in v0.66.0

type ShowResourceMonitorOptions struct {
	Like *Like `ddl:"keyword" sql:"LIKE"`
	// contains filtered or unexported fields
}

ShowResourceMonitorOptions contains options for listing resource monitors.

type ShowShareOptions added in v0.66.0

type ShowShareOptions struct {
	Like       *Like      `ddl:"keyword" sql:"LIKE"`
	StartsWith *string    `ddl:"parameter,single_quotes,no_equals" sql:"STARTS WITH"`
	Limit      *LimitFrom `ddl:"keyword" sql:"LIMIT"`
	// contains filtered or unexported fields
}

type ShowUserOptions added in v0.66.0

type ShowUserOptions struct{}

ShowUserOptions contains options for listing users.

type ShowWarehouseOptions added in v0.66.0

type ShowWarehouseOptions struct {
	Like *Like `ddl:"keyword" sql:"LIKE"`
	// contains filtered or unexported fields
}

type StringProperty

type StringProperty struct {
	Value        string
	DefaultValue string
	Description  string
}

type SystemFunctions

type SystemFunctions interface {
	GetTag(ctx context.Context, tagID ObjectIdentifier, objectID ObjectIdentifier, objectType ObjectType) (string, error)
}

type Table added in v0.68.0

type Table struct {
	DatabaseName string
	SchemaName   string
	Name         string
}

func (*Table) ID added in v0.68.0

func (v *Table) ID() SchemaObjectIdentifier

func (*Table) ObjectType added in v0.68.0

func (v *Table) ObjectType() ObjectType

type TableColumnIdentifier

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

func NewTableColumnIdentifier

func NewTableColumnIdentifier(databaseName, schemaName, tableName, columnName string) TableColumnIdentifier

func NewTableColumnIdentifierFromFullyQualifiedName

func NewTableColumnIdentifierFromFullyQualifiedName(fullyQualifiedName string) TableColumnIdentifier

func (TableColumnIdentifier) DatabaseName

func (i TableColumnIdentifier) DatabaseName() string

func (TableColumnIdentifier) FullyQualifiedName

func (i TableColumnIdentifier) FullyQualifiedName() string

func (TableColumnIdentifier) Name

func (i TableColumnIdentifier) Name() string

func (TableColumnIdentifier) SchemaName

func (i TableColumnIdentifier) SchemaName() string

func (TableColumnIdentifier) TableName

func (i TableColumnIdentifier) TableName() string

type TableColumnSignature

type TableColumnSignature struct {
	Name string   `ddl:"keyword,double_quotes"`
	Type DataType `ddl:"keyword"`
}

type TableCreateOptions added in v0.68.0

type TableCreateOptions struct{}

placeholder for the real implementation.

type Tag

type Tag struct {
	DatabaseName string
	SchemaName   string
	Name         string
}

func (*Tag) ID

func (v *Tag) ID() SchemaObjectIdentifier

func (*Tag) ObjectType added in v0.65.0

func (v *Tag) ObjectType() ObjectType

type TagAssociation

type TagAssociation struct {
	Name  ObjectIdentifier `ddl:"identifier"`
	Value string           `ddl:"parameter,single_quotes"`
}

type TagCreateOptions

type TagCreateOptions struct{}

placeholder for the real implementation.

type TimeTravel added in v0.66.0

type TimeTravel struct {
	Timestamp *time.Time `ddl:"parameter,single_quotes,arrow_equals" sql:"TIMESTAMP"`
	Offset    *int       `ddl:"parameter,arrow_equals" sql:"OFFSET"`
	Statement *string    `ddl:"parameter,single_quotes,arrow_equals" sql:"STATEMENT"`
}

type TraceLevel added in v0.65.0

type TraceLevel string
const (
	TraceLevelAlways  TraceLevel = "ALWAYS"
	TraceLevelOnEvent TraceLevel = "ON_EVENT"
	TraceLevelOff     TraceLevel = "OFF"
)

type TransactionDefaultIsolationLevel added in v0.65.0

type TransactionDefaultIsolationLevel string
const (
	TransactionDefaultIsolationLevelReadCommitted TransactionDefaultIsolationLevel = "READ COMMITTED"
)

type UnsupportedDDLAction added in v0.65.0

type UnsupportedDDLAction string
const (
	UnsupportedDDLActionIgnore UnsupportedDDLAction = "IGNORE"
	UnsupportedDDLActionFail   UnsupportedDDLAction = "FAIL"
)

type User added in v0.65.0

type User struct{}

func (*User) ID added in v0.65.0

func (v *User) ID() AccountObjectIdentifier

func (*User) ObjectType added in v0.65.0

func (v *User) ObjectType() ObjectType

type UserDetails added in v0.65.0

type UserDetails struct{}

UserDetails contains details about a user.

type UserParameter added in v0.65.0

type UserParameter string
const (
	// User Parameters
	UserParameterEnableUnredactedQuerySyntaxError UserParameter = "ENABLE_UNREDACTED_QUERY_SYNTAX_ERROR"

	// Session Parameters (inherited)
	UserParameterAbortDetachedQuery               UserParameter = "ABORT_DETACHED_QUERY"
	UserParameterAutocommit                       UserParameter = "AUTOCOMMIT"
	UserParameterBinaryInputFormat                UserParameter = "BINARY_INPUT_FORMAT"
	UserParameterBinaryOutputFormat               UserParameter = "BINARY_OUTPUT_FORMAT"
	UserParameterDateInputFormat                  UserParameter = "DATE_INPUT_FORMAT"
	UserParameterDateOutputFormat                 UserParameter = "DATE_OUTPUT_FORMAT"
	UserParameterErrorOnNondeterministicMerge     UserParameter = "ERROR_ON_NONDETERMINISTIC_MERGE"
	UserParameterErrorOnNondeterministicUpdate    UserParameter = "ERROR_ON_NONDETERMINISTIC_UPDATE"
	UserParameterGeographyOutputFormat            UserParameter = "GEOGRAPHY_OUTPUT_FORMAT"
	UserParameterJSONIndent                       UserParameter = "JSON_INDENT"
	UserParameterLockTimeout                      UserParameter = "LOCK_TIMEOUT"
	UserParameterQueryTag                         UserParameter = "QUERY_TAG"
	UserParameterRowsPerResultset                 UserParameter = "ROWS_PER_RESULTSET"
	UserParameterSimulatedDataSharingConsumer     UserParameter = "SIMULATED_DATA_SHARING_CONSUMER"
	UserParameterStatementTimeoutInSeconds        UserParameter = "STATEMENT_TIMEOUT_IN_SECONDS"
	UserParameterStrictJSONOutput                 UserParameter = "STRICT_JSON_OUTPUT"
	UserParameterTimestampDayIsAlways24h          UserParameter = "TIMESTAMP_DAY_IS_ALWAYS_24H"
	UserParameterTimestampInputFormat             UserParameter = "TIMESTAMP_INPUT_FORMAT"
	UserParameterTimestampLTZOutputFormat         UserParameter = "TIMESTAMP_LTZ_OUTPUT_FORMAT"
	UserParameterTimestampNTZOutputFormat         UserParameter = "TIMESTAMP_NTZ_OUTPUT_FORMAT"
	UserParameterTimestampOutputFormat            UserParameter = "TIMESTAMP_OUTPUT_FORMAT"
	UserParameterTimestampTypeMapping             UserParameter = "TIMESTAMP_TYPE_MAPPING"
	UserParameterTimestampTZOutputFormat          UserParameter = "TIMESTAMP_TZ_OUTPUT_FORMAT"
	UserParameterTimezone                         UserParameter = "TIMEZONE"
	UserParameterTimeInputFormat                  UserParameter = "TIME_INPUT_FORMAT"
	UserParameterTimeOutputFormat                 UserParameter = "TIME_OUTPUT_FORMAT"
	UserParameterTransactionDefaultIsolationLevel UserParameter = "TRANSACTION_DEFAULT_ISOLATION_LEVEL"
	UserParameterTwoDigitCenturyStart             UserParameter = "TWO_DIGIT_CENTURY_START"
	UserParameterUnsupportedDDLAction             UserParameter = "UNSUPPORTED_DDL_ACTION"
	UserParameterUseCachedResult                  UserParameter = "USE_CACHED_RESULT"
	UserParameterWeekOfYearPolicy                 UserParameter = "WEEK_OF_YEAR_POLICY"
	UserParameterWeekStart                        UserParameter = "WEEK_START"
)

type UserParameters added in v0.65.0

type UserParameters struct {
	EnableUnredactedQuerySyntaxError *bool `ddl:"parameter" sql:"ENABLE_UNREDACTED_QUERY_SYNTAX_ERROR"`
}

type UserParametersUnset added in v0.65.0

type UserParametersUnset struct {
	EnableUnredactedQuerySyntaxError *bool `ddl:"keyword" sql:"ENABLE_UNREDACTED_QUERY_SYNTAX_ERROR"`
}

type Users added in v0.65.0

type Users interface {
	// Create creates a user.
	Create(ctx context.Context, id AccountObjectIdentifier, opts *CreateUserOptions) error
	// Alter modifies an existing user
	Alter(ctx context.Context, id AccountObjectIdentifier, opts *AlterUserOptions) error
	// Drop removes a user.
	Drop(ctx context.Context, id AccountObjectIdentifier, opts *DropUserOptions) error
	// Describe returns the details of a user.
	Describe(ctx context.Context, id AccountObjectIdentifier) (*UserDetails, error)
	// Show returns a list of users.
	Show(ctx context.Context, opts *ShowUserOptions) ([]*User, error)
	// ShowByID returns a user by ID
	ShowByID(ctx context.Context, id AccountObjectIdentifier) (*User, error)
}

type Warehouse

type Warehouse struct {
	Name                            string
	State                           WarehouseState
	Type                            WarehouseType
	Size                            WarehouseSize
	MinClusterCount                 int
	MaxClusterCount                 int
	StartedClusters                 int
	Running                         int
	Queued                          int
	IsDefault                       bool
	IsCurrent                       bool
	AutoSuspend                     int
	AutoResume                      bool
	Available                       float64
	Provisioning                    float64
	Quiescing                       float64
	Other                           float64
	CreatedOn                       time.Time
	ResumedOn                       time.Time
	UpdatedOn                       time.Time
	Owner                           string
	Comment                         string
	EnableQueryAcceleration         bool
	QueryAccelerationMaxScaleFactor int
	ResourceMonitor                 string
	ScalingPolicy                   ScalingPolicy
}

func (*Warehouse) ID

func (*Warehouse) ObjectType added in v0.65.0

func (v *Warehouse) ObjectType() ObjectType

type WarehouseDetails

type WarehouseDetails struct {
	CreatedOn time.Time
	Name      string
	Kind      string
}

type WarehouseSet added in v0.65.0

type WarehouseSet struct {
	// Object properties
	WarehouseType                   *WarehouseType          `ddl:"parameter,single_quotes" sql:"WAREHOUSE_TYPE"`
	WarehouseSize                   *WarehouseSize          `ddl:"parameter,single_quotes" sql:"WAREHOUSE_SIZE"`
	WaitForCompletion               *bool                   `ddl:"parameter" sql:"WAIT_FOR_COMPLETION"`
	MaxClusterCount                 *int                    `ddl:"parameter" sql:"MAX_CLUSTER_COUNT"`
	MinClusterCount                 *int                    `ddl:"parameter" sql:"MIN_CLUSTER_COUNT"`
	ScalingPolicy                   *ScalingPolicy          `ddl:"parameter,single_quotes" sql:"SCALING_POLICY"`
	AutoSuspend                     *int                    `ddl:"parameter" sql:"AUTO_SUSPEND"`
	AutoResume                      *bool                   `ddl:"parameter" sql:"AUTO_RESUME"`
	ResourceMonitor                 AccountObjectIdentifier `ddl:"identifier,equals" sql:"RESOURCE_MONITOR"`
	Comment                         *string                 `ddl:"parameter,single_quotes" sql:"COMMENT"`
	EnableQueryAcceleration         *bool                   `ddl:"parameter" sql:"ENABLE_QUERY_ACCELERATION"`
	QueryAccelerationMaxScaleFactor *int                    `ddl:"parameter" sql:"QUERY_ACCELERATION_MAX_SCALE_FACTOR"`

	// Object params
	MaxConcurrencyLevel             *int `ddl:"parameter" sql:"MAX_CONCURRENCY_LEVEL"`
	StatementQueuedTimeoutInSeconds *int `ddl:"parameter" sql:"STATEMENT_QUEUED_TIMEOUT_IN_SECONDS"`
	StatementTimeoutInSeconds       *int `ddl:"parameter" sql:"STATEMENT_TIMEOUT_IN_SECONDS"`

	Tag []TagAssociation `ddl:"keyword" sql:"TAG"`
}

type WarehouseSize added in v0.65.0

type WarehouseSize string
var (
	WarehouseSizeXSmall   WarehouseSize = "XSMALL"
	WarehouseSizeSmall    WarehouseSize = "SMALL"
	WarehouseSizeMedium   WarehouseSize = "MEDIUM"
	WarehouseSizeLarge    WarehouseSize = "LARGE"
	WarehouseSizeXLarge   WarehouseSize = "XLARGE"
	WarehouseSizeXXLarge  WarehouseSize = "XXLARGE"
	WarehouseSizeXXXLarge WarehouseSize = "XXXLARGE"
	WarehouseSizeX4Large  WarehouseSize = "X4LARGE"
	WarehouseSizeX5Large  WarehouseSize = "X5LARGE"
	WarehouseSizeX6Large  WarehouseSize = "X6LARGE"
)

func ToWarehouseSize added in v0.66.2

func ToWarehouseSize(s string) (WarehouseSize, error)

type WarehouseState added in v0.65.0

type WarehouseState string
const (
	WarehouseStateSuspended  WarehouseState = "SUSPENDED"
	WarehouseStateSuspending WarehouseState = "SUSPENDING"
	WarehouseStateStarted    WarehouseState = "STARTED"
	WarehouseStateResizing   WarehouseState = "RESIZING"
	WarehouseStateResuming   WarehouseState = "RESUMING"
)

type WarehouseType added in v0.65.0

type WarehouseType string
var (
	WarehouseTypeStandard          WarehouseType = "STANDARD"
	WarehouseTypeSnowparkOptimized WarehouseType = "SNOWPARK-OPTIMIZED"
)

type WarehouseUnset added in v0.65.0

type WarehouseUnset struct {
	// Object properties
	WarehouseType                   *bool `ddl:"keyword" sql:"WAREHOUSE_TYPE"`
	WarehouseSize                   *bool `ddl:"keyword" sql:"WAREHOUSE_SIZE"`
	WaitForCompletion               *bool `ddl:"keyword" sql:"WAIT_FOR_COMPLETION"`
	MaxClusterCount                 *bool `ddl:"keyword" sql:"MAX_CLUSTER_COUNT"`
	MinClusterCount                 *bool `ddl:"keyword" sql:"MIN_CLUSTER_COUNT"`
	ScalingPolicy                   *bool `ddl:"keyword" sql:"SCALING_POLICY"`
	AutoSuspend                     *bool `ddl:"keyword" sql:"AUTO_SUSPEND"`
	AutoResume                      *bool `ddl:"keyword" sql:"AUTO_RESUME"`
	ResourceMonitor                 *bool `ddl:"keyword" sql:"RESOURCE_MONITOR"`
	Comment                         *bool `ddl:"keyword" sql:"COMMENT"`
	EnableQueryAcceleration         *bool `ddl:"keyword" sql:"ENABLE_QUERY_ACCELERATION"`
	QueryAccelerationMaxScaleFactor *bool `ddl:"keyword" sql:"QUERY_ACCELERATION_MAX_SCALE_FACTOR"`

	// Object params
	MaxConcurrencyLevel             *bool              `ddl:"keyword" sql:"MAX_CONCURRENCY_LEVEL"`
	StatementQueuedTimeoutInSeconds *bool              `ddl:"keyword" sql:"STATEMENT_QUEUED_TIMEOUT_IN_SECONDS"`
	StatementTimeoutInSeconds       *bool              `ddl:"keyword" sql:"STATEMENT_TIMEOUT_IN_SECONDS"`
	Tag                             []ObjectIdentifier `ddl:"keyword" sql:"TAG"`
}

type Warehouses

type Warehouses interface {
	// Create creates a warehouse.
	Create(ctx context.Context, id AccountObjectIdentifier, opts *CreateWarehouseOptions) error
	// Alter modifies an existing warehouse
	Alter(ctx context.Context, id AccountObjectIdentifier, opts *AlterWarehouseOptions) error
	// Drop removes a warehouse.
	Drop(ctx context.Context, id AccountObjectIdentifier, opts *DropWarehouseOptions) error
	// Show returns a list of warehouses.
	Show(ctx context.Context, opts *ShowWarehouseOptions) ([]*Warehouse, error)
	// ShowByID returns a warehouse by ID
	ShowByID(ctx context.Context, id AccountObjectIdentifier) (*Warehouse, error)
	// Describe returns the details of a warehouse.
	Describe(ctx context.Context, id AccountObjectIdentifier) (*WarehouseDetails, error)
}

type XMLCompression added in v0.68.0

type XMLCompression string
var (
	XMLCompressionAuto       XMLCompression = "AUTO"
	XMLCompressionGzip       XMLCompression = "GZIP"
	XMLCompressionBz2        XMLCompression = "BZ2"
	XMLCompressionBrotli     XMLCompression = "BROTLI"
	XMLCompressionZstd       XMLCompression = "ZSTD"
	XMLCompressionDeflate    XMLCompression = "DEFLATE"
	XMLCompressionRawDeflate XMLCompression = "RAW_DEFLATE"
	XMLCompressionNone       XMLCompression = "NONE"
)

Jump to

Keyboard shortcuts

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