sdk

package
v0.73.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: MIT Imports: 20 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 (
	ResourceMonitorLevelAccount = iota
	ResourceMonitorLevelWarehouse
	ResourceMonitorLevelNull
)
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 (
	NetworkPoliciesDef = g.NewInterface(
		"NetworkPolicies",
		"NetworkPolicy",
		g.KindOfT[AccountObjectIdentifier](),
	).
		CreateOperation(
			"https://docs.snowflake.com/en/sql-reference/sql/create-network-policy",
			g.QueryStruct("CreateNetworkPolicies").
				Create().
				OrReplace().
				SQL("NETWORK POLICY").
				Name().
				ListQueryStructField("AllowedIpList", ip, g.ParameterOptions().SQL("ALLOWED_IP_LIST").Parentheses()).
				ListQueryStructField("BlockedIpList", ip, g.ParameterOptions().SQL("BLOCKED_IP_LIST").Parentheses()).
				OptionalTextAssignment("COMMENT", g.ParameterOptions().SingleQuotes()).
				WithValidation(g.ValidIdentifier, "name"),
		).
		AlterOperation(
			"https://docs.snowflake.com/en/sql-reference/sql/alter-network-policy",
			g.QueryStruct("AlterNetworkPolicy").
				Alter().
				SQL("NETWORK POLICY").
				IfExists().
				Name().
				OptionalQueryStructField(
					"Set",
					g.QueryStruct("NetworkPolicySet").
						ListQueryStructField("AllowedIpList", ip, g.ParameterOptions().SQL("ALLOWED_IP_LIST").Parentheses()).
						ListQueryStructField("BlockedIpList", ip, g.ParameterOptions().SQL("BLOCKED_IP_LIST").Parentheses()).
						OptionalTextAssignment("COMMENT", g.ParameterOptions().SingleQuotes()).
						WithValidation(g.AtLeastOneValueSet, "AllowedIpList", "BlockedIpList", "Comment"),
					g.KeywordOptions().SQL("SET"),
				).
				OptionalSQL("UNSET COMMENT").
				Identifier("RenameTo", g.KindOfTPointer[AccountObjectIdentifier](), g.IdentifierOptions().SQL("RENAME TO")).
				WithValidation(g.ValidIdentifier, "name").
				WithValidation(g.ExactlyOneValueSet, "Set", "UnsetComment", "RenameTo").
				WithValidation(g.ValidIdentifierIfSet, "RenameTo"),
		).
		DropOperation(
			"https://docs.snowflake.com/en/sql-reference/sql/drop-network-policy",
			g.QueryStruct("DropNetworkPolicy").
				Drop().
				SQL("NETWORK POLICY").
				IfExists().
				Name().
				WithValidation(g.ValidIdentifier, "name"),
		).
		ShowOperation(
			"https://docs.snowflake.com/en/sql-reference/sql/show-network-policies",
			g.DbStruct("showNetworkPolicyDBRow").
				Field("created_on", "string").
				Field("name", "string").
				Field("comment", "string").
				Field("entries_in_allowed_ip_list", "int").
				Field("entries_in_blocked_ip_list", "int"),
			g.PlainStruct("NetworkPolicy").
				Field("CreatedOn", "string").
				Field("Name", "string").
				Field("Comment", "string").
				Field("EntriesInAllowedIpList", "int").
				Field("EntriesInBlockedIpList", "int"),
			g.QueryStruct("ShowNetworkPolicies").
				Show().
				SQL("NETWORK POLICIES"),
		).
		DescribeOperation(
			g.DescriptionMappingKindSlice,
			"https://docs.snowflake.com/en/sql-reference/sql/desc-network-policy",
			g.DbStruct("describeNetworkPolicyDBRow").
				Field("name", "string").
				Field("value", "string"),
			g.PlainStruct("NetworkPolicyDescription").
				Field("Name", "string").
				Field("Value", "string"),
			g.QueryStruct("DescribeNetworkPolicy").
				Describe().
				SQL("NETWORK POLICY").
				Name().
				WithValidation(g.ValidIdentifier, "name"),
		)
)
View Source
var SessionPoliciesDef = g.NewInterface(
	"SessionPolicies",
	"SessionPolicy",
	g.KindOfT[SchemaObjectIdentifier](),
).
	CreateOperation(
		"https://docs.snowflake.com/en/sql-reference/sql/create-session-policy",
		g.QueryStruct("CreateSessionPolicy").
			Create().
			OrReplace().
			SQL("SESSION POLICY").
			IfNotExists().
			Name().
			OptionalNumberAssignment("SESSION_IDLE_TIMEOUT_MINS", g.ParameterOptions().NoQuotes()).
			OptionalNumberAssignment("SESSION_UI_IDLE_TIMEOUT_MINS", g.ParameterOptions().NoQuotes()).
			OptionalTextAssignment("COMMENT", g.ParameterOptions().SingleQuotes()).
			WithValidation(g.ValidIdentifier, "name").
			WithValidation(g.ConflictingFields, "OrReplace", "IfNotExists"),
	).
	AlterOperation(
		"https://docs.snowflake.com/en/sql-reference/sql/alter-session-policy",
		g.QueryStruct("AlterSessionPolicy").
			Alter().
			SQL("SESSION POLICY").
			IfExists().
			Name().
			OptionalIdentifier("RenameTo", g.KindOfT[SchemaObjectIdentifier](), g.IdentifierOptions().SQL("RENAME TO")).
			OptionalQueryStructField(
				"Set",
				g.QueryStruct("SessionPolicySet").
					OptionalNumberAssignment("SESSION_IDLE_TIMEOUT_MINS", g.ParameterOptions().NoQuotes()).
					OptionalNumberAssignment("SESSION_UI_IDLE_TIMEOUT_MINS", g.ParameterOptions().NoQuotes()).
					OptionalTextAssignment("COMMENT", g.ParameterOptions().SingleQuotes()).
					WithValidation(g.AtLeastOneValueSet, "SessionIdleTimeoutMins", "SessionUiIdleTimeoutMins", "Comment"),
				g.KeywordOptions().SQL("SET"),
			).
			SetTags().
			UnsetTags().
			OptionalQueryStructField(
				"Unset",
				g.QueryStruct("SessionPolicyUnset").
					OptionalSQL("SESSION_IDLE_TIMEOUT_MINS").
					OptionalSQL("SESSION_UI_IDLE_TIMEOUT_MINS").
					OptionalSQL("COMMENT").
					WithValidation(g.AtLeastOneValueSet, "SessionIdleTimeoutMins", "SessionUiIdleTimeoutMins", "Comment"),
				g.KeywordOptions().SQL("UNSET"),
			).
			WithValidation(g.ValidIdentifier, "name").
			WithValidation(g.ExactlyOneValueSet, "RenameTo", "Set", "SetTags", "UnsetTags", "Unset"),
	).
	DropOperation(
		"https://docs.snowflake.com/en/sql-reference/sql/drop-session-policy",
		g.QueryStruct("DropSessionPolicy").
			Drop().
			SQL("SESSION POLICY").
			IfExists().
			Name().
			WithValidation(g.ValidIdentifier, "name"),
	).
	ShowOperation(
		"https://docs.snowflake.com/en/sql-reference/sql/show-session-policies",
		g.DbStruct("showSessionPolicyDBRow").
			Field("created_on", "string").
			Field("name", "string").
			Field("database_name", "string").
			Field("schema_name", "string").
			Field("kind", "string").
			Field("owner", "string").
			Field("comment", "string").
			Field("options", "string"),
		g.PlainStruct("SessionPolicy").
			Field("CreatedOn", "string").
			Field("Name", "string").
			Field("DatabaseName", "string").
			Field("SchemaName", "string").
			Field("Kind", "string").
			Field("Owner", "string").
			Field("Comment", "string").
			Field("Options", "string"),
		g.QueryStruct("ShowSessionPolicies").
			Show().
			SQL("SESSION POLICIES"),
	).
	DescribeOperation(
		g.DescriptionMappingKindSingleValue,
		"https://docs.snowflake.com/en/sql-reference/sql/desc-session-policy",
		g.DbStruct("describeSessionPolicyDBRow").
			Field("created_on", "string").
			Field("name", "string").
			Field("session_idle_timeout_mins", "int").
			Field("session_ui_idle_timeout_mins", "int").
			Field("comment", "string"),
		g.PlainStruct("SessionPolicyDescription").
			Field("CreatedOn", "string").
			Field("Name", "string").
			Field("SessionIdleTimeoutMins", "int").
			Field("SessionUIIdleTimeoutMins", "int").
			Field("Comment", "string"),
		g.QueryStruct("DescribeSessionPolicy").
			Describe().
			SQL("SESSION POLICY").
			Name().
			WithValidation(g.ValidIdentifier, "name"),
	)
View Source
var TasksDef = g.NewInterface(
	"Tasks",
	"Task",
	g.KindOfT[SchemaObjectIdentifier](),
).
	CreateOperation(
		"https://docs.snowflake.com/en/sql-reference/sql/create-task",
		g.QueryStruct("CreateTask").
			Create().
			OrReplace().
			SQL("TASK").
			IfNotExists().
			Name().
			OptionalQueryStructField(
				"Warehouse",
				g.QueryStruct("CreateTaskWarehouse").
					OptionalIdentifier("Warehouse", g.KindOfT[AccountObjectIdentifier](), g.IdentifierOptions().Equals().SQL("WAREHOUSE")).
					OptionalAssignment("USER_TASK_MANAGED_INITIAL_WAREHOUSE_SIZE", "WarehouseSize", g.ParameterOptions().SingleQuotes()).
					WithValidation(g.ExactlyOneValueSet, "Warehouse", "UserTaskManagedInitialWarehouseSize"),
				g.KeywordOptions(),
			).
			OptionalTextAssignment("SCHEDULE", g.ParameterOptions().SingleQuotes()).
			OptionalTextAssignment("CONFIG", g.ParameterOptions().NoQuotes()).
			OptionalBooleanAssignment("ALLOW_OVERLAPPING_EXECUTION", nil).
			OptionalSessionParameters().
			OptionalNumberAssignment("USER_TASK_TIMEOUT_MS", nil).
			OptionalNumberAssignment("SUSPEND_TASK_AFTER_NUM_FAILURES", nil).
			OptionalTextAssignment("ERROR_INTEGRATION", g.ParameterOptions().NoQuotes()).
			OptionalSQL("COPY GRANTS").
			OptionalTextAssignment("COMMENT", g.ParameterOptions().SingleQuotes()).
			ListAssignment("AFTER", "SchemaObjectIdentifier", g.ParameterOptions().NoEquals()).
			WithTags().
			OptionalTextAssignment("WHEN", g.ParameterOptions().NoQuotes().NoEquals()).
			SQL("AS").
			Text("sql", g.KeywordOptions().NoQuotes().Required()).
			WithValidation(g.ValidIdentifier, "name").
			WithValidation(g.ConflictingFields, "OrReplace", "IfNotExists"),
	).
	CustomOperation(
		"Clone",
		"https://docs.snowflake.com/en/sql-reference/sql/create-task#variant-syntax",
		g.QueryStruct("CloneTask").
			Create().
			OrReplace().
			SQL("TASK").
			Name().
			SQL("CLONE").
			Identifier("sourceTask", g.KindOfT[SchemaObjectIdentifier](), g.IdentifierOptions().Required()).
			OptionalSQL("COPY GRANTS").
			WithValidation(g.ValidIdentifier, "name").
			WithValidation(g.ValidIdentifier, "sourceTask"),
	).
	AlterOperation(
		"https://docs.snowflake.com/en/sql-reference/sql/alter-task",
		g.QueryStruct("AlterTask").
			Alter().
			SQL("TASK").
			IfExists().
			Name().
			OptionalSQL("RESUME").
			OptionalSQL("SUSPEND").
			ListAssignment("REMOVE AFTER", "SchemaObjectIdentifier", g.ParameterOptions().NoEquals()).
			ListAssignment("ADD AFTER", "SchemaObjectIdentifier", g.ParameterOptions().NoEquals()).
			OptionalQueryStructField(
				"Set",
				g.QueryStruct("TaskSet").
					OptionalIdentifier("Warehouse", g.KindOfT[AccountObjectIdentifier](), g.IdentifierOptions().SQL("WAREHOUSE")).
					OptionalTextAssignment("SCHEDULE", g.ParameterOptions().SingleQuotes()).
					OptionalTextAssignment("CONFIG", g.ParameterOptions().NoQuotes()).
					OptionalBooleanAssignment("ALLOW_OVERLAPPING_EXECUTION", nil).
					OptionalNumberAssignment("USER_TASK_TIMEOUT_MS", nil).
					OptionalNumberAssignment("SUSPEND_TASK_AFTER_NUM_FAILURES", nil).
					OptionalTextAssignment("COMMENT", g.ParameterOptions().SingleQuotes()).
					OptionalSessionParameters().
					WithValidation(g.AtLeastOneValueSet, "Warehouse", "Schedule", "Config", "AllowOverlappingExecution", "UserTaskTimeoutMs", "SuspendTaskAfterNumFailures", "Comment", "SessionParameters"),
				g.KeywordOptions().SQL("SET"),
			).
			OptionalQueryStructField(
				"Unset",
				g.QueryStruct("TaskUnset").
					OptionalSQL("WAREHOUSE").
					OptionalSQL("SCHEDULE").
					OptionalSQL("CONFIG").
					OptionalSQL("ALLOW_OVERLAPPING_EXECUTION").
					OptionalSQL("USER_TASK_TIMEOUT_MS").
					OptionalSQL("SUSPEND_TASK_AFTER_NUM_FAILURES").
					OptionalSQL("COMMENT").
					OptionalSessionParametersUnset().
					WithValidation(g.AtLeastOneValueSet, "Warehouse", "Schedule", "Config", "AllowOverlappingExecution", "UserTaskTimeoutMs", "SuspendTaskAfterNumFailures", "Comment", "SessionParametersUnset"),
				g.KeywordOptions().SQL("UNSET"),
			).
			SetTags().
			UnsetTags().
			OptionalTextAssignment("MODIFY AS", g.ParameterOptions().NoQuotes().NoEquals()).
			OptionalTextAssignment("MODIFY WHEN", g.ParameterOptions().NoQuotes().NoEquals()).
			WithValidation(g.ValidIdentifier, "name").
			WithValidation(g.ExactlyOneValueSet, "Resume", "Suspend", "RemoveAfter", "AddAfter", "Set", "Unset", "SetTags", "UnsetTags", "ModifyAs", "ModifyWhen"),
	).
	DropOperation(
		"https://docs.snowflake.com/en/sql-reference/sql/drop-task",
		g.QueryStruct("DropTask").
			Drop().
			SQL("TASK").
			IfExists().
			Name().
			WithValidation(g.ValidIdentifier, "name"),
	).
	ShowOperation(
		"https://docs.snowflake.com/en/sql-reference/sql/show-tasks",
		taskDbRow,
		task,
		g.QueryStruct("ShowTasks").
			Show().
			Terse().
			SQL("TASKS").
			OptionalLike().
			OptionalIn().
			OptionalStartsWith().
			OptionalSQL("ROOT ONLY").
			OptionalLimit(),
	).
	ShowByIdOperation().
	DescribeOperation(
		g.DescriptionMappingKindSingleValue,
		"https://docs.snowflake.com/en/sql-reference/sql/desc-task",
		taskDbRow,
		task,
		g.QueryStruct("DescribeTask").
			Describe().
			SQL("TASK").
			Name().
			WithValidation(g.ValidIdentifier, "name"),
	).
	CustomOperation(
		"Execute",
		"https://docs.snowflake.com/en/sql-reference/sql/execute-task",
		g.QueryStruct("ExecuteTask").
			SQL("EXECUTE").
			SQL("TASK").
			Name().
			OptionalSQL("RETRY LAST").
			WithValidation(g.ValidIdentifier, "name"),
	)

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 GetValidDateFormats added in v0.71.0

func GetValidDateFormats(f DateFormat, includeAuto bool) []string

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

func ValidateIdentifier added in v0.71.0

func ValidateIdentifier(val interface{}, exclusions []string) (warns []string, errs []error)

ValidateIdentifier implements a strict definition of valid identifiers from https://docs.snowflake.net/manuals/sql-reference/identifiers-syntax.html

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 NewAccountIdentifierFromFullyQualifiedName added in v0.70.1

func NewAccountIdentifierFromFullyQualifiedName(fullyQualifiedName 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"
	AccountParameterPreventLoadFromInlineURL                     AccountParameter = "PREVENT_LOAD_FROM_INLINE_URL"
	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"
	AccountParameterClientMetadataRequestUseConnectionCtx AccountParameter = "CLIENT_METADATA_REQUEST_USE_CONNECTION_CTX"
	AccountParameterClientMetadataUseSessionDatabase      AccountParameter = "CLIENT_METADATA_USE_SESSION_DATABASE"
	AccountParameterClientResultColumnCaseInsensitive     AccountParameter = "CLIENT_RESULT_COLUMN_CASE_INSENSITIVE"
	AccountParameterDateInputFormat                       AccountParameter = "DATE_INPUT_FORMAT"
	AccountParameterGeographyOutputFormat                 AccountParameter = "GEOGRAPHY_OUTPUT_FORMAT"
	AccountParameterDateOutputFormat                      AccountParameter = "DATE_OUTPUT_FORMAT"
	AccountParameterErrorOnNondeterministicMerge          AccountParameter = "ERROR_ON_NONDETERMINISTIC_MERGE"
	AccountParameterErrorOnNondeterministicUpdate         AccountParameter = "ERROR_ON_NONDETERMINISTIC_UPDATE"
	AccountParameterJSONIndent                            AccountParameter = "JSON_INDENT"
	AccountParameterLockTimeout                           AccountParameter = "LOCK_TIMEOUT"
	AccountParameterMultiStatementCount                   AccountParameter = "MULTI_STATEMENT_COUNT"
	AccountParameterQueryTag                              AccountParameter = "QUERY_TAG"
	AccountParameterQuotedIdentifiersIgnoreCase           AccountParameter = "QUOTED_IDENTIFIERS_IGNORE_CASE"
	AccountParameterRowsPerResultset                      AccountParameter = "ROWS_PER_RESULTSET"
	AccountParameterSimulatedDataSharingConsumer          AccountParameter = "SIMULATED_DATA_SHARING_CONSUMER"
	AccountParameterStatementTimeoutInSeconds             AccountParameter = "STATEMENT_TIMEOUT_IN_SECONDS"
	AccountParameterStrictJSONOutput                      AccountParameter = "STRICT_JSON_OUTPUT"
	AccountParameterTimeInputFormat                       AccountParameter = "TIME_INPUT_FORMAT"
	AccountParameterTimeOutputFormat                      AccountParameter = "TIME_OUTPUT_FORMAT"
	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"
	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"`
	EnableUnredactedQuerySyntaxError             *bool    `ddl:"parameter" sql:"ENABLE_UNREDACTED_QUERY_SYNTAX_ERROR"`
	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"`
	PreventLoadFromInlineURL                     *bool    `ddl:"parameter" sql:"PREVENT_LOAD_FROM_INLINE_URL"`
	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"`
}

AccountParameters is based on https://docs.snowflake.com/en/sql-reference/parameters#account-parameters.

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(ctx context.Context, id AccountObjectIdentifier, opts *CreateAccountOptions) error
	Alter(ctx context.Context, opts *AlterAccountOptions) error
	Show(ctx context.Context, opts *ShowAccountOptions) ([]Account, error)
	ShowByID(ctx context.Context, id AccountObjectIdentifier) (*Account, error)
	Drop(ctx context.Context, id AccountObjectIdentifier, gracePeriodInDays int, opts *DropAccountOptions) error
	Undrop(ctx context.Context, id AccountObjectIdentifier) error
}

type AddDelegatedAuthorization added in v0.70.0

type AddDelegatedAuthorization struct {
	Role        string `ddl:"parameter,no_equals" sql:"ADD DELEGATED AUTHORIZATION OF ROLE"`
	Integration string `ddl:"parameter,no_equals" sql:"TO SECURITY INTEGRATION"`
}

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 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
}

AlterAccountOptions is based on https://docs.snowflake.com/en/sql-reference/sql/alter-account.

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
}

AlterAlertOptions is based on https://docs.snowflake.com/en/sql-reference/sql/alter-alert.

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
}

AlterDatabaseFailoverOptions is based on https://docs.snowflake.com/en/sql-reference/sql/alter-database.

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
}

AlterDatabaseOptions is based on https://docs.snowflake.com/en/sql-reference/sql/alter-database.

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
}

AlterDatabaseReplicationOptions is based on https://docs.snowflake.com/en/sql-reference/sql/alter-database.

type AlterDatabaseRoleRequest added in v0.70.0

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

func NewAlterDatabaseRoleRequest added in v0.70.0

func NewAlterDatabaseRoleRequest(
	name DatabaseObjectIdentifier,
) *AlterDatabaseRoleRequest

func (*AlterDatabaseRoleRequest) WithIfExists added in v0.70.0

func (s *AlterDatabaseRoleRequest) WithIfExists(ifExists bool) *AlterDatabaseRoleRequest

func (*AlterDatabaseRoleRequest) WithRename added in v0.70.0

func (*AlterDatabaseRoleRequest) WithSetComment added in v0.70.0

func (s *AlterDatabaseRoleRequest) WithSetComment(comment string) *AlterDatabaseRoleRequest

func (*AlterDatabaseRoleRequest) WithUnsetComment added in v0.70.0

func (s *AlterDatabaseRoleRequest) WithUnsetComment() *AlterDatabaseRoleRequest

type AlterDynamicTableRequest added in v0.72.0

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

func NewAlterDynamicTableRequest added in v0.72.0

func NewAlterDynamicTableRequest(
	name SchemaObjectIdentifier,
) *AlterDynamicTableRequest

func (*AlterDynamicTableRequest) WithRefresh added in v0.72.0

func (s *AlterDynamicTableRequest) WithRefresh(refresh *bool) *AlterDynamicTableRequest

func (*AlterDynamicTableRequest) WithResume added in v0.72.0

func (s *AlterDynamicTableRequest) WithResume(resume *bool) *AlterDynamicTableRequest

func (*AlterDynamicTableRequest) WithSet added in v0.72.0

func (*AlterDynamicTableRequest) WithSuspend added in v0.72.0

func (s *AlterDynamicTableRequest) WithSuspend(suspend *bool) *AlterDynamicTableRequest

type AlterExternalTableOptions added in v0.72.0

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

	// One of
	Refresh     *RefreshExternalTable `ddl:"keyword" sql:"REFRESH"`
	AddFiles    []ExternalTableFile   `ddl:"keyword,no_quotes,parentheses" sql:"ADD FILES"`
	RemoveFiles []ExternalTableFile   `ddl:"keyword,no_quotes,parentheses" sql:"REMOVE FILES"`
	AutoRefresh *bool                 `ddl:"parameter" sql:"SET AUTO_REFRESH"`
	SetTag      []TagAssociation      `ddl:"keyword" sql:"SET TAG"`
	UnsetTag    []ObjectIdentifier    `ddl:"keyword" sql:"UNSET TAG"`
	// contains filtered or unexported fields
}

AlterExternalTableOptions based on https://docs.snowflake.com/en/sql-reference/sql/alter-external-table

type AlterExternalTablePartitionOptions added in v0.72.0

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

	AddPartitions []Partition `ddl:"keyword,parentheses" sql:"ADD PARTITION"`
	DropPartition *bool       `ddl:"keyword" sql:"DROP PARTITION"`
	Location      string      `ddl:"parameter,no_equals,single_quotes" sql:"LOCATION"`
	// contains filtered or unexported fields
}

AlterExternalTablePartitionOptions based on https://docs.snowflake.com/en/sql-reference/sql/alter-external-table

type AlterExternalTablePartitionRequest added in v0.72.0

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

func NewAlterExternalTablePartitionRequest added in v0.72.0

func NewAlterExternalTablePartitionRequest(
	name AccountObjectIdentifier,
) *AlterExternalTablePartitionRequest

func (*AlterExternalTablePartitionRequest) WithAddPartitions added in v0.72.0

func (*AlterExternalTablePartitionRequest) WithDropPartition added in v0.72.0

func (s *AlterExternalTablePartitionRequest) WithDropPartition(dropPartition *bool) *AlterExternalTablePartitionRequest

func (*AlterExternalTablePartitionRequest) WithIfExists added in v0.72.0

func (*AlterExternalTablePartitionRequest) WithLocation added in v0.72.0

type AlterExternalTableRequest added in v0.72.0

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

func NewAlterExternalTableRequest added in v0.72.0

func NewAlterExternalTableRequest(
	name AccountObjectIdentifier,
) *AlterExternalTableRequest

func (*AlterExternalTableRequest) WithAddFiles added in v0.72.0

func (*AlterExternalTableRequest) WithAutoRefresh added in v0.72.0

func (s *AlterExternalTableRequest) WithAutoRefresh(autoRefresh *bool) *AlterExternalTableRequest

func (*AlterExternalTableRequest) WithIfExists added in v0.72.0

func (s *AlterExternalTableRequest) WithIfExists(ifExists *bool) *AlterExternalTableRequest

func (*AlterExternalTableRequest) WithRefresh added in v0.72.0

func (*AlterExternalTableRequest) WithRemoveFiles added in v0.72.0

func (*AlterExternalTableRequest) WithSetTag added in v0.72.0

func (*AlterExternalTableRequest) WithUnsetTag added in v0.72.0

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
}

AlterFileFormatOptions is based on https://docs.snowflake.com/en/sql-reference/sql/alter-file-format.

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
}

AlterMaskingPolicyOptions is based on https://docs.snowflake.com/en/sql-reference/sql/alter-masking-policy.

type AlterNetworkPolicyOptions added in v0.72.0

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

	Set          *NetworkPolicySet        `ddl:"keyword" sql:"SET"`
	UnsetComment *bool                    `ddl:"keyword" sql:"UNSET COMMENT"`
	RenameTo     *AccountObjectIdentifier `ddl:"identifier" sql:"RENAME TO"`
	// contains filtered or unexported fields
}

AlterNetworkPolicyOptions is based on https://docs.snowflake.com/en/sql-reference/sql/alter-network-policy.

type AlterNetworkPolicyRequest added in v0.72.0

type AlterNetworkPolicyRequest struct {
	IfExists *bool

	Set          *NetworkPolicySetRequest
	UnsetComment *bool
	RenameTo     *AccountObjectIdentifier
	// contains filtered or unexported fields
}

func NewAlterNetworkPolicyRequest added in v0.72.0

func NewAlterNetworkPolicyRequest(
	name AccountObjectIdentifier,
) *AlterNetworkPolicyRequest

func (*AlterNetworkPolicyRequest) WithIfExists added in v0.72.0

func (s *AlterNetworkPolicyRequest) WithIfExists(IfExists *bool) *AlterNetworkPolicyRequest

func (*AlterNetworkPolicyRequest) WithRenameTo added in v0.72.0

func (*AlterNetworkPolicyRequest) WithSet added in v0.72.0

func (*AlterNetworkPolicyRequest) WithUnsetComment added in v0.72.0

func (s *AlterNetworkPolicyRequest) WithUnsetComment(UnsetComment *bool) *AlterNetworkPolicyRequest

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
}

AlterPasswordPolicyOptions is based on https://docs.snowflake.com/en/sql-reference/sql/alter-password-policy.

type AlterPipeOptions added in v0.72.0

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

	// One of
	Set       *PipeSet       `ddl:"list,no_parentheses" sql:"SET"`
	Unset     *PipeUnset     `ddl:"list,no_parentheses" sql:"UNSET"`
	SetTags   *PipeSetTags   `ddl:"list,no_parentheses" sql:"SET TAG"`
	UnsetTags *PipeUnsetTags `ddl:"list,no_parentheses" sql:"UNSET TAG"`
	Refresh   *PipeRefresh   `ddl:"keyword" sql:"REFRESH"`
	// contains filtered or unexported fields
}

AlterPipeOptions is based on https://docs.snowflake.com/en/sql-reference/sql/alter-pipe.

type AlterResourceMonitorOptions added in v0.66.0

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

	Set         *ResourceMonitorSet `ddl:"keyword" sql:"SET"`
	NotifyUsers *NotifyUsers        `ddl:"parameter,equals" sql:"NOTIFY_USERS"`
	Triggers    []TriggerDefinition `ddl:"keyword,no_comma" sql:"TRIGGERS"`
	// contains filtered or unexported fields
}

AlterResourceMonitorOptions is based on https://docs.snowflake.com/en/sql-reference/sql/alter-resource-monitor.

type AlterRoleOptions added in v0.72.0

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

	// One of
	RenameTo     *AccountObjectIdentifier `ddl:"identifier" sql:"RENAME TO"`
	SetComment   *string                  `ddl:"parameter,single_quotes" sql:"SET COMMENT"`
	SetTags      []TagAssociation         `ddl:"keyword" sql:"SET TAG"`
	UnsetComment *bool                    `ddl:"keyword" sql:"UNSET COMMENT"`
	UnsetTags    []ObjectIdentifier       `ddl:"keyword" sql:"UNSET TAG"`
	// contains filtered or unexported fields
}

AlterRoleOptions based on https://docs.snowflake.com/en/sql-reference/sql/alter-role

type AlterRoleRequest added in v0.72.0

type AlterRoleRequest struct {
	IfExists *bool

	RenameTo     *AccountObjectIdentifier
	SetComment   *string
	SetTags      []TagAssociation
	UnsetComment *bool
	UnsetTags    []ObjectIdentifier
	// contains filtered or unexported fields
}

func NewAlterRoleRequest added in v0.72.0

func NewAlterRoleRequest(name AccountObjectIdentifier) *AlterRoleRequest

func (*AlterRoleRequest) WithIfExists added in v0.72.0

func (s *AlterRoleRequest) WithIfExists(ifExists bool) *AlterRoleRequest

func (*AlterRoleRequest) WithRenameTo added in v0.72.0

func (s *AlterRoleRequest) WithRenameTo(renameTo AccountObjectIdentifier) *AlterRoleRequest

func (*AlterRoleRequest) WithSetComment added in v0.72.0

func (s *AlterRoleRequest) WithSetComment(setComment string) *AlterRoleRequest

func (*AlterRoleRequest) WithSetTags added in v0.72.0

func (s *AlterRoleRequest) WithSetTags(setTags []TagAssociation) *AlterRoleRequest

func (*AlterRoleRequest) WithUnsetComment added in v0.72.0

func (s *AlterRoleRequest) WithUnsetComment(unsetComment bool) *AlterRoleRequest

func (*AlterRoleRequest) WithUnsetTags added in v0.72.0

func (s *AlterRoleRequest) WithUnsetTags(unsetTags []ObjectIdentifier) *AlterRoleRequest

type AlterSchemaOptions added in v0.70.0

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

	NewName  DatabaseObjectIdentifier `ddl:"identifier" sql:"RENAME TO"`
	SwapWith DatabaseObjectIdentifier `ddl:"identifier" sql:"SWAP WITH"`
	Set      *SchemaSet               `ddl:"list,no_parentheses" sql:"SET"`
	Unset    *SchemaUnset             `ddl:"list,no_parentheses" sql:"UNSET"`
	// One of
	EnableManagedAccess  *bool `ddl:"keyword" sql:"ENABLE MANAGED ACCESS"`
	DisableManagedAccess *bool `ddl:"keyword" sql:"DISABLE MANAGED ACCESS"`
	// contains filtered or unexported fields
}

AlterSchemaOptions based on https://docs.snowflake.com/en/sql-reference/sql/alter-schema

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
}

AlterSessionOptions is based on https://docs.snowflake.com/en/sql-reference/sql/alter-session.

type AlterSessionPolicyOptions added in v0.66.0

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

	RenameTo  *SchemaObjectIdentifier `ddl:"identifier" sql:"RENAME TO"`
	Set       *SessionPolicySet       `ddl:"keyword" sql:"SET"`
	SetTags   []TagAssociation        `ddl:"keyword" sql:"SET TAG"`
	UnsetTags []ObjectIdentifier      `ddl:"keyword" sql:"UNSET TAG"`
	Unset     *SessionPolicyUnset     `ddl:"keyword" sql:"UNSET"`
	// contains filtered or unexported fields
}

AlterSessionPolicyOptions is based on https://docs.snowflake.com/en/sql-reference/sql/alter-session-policy.

type AlterSessionPolicyRequest added in v0.72.0

type AlterSessionPolicyRequest struct {
	IfExists *bool

	RenameTo  *SchemaObjectIdentifier
	Set       *SessionPolicySetRequest
	SetTags   []TagAssociation
	UnsetTags []ObjectIdentifier
	Unset     *SessionPolicyUnsetRequest
	// contains filtered or unexported fields
}

func NewAlterSessionPolicyRequest added in v0.72.0

func NewAlterSessionPolicyRequest(
	name SchemaObjectIdentifier,
) *AlterSessionPolicyRequest

func (*AlterSessionPolicyRequest) WithIfExists added in v0.72.0

func (s *AlterSessionPolicyRequest) WithIfExists(IfExists *bool) *AlterSessionPolicyRequest

func (*AlterSessionPolicyRequest) WithRenameTo added in v0.72.0

func (*AlterSessionPolicyRequest) WithSet added in v0.72.0

func (*AlterSessionPolicyRequest) WithSetTags added in v0.72.0

func (*AlterSessionPolicyRequest) WithUnset added in v0.72.0

func (*AlterSessionPolicyRequest) WithUnsetTags added in v0.72.0

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
}

AlterShareOptions is based on https://docs.snowflake.com/en/sql-reference/sql/alter-share.

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
}

AlterSourceFailoverGroupOptions is based on https://docs.snowflake.com/en/sql-reference/sql/alter-failover-group.

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
}

AlterTargetFailoverGroupOptions is based on https://docs.snowflake.com/en/sql-reference/sql/alter-failover-group.

type AlterTaskOptions added in v0.73.0

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

	Resume      *bool                    `ddl:"keyword" sql:"RESUME"`
	Suspend     *bool                    `ddl:"keyword" sql:"SUSPEND"`
	RemoveAfter []SchemaObjectIdentifier `ddl:"parameter,no_equals" sql:"REMOVE AFTER"`
	AddAfter    []SchemaObjectIdentifier `ddl:"parameter,no_equals" sql:"ADD AFTER"`
	Set         *TaskSet                 `ddl:"keyword" sql:"SET"`
	Unset       *TaskUnset               `ddl:"keyword" sql:"UNSET"`
	SetTags     []TagAssociation         `ddl:"keyword" sql:"SET TAG"`
	UnsetTags   []ObjectIdentifier       `ddl:"keyword" sql:"UNSET TAG"`
	ModifyAs    *string                  `ddl:"parameter,no_quotes,no_equals" sql:"MODIFY AS"`
	ModifyWhen  *string                  `ddl:"parameter,no_quotes,no_equals" sql:"MODIFY WHEN"`
	// contains filtered or unexported fields
}

AlterTaskOptions is based on https://docs.snowflake.com/en/sql-reference/sql/alter-task.

type AlterTaskRequest added in v0.73.0

type AlterTaskRequest struct {
	IfExists *bool

	Resume      *bool
	Suspend     *bool
	RemoveAfter []SchemaObjectIdentifier
	AddAfter    []SchemaObjectIdentifier
	Set         *TaskSetRequest
	Unset       *TaskUnsetRequest
	SetTags     []TagAssociation
	UnsetTags   []ObjectIdentifier
	ModifyAs    *string
	ModifyWhen  *string
	// contains filtered or unexported fields
}

func NewAlterTaskRequest added in v0.73.0

func NewAlterTaskRequest(
	name SchemaObjectIdentifier,
) *AlterTaskRequest

func (*AlterTaskRequest) WithAddAfter added in v0.73.0

func (s *AlterTaskRequest) WithAddAfter(AddAfter []SchemaObjectIdentifier) *AlterTaskRequest

func (*AlterTaskRequest) WithIfExists added in v0.73.0

func (s *AlterTaskRequest) WithIfExists(IfExists *bool) *AlterTaskRequest

func (*AlterTaskRequest) WithModifyAs added in v0.73.0

func (s *AlterTaskRequest) WithModifyAs(ModifyAs *string) *AlterTaskRequest

func (*AlterTaskRequest) WithModifyWhen added in v0.73.0

func (s *AlterTaskRequest) WithModifyWhen(ModifyWhen *string) *AlterTaskRequest

func (*AlterTaskRequest) WithRemoveAfter added in v0.73.0

func (s *AlterTaskRequest) WithRemoveAfter(RemoveAfter []SchemaObjectIdentifier) *AlterTaskRequest

func (*AlterTaskRequest) WithResume added in v0.73.0

func (s *AlterTaskRequest) WithResume(Resume *bool) *AlterTaskRequest

func (*AlterTaskRequest) WithSet added in v0.73.0

func (*AlterTaskRequest) WithSetTags added in v0.73.0

func (s *AlterTaskRequest) WithSetTags(SetTags []TagAssociation) *AlterTaskRequest

func (*AlterTaskRequest) WithSuspend added in v0.73.0

func (s *AlterTaskRequest) WithSuspend(Suspend *bool) *AlterTaskRequest

func (*AlterTaskRequest) WithUnset added in v0.73.0

func (s *AlterTaskRequest) WithUnset(Unset *TaskUnsetRequest) *AlterTaskRequest

func (*AlterTaskRequest) WithUnsetTags added in v0.73.0

func (s *AlterTaskRequest) WithUnsetTags(UnsetTags []ObjectIdentifier) *AlterTaskRequest

type AlterUserOptions added in v0.66.0

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

	// one of
	NewName                      AccountObjectIdentifier       `ddl:"identifier" sql:"RENAME TO"`
	ResetPassword                *bool                         `ddl:"keyword" sql:"RESET PASSWORD"`
	AbortAllQueries              *bool                         `ddl:"keyword" sql:"ABORT ALL QUERIES"`
	AddDelegatedAuthorization    *AddDelegatedAuthorization    `ddl:"keyword"`
	RemoveDelegatedAuthorization *RemoveDelegatedAuthorization `ddl:"keyword"`
	Set                          *UserSet                      `ddl:"keyword" sql:"SET"`
	Unset                        *UserUnset                    `ddl:"keyword" sql:"UNSET"`
	// contains filtered or unexported fields
}

AlterUserOptions is based on https://docs.snowflake.com/en/sql-reference/sql/alter-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
}

AlterWarehouseOptions is based on https://docs.snowflake.com/en/sql-reference/sql/alter-warehouse.

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 BinaryOutputFormat added in v0.71.0

type BinaryOutputFormat string
const (
	BinaryOutputFormatHex    BinaryOutputFormat = "HEX"
	BinaryOutputFormatBase64 BinaryOutputFormat = "BASE64"
)

type BoolProperty added in v0.70.0

type BoolProperty struct {
	Value        bool
	DefaultValue bool
	Description  string
}

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
	DatabaseRoles    DatabaseRoles
	DynamicTables    DynamicTables
	ExternalTables   ExternalTables
	FailoverGroups   FailoverGroups
	FileFormats      FileFormats
	Grants           Grants
	MaskingPolicies  MaskingPolicies
	NetworkPolicies  NetworkPolicies
	Parameters       Parameters
	PasswordPolicies PasswordPolicies
	Pipes            Pipes
	ResourceMonitors ResourceMonitors
	Roles            Roles
	SessionPolicies  SessionPolicies
	Sessions         Sessions
	Shares           Shares
	Tasks            Tasks
	Users            Users
	Schemas          Schemas
	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 CloneTaskOptions added in v0.73.0

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

	CopyGrants *bool `ddl:"keyword" sql:"COPY GRANTS"`
	// contains filtered or unexported fields
}

CloneTaskOptions is based on https://docs.snowflake.com/en/sql-reference/sql/create-task#variant-syntax.

type CloneTaskRequest added in v0.73.0

type CloneTaskRequest struct {
	OrReplace *bool

	CopyGrants *bool
	// contains filtered or unexported fields
}

func NewCloneTaskRequest added in v0.73.0

func NewCloneTaskRequest(
	name SchemaObjectIdentifier,
	sourceTask SchemaObjectIdentifier,
) *CloneTaskRequest

func (*CloneTaskRequest) WithCopyGrants added in v0.73.0

func (s *CloneTaskRequest) WithCopyGrants(CopyGrants *bool) *CloneTaskRequest

func (*CloneTaskRequest) WithOrReplace added in v0.73.0

func (s *CloneTaskRequest) WithOrReplace(OrReplace *bool) *CloneTaskRequest

type CloudProviderParams added in v0.72.0

type CloudProviderParams struct {
	// One of
	GoogleCloudStorageIntegration *string `ddl:"parameter,single_quotes" sql:"INTEGRATION"`
	MicrosoftAzureIntegration     *string `ddl:"parameter,single_quotes" sql:"INTEGRATION"`
}

type CloudProviderParamsRequest added in v0.72.0

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

func NewCloudProviderParamsRequest added in v0.72.0

func NewCloudProviderParamsRequest() *CloudProviderParamsRequest

func (*CloudProviderParamsRequest) WithGoogleCloudStorageIntegration added in v0.72.0

func (s *CloudProviderParamsRequest) WithGoogleCloudStorageIntegration(googleCloudStorageIntegration *string) *CloudProviderParamsRequest

func (*CloudProviderParamsRequest) WithMicrosoftAzureIntegration added in v0.72.0

func (s *CloudProviderParamsRequest) WithMicrosoftAzureIntegration(microsoftAzureIntegration *string) *CloudProviderParamsRequest

type CloudType added in v0.65.0

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

type ColumnConstraintType added in v0.72.0

type ColumnConstraintType string
var (
	ColumnConstraintTypeUnique     ColumnConstraintType = "UNIQUE"
	ColumnConstraintTypePrimaryKey ColumnConstraintType = "PRIMARY KEY"
	ColumnConstraintTypeForeignKey ColumnConstraintType = "FOREIGN KEY"
)

type ColumnInlineConstraint added in v0.72.0

type ColumnInlineConstraint struct {
	NotNull    *bool                 `ddl:"keyword" sql:"NOT NULL"`
	Name       *string               `ddl:"parameter,no_equals" sql:"CONSTRAINT"`
	Type       *ColumnConstraintType `ddl:"keyword"`
	ForeignKey *InlineForeignKey     `ddl:"keyword" sql:"FOREIGN KEY"`

	// optional
	Enforced           *bool `ddl:"keyword" sql:"ENFORCED"`
	NotEnforced        *bool `ddl:"keyword" sql:"NOT ENFORCED"`
	Deferrable         *bool `ddl:"keyword" sql:"DEFERRABLE"`
	NotDeferrable      *bool `ddl:"keyword" sql:"NOT DEFERRABLE"`
	InitiallyDeferred  *bool `ddl:"keyword" sql:"INITIALLY DEFERRED"`
	InitiallyImmediate *bool `ddl:"keyword" sql:"INITIALLY IMMEDIATE"`
	Enable             *bool `ddl:"keyword" sql:"ENABLE"`
	Disable            *bool `ddl:"keyword" sql:"DISABLE"`
	Validate           *bool `ddl:"keyword" sql:"VALIDATE"`
	NoValidate         *bool `ddl:"keyword" sql:"NOVALIDATE"`
	Rely               *bool `ddl:"keyword" sql:"RELY"`
	NoRely             *bool `ddl:"keyword" sql:"NORELY"`
}

type ColumnInlineConstraintRequest added in v0.72.0

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

func NewColumnInlineConstraintRequest added in v0.72.0

func NewColumnInlineConstraintRequest(
	name string,
	constraintType ColumnConstraintType,
) *ColumnInlineConstraintRequest

func (*ColumnInlineConstraintRequest) WithDeferrable added in v0.72.0

func (s *ColumnInlineConstraintRequest) WithDeferrable(deferrable *bool) *ColumnInlineConstraintRequest

func (*ColumnInlineConstraintRequest) WithDisable added in v0.72.0

func (*ColumnInlineConstraintRequest) WithEnable added in v0.72.0

func (*ColumnInlineConstraintRequest) WithEnforced added in v0.72.0

func (*ColumnInlineConstraintRequest) WithForeignKey added in v0.72.0

func (*ColumnInlineConstraintRequest) WithInitiallyDeferred added in v0.72.0

func (s *ColumnInlineConstraintRequest) WithInitiallyDeferred(initiallyDeferred *bool) *ColumnInlineConstraintRequest

func (*ColumnInlineConstraintRequest) WithInitiallyImmediate added in v0.72.0

func (s *ColumnInlineConstraintRequest) WithInitiallyImmediate(initiallyImmediate *bool) *ColumnInlineConstraintRequest

func (*ColumnInlineConstraintRequest) WithNoRely added in v0.72.0

func (*ColumnInlineConstraintRequest) WithNoValidate added in v0.72.0

func (s *ColumnInlineConstraintRequest) WithNoValidate(noValidate *bool) *ColumnInlineConstraintRequest

func (*ColumnInlineConstraintRequest) WithNotDeferrable added in v0.72.0

func (s *ColumnInlineConstraintRequest) WithNotDeferrable(notDeferrable *bool) *ColumnInlineConstraintRequest

func (*ColumnInlineConstraintRequest) WithNotEnforced added in v0.72.0

func (s *ColumnInlineConstraintRequest) WithNotEnforced(notEnforced *bool) *ColumnInlineConstraintRequest

func (*ColumnInlineConstraintRequest) WithNotNull added in v0.72.0

func (*ColumnInlineConstraintRequest) WithRely added in v0.72.0

func (*ColumnInlineConstraintRequest) WithValidate added in v0.72.0

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)
	CurrentSecondaryRoles(ctx context.Context) (*CurrentSecondaryRoles, 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
}

CreateAccountOptions is based on https://docs.snowflake.com/en/sql-reference/sql/create-account.

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
}

CreateAlertOptions is based on https://docs.snowflake.com/en/sql-reference/sql/create-alert.

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
}

CreateDatabaseOptions is based on https://docs.snowflake.com/en/sql-reference/sql/create-database.

type CreateDatabaseRoleRequest added in v0.70.0

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

func NewCreateDatabaseRoleRequest added in v0.70.0

func NewCreateDatabaseRoleRequest(
	name DatabaseObjectIdentifier,
) *CreateDatabaseRoleRequest

func (*CreateDatabaseRoleRequest) WithComment added in v0.70.0

func (*CreateDatabaseRoleRequest) WithIfNotExists added in v0.70.0

func (s *CreateDatabaseRoleRequest) WithIfNotExists(ifNotExists bool) *CreateDatabaseRoleRequest

func (*CreateDatabaseRoleRequest) WithOrReplace added in v0.70.0

func (s *CreateDatabaseRoleRequest) WithOrReplace(orReplace bool) *CreateDatabaseRoleRequest

type CreateDeltaLakeExternalTableOptions added in v0.72.0

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

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

	Columns                    []ExternalTableColumn `ddl:"list,parentheses"`
	CloudProviderParams        *CloudProviderParams
	PartitionBy                []string                  `ddl:"keyword,parentheses" sql:"PARTITION BY"`
	Location                   string                    `ddl:"parameter" sql:"LOCATION"`
	RefreshOnCreate            *bool                     `ddl:"parameter" sql:"REFRESH_ON_CREATE"`
	AutoRefresh                *bool                     `ddl:"parameter" sql:"AUTO_REFRESH"`
	UserSpecifiedPartitionType *bool                     `ddl:"keyword" sql:"PARTITION_TYPE = USER_SPECIFIED"`
	FileFormat                 []ExternalTableFileFormat `ddl:"parameter,parentheses" sql:"FILE_FORMAT"`
	DeltaTableFormat           *bool                     `ddl:"keyword" sql:"TABLE_FORMAT = DELTA"`
	CopyGrants                 *bool                     `ddl:"keyword" sql:"COPY GRANTS"`
	Comment                    *string                   `ddl:"parameter,single_quotes" sql:"COMMENT"`
	RowAccessPolicy            *RowAccessPolicy          `ddl:"keyword"`
	Tag                        []TagAssociation          `ddl:"keyword,parentheses" sql:"TAG"`
	// contains filtered or unexported fields
}

CreateDeltaLakeExternalTableOptions based on https://docs.snowflake.com/en/sql-reference/sql/create-external-table

type CreateDeltaLakeExternalTableRequest added in v0.72.0

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

func NewCreateDeltaLakeExternalTableRequest added in v0.72.0

func NewCreateDeltaLakeExternalTableRequest(
	name AccountObjectIdentifier,
	location string,
	fileFormat *ExternalTableFileFormatRequest,
) *CreateDeltaLakeExternalTableRequest

func (*CreateDeltaLakeExternalTableRequest) WithAutoRefresh added in v0.72.0

func (*CreateDeltaLakeExternalTableRequest) WithCloudProviderParams added in v0.72.0

func (*CreateDeltaLakeExternalTableRequest) WithColumns added in v0.72.0

func (*CreateDeltaLakeExternalTableRequest) WithComment added in v0.72.0

func (*CreateDeltaLakeExternalTableRequest) WithCopyGrants added in v0.72.0

func (*CreateDeltaLakeExternalTableRequest) WithDeltaTableFormat added in v0.72.0

func (s *CreateDeltaLakeExternalTableRequest) WithDeltaTableFormat(deltaTableFormat *bool) *CreateDeltaLakeExternalTableRequest

func (*CreateDeltaLakeExternalTableRequest) WithIfNotExists added in v0.72.0

func (*CreateDeltaLakeExternalTableRequest) WithOrReplace added in v0.72.0

func (*CreateDeltaLakeExternalTableRequest) WithPartitionBy added in v0.72.0

func (*CreateDeltaLakeExternalTableRequest) WithRefreshOnCreate added in v0.72.0

func (s *CreateDeltaLakeExternalTableRequest) WithRefreshOnCreate(refreshOnCreate *bool) *CreateDeltaLakeExternalTableRequest

func (*CreateDeltaLakeExternalTableRequest) WithRowAccessPolicy added in v0.72.0

func (*CreateDeltaLakeExternalTableRequest) WithTag added in v0.72.0

func (*CreateDeltaLakeExternalTableRequest) WithUserSpecifiedPartitionType added in v0.72.0

func (s *CreateDeltaLakeExternalTableRequest) WithUserSpecifiedPartitionType(userSpecifiedPartitionType *bool) *CreateDeltaLakeExternalTableRequest

type CreateDynamicTableRequest added in v0.72.0

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

func NewCreateDynamicTableRequest added in v0.72.0

func NewCreateDynamicTableRequest(
	name SchemaObjectIdentifier,
	warehouse AccountObjectIdentifier,
	targetLag TargetLag,
	query string,
) *CreateDynamicTableRequest

func (*CreateDynamicTableRequest) WithComment added in v0.72.0

func (*CreateDynamicTableRequest) WithOrReplace added in v0.72.0

func (s *CreateDynamicTableRequest) WithOrReplace(orReplace bool) *CreateDynamicTableRequest

type CreateExternalTableOptions added in v0.72.0

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

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

	Columns             []ExternalTableColumn `ddl:"list,parentheses"`
	CloudProviderParams *CloudProviderParams
	PartitionBy         []string                  `ddl:"keyword,parentheses" sql:"PARTITION BY"`
	Location            string                    `ddl:"parameter" sql:"LOCATION"`
	RefreshOnCreate     *bool                     `ddl:"parameter" sql:"REFRESH_ON_CREATE"`
	AutoRefresh         *bool                     `ddl:"parameter" sql:"AUTO_REFRESH"`
	Pattern             *string                   `ddl:"parameter,single_quotes" sql:"PATTERN"`
	FileFormat          []ExternalTableFileFormat `ddl:"parameter,parentheses" sql:"FILE_FORMAT"`
	AwsSnsTopic         *string                   `ddl:"parameter,single_quotes" sql:"AWS_SNS_TOPIC"`
	CopyGrants          *bool                     `ddl:"keyword" sql:"COPY GRANTS"`
	Comment             *string                   `ddl:"parameter,single_quotes" sql:"COMMENT"`
	RowAccessPolicy     *RowAccessPolicy          `ddl:"keyword"`
	Tag                 []TagAssociation          `ddl:"keyword,parentheses" sql:"TAG"`
	// contains filtered or unexported fields
}

CreateExternalTableOptions based on https://docs.snowflake.com/en/sql-reference/sql/create-external-table

type CreateExternalTableRequest added in v0.72.0

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

func NewCreateExternalTableRequest added in v0.72.0

func NewCreateExternalTableRequest(
	name AccountObjectIdentifier,
	location string,
	fileFormat *ExternalTableFileFormatRequest,
) *CreateExternalTableRequest

func (*CreateExternalTableRequest) WithAutoRefresh added in v0.72.0

func (s *CreateExternalTableRequest) WithAutoRefresh(autoRefresh *bool) *CreateExternalTableRequest

func (*CreateExternalTableRequest) WithAwsSnsTopic added in v0.72.0

func (s *CreateExternalTableRequest) WithAwsSnsTopic(awsSnsTopic *string) *CreateExternalTableRequest

func (*CreateExternalTableRequest) WithCloudProviderParams added in v0.72.0

func (s *CreateExternalTableRequest) WithCloudProviderParams(cloudProviderParams *CloudProviderParamsRequest) *CreateExternalTableRequest

func (*CreateExternalTableRequest) WithColumns added in v0.72.0

func (*CreateExternalTableRequest) WithComment added in v0.72.0

func (*CreateExternalTableRequest) WithCopyGrants added in v0.72.0

func (s *CreateExternalTableRequest) WithCopyGrants(copyGrants *bool) *CreateExternalTableRequest

func (*CreateExternalTableRequest) WithIfNotExists added in v0.72.0

func (s *CreateExternalTableRequest) WithIfNotExists(ifNotExists *bool) *CreateExternalTableRequest

func (*CreateExternalTableRequest) WithOrReplace added in v0.72.0

func (s *CreateExternalTableRequest) WithOrReplace(orReplace *bool) *CreateExternalTableRequest

func (*CreateExternalTableRequest) WithPartitionBy added in v0.72.0

func (s *CreateExternalTableRequest) WithPartitionBy(partitionBy []string) *CreateExternalTableRequest

func (*CreateExternalTableRequest) WithPattern added in v0.72.0

func (*CreateExternalTableRequest) WithRefreshOnCreate added in v0.72.0

func (s *CreateExternalTableRequest) WithRefreshOnCreate(refreshOnCreate *bool) *CreateExternalTableRequest

func (*CreateExternalTableRequest) WithRowAccessPolicy added in v0.72.0

func (s *CreateExternalTableRequest) WithRowAccessPolicy(rowAccessPolicy *RowAccessPolicyRequest) *CreateExternalTableRequest

func (*CreateExternalTableRequest) WithTag added in v0.72.0

type CreateExternalTableUsingTemplateOptions added in v0.72.0

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

	CopyGrants          *bool    `ddl:"keyword" sql:"COPY GRANTS"`
	Query               []string `ddl:"parameter,no_equals,parentheses" sql:"USING TEMPLATE"`
	CloudProviderParams *CloudProviderParams
	PartitionBy         []string                  `ddl:"keyword,parentheses" sql:"PARTITION BY"`
	Location            string                    `ddl:"parameter" sql:"LOCATION"`
	RefreshOnCreate     *bool                     `ddl:"parameter" sql:"REFRESH_ON_CREATE"`
	AutoRefresh         *bool                     `ddl:"parameter" sql:"AUTO_REFRESH"`
	Pattern             *string                   `ddl:"parameter,single_quotes" sql:"PATTERN"`
	FileFormat          []ExternalTableFileFormat `ddl:"parameter,parentheses" sql:"FILE_FORMAT"`
	AwsSnsTopic         *string                   `ddl:"parameter,single_quotes" sql:"AWS_SNS_TOPIC"`
	Comment             *string                   `ddl:"parameter,single_quotes" sql:"COMMENT"`
	RowAccessPolicy     *RowAccessPolicy          `ddl:"keyword"`
	Tag                 []TagAssociation          `ddl:"keyword,parentheses" sql:"TAG"`
	// contains filtered or unexported fields
}

CreateExternalTableUsingTemplateOptions based on https://docs.snowflake.com/en/sql-reference/sql/create-external-table#variant-syntax

type CreateExternalTableUsingTemplateRequest added in v0.72.0

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

func NewCreateExternalTableUsingTemplateRequest added in v0.72.0

func NewCreateExternalTableUsingTemplateRequest(
	name AccountObjectIdentifier,
	location string,
	fileFormat *ExternalTableFileFormatRequest,
) *CreateExternalTableUsingTemplateRequest

func (*CreateExternalTableUsingTemplateRequest) WithAutoRefresh added in v0.72.0

func (*CreateExternalTableUsingTemplateRequest) WithAwsSnsTopic added in v0.72.0

func (*CreateExternalTableUsingTemplateRequest) WithCloudProviderParams added in v0.72.0

func (*CreateExternalTableUsingTemplateRequest) WithComment added in v0.72.0

func (*CreateExternalTableUsingTemplateRequest) WithCopyGrants added in v0.72.0

func (*CreateExternalTableUsingTemplateRequest) WithOrReplace added in v0.72.0

func (*CreateExternalTableUsingTemplateRequest) WithPartitionBy added in v0.72.0

func (*CreateExternalTableUsingTemplateRequest) WithPattern added in v0.72.0

func (*CreateExternalTableUsingTemplateRequest) WithQuery added in v0.72.0

func (*CreateExternalTableUsingTemplateRequest) WithRefreshOnCreate added in v0.72.0

func (*CreateExternalTableUsingTemplateRequest) WithRowAccessPolicy added in v0.72.0

func (*CreateExternalTableUsingTemplateRequest) WithTag added in v0.72.0

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
}

CreateFailoverGroupOptions is based on https://docs.snowflake.com/en/sql-reference/sql/create-failover-group.

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
}

CreateFileFormatOptions is based on https://docs.snowflake.com/en/sql-reference/sql/create-file-format.

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
}

CreateMaskingPolicyOptions is based on https://docs.snowflake.com/en/sql-reference/sql/create-masking-policy.

type CreateNetworkPolicyOptions added in v0.72.0

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

	AllowedIpList []IP    `ddl:"parameter,parentheses" sql:"ALLOWED_IP_LIST"`
	BlockedIpList []IP    `ddl:"parameter,parentheses" sql:"BLOCKED_IP_LIST"`
	Comment       *string `ddl:"parameter,single_quotes" sql:"COMMENT"`
	// contains filtered or unexported fields
}

CreateNetworkPolicyOptions is based on https://docs.snowflake.com/en/sql-reference/sql/create-network-policy.

type CreateNetworkPolicyRequest added in v0.72.0

type CreateNetworkPolicyRequest struct {
	OrReplace *bool

	AllowedIpList []IPRequest
	BlockedIpList []IPRequest
	Comment       *string
	// contains filtered or unexported fields
}

func NewCreateNetworkPolicyRequest added in v0.72.0

func NewCreateNetworkPolicyRequest(
	name AccountObjectIdentifier,
) *CreateNetworkPolicyRequest

func (*CreateNetworkPolicyRequest) WithAllowedIpList added in v0.72.0

func (s *CreateNetworkPolicyRequest) WithAllowedIpList(AllowedIpList []IPRequest) *CreateNetworkPolicyRequest

func (*CreateNetworkPolicyRequest) WithBlockedIpList added in v0.72.0

func (s *CreateNetworkPolicyRequest) WithBlockedIpList(BlockedIpList []IPRequest) *CreateNetworkPolicyRequest

func (*CreateNetworkPolicyRequest) WithComment added in v0.72.0

func (*CreateNetworkPolicyRequest) WithOrReplace added in v0.72.0

func (s *CreateNetworkPolicyRequest) WithOrReplace(OrReplace *bool) *CreateNetworkPolicyRequest

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
}

CreatePasswordPolicyOptions is based on https://docs.snowflake.com/en/sql-reference/sql/create-password-policy.

type CreatePipeOptions added in v0.72.0

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

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

	AutoIngest       *bool   `ddl:"parameter" sql:"AUTO_INGEST"`
	ErrorIntegration *string `ddl:"parameter,no_quotes" sql:"ERROR_INTEGRATION"`
	AwsSnsTopic      *string `ddl:"parameter,single_quotes" sql:"AWS_SNS_TOPIC"`
	Integration      *string `ddl:"parameter,single_quotes" sql:"INTEGRATION"`
	Comment          *string `ddl:"parameter,single_quotes" sql:"COMMENT"`
	// contains filtered or unexported fields
}

CreatePipeOptions is based on https://docs.snowflake.com/en/sql-reference/sql/create-pipe.

type CreateResourceMonitorOptions added in v0.66.0

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

	With *ResourceMonitorWith `ddl:"keyword" sql:"WITH"`
	// contains filtered or unexported fields
}

CreateResourceMonitorOptions is based on https://docs.snowflake.com/en/sql-reference/sql/create-resource-monitor.

type CreateRoleOptions added in v0.72.0

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

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

	Comment *string          `ddl:"parameter,single_quotes" sql:"COMMENT"`
	Tag     []TagAssociation `ddl:"keyword,parentheses" sql:"TAG"`
	// contains filtered or unexported fields
}

CreateRoleOptions based on https://docs.snowflake.com/en/sql-reference/sql/create-role

type CreateRoleRequest added in v0.72.0

type CreateRoleRequest struct {
	OrReplace   *bool
	IfNotExists *bool

	Comment *string
	Tag     []TagAssociation
	// contains filtered or unexported fields
}

func NewCreateRoleRequest added in v0.72.0

func NewCreateRoleRequest(name AccountObjectIdentifier) *CreateRoleRequest

func (*CreateRoleRequest) WithComment added in v0.72.0

func (s *CreateRoleRequest) WithComment(comment string) *CreateRoleRequest

func (*CreateRoleRequest) WithIfNotExists added in v0.72.0

func (s *CreateRoleRequest) WithIfNotExists(ifNotExists bool) *CreateRoleRequest

func (*CreateRoleRequest) WithOrReplace added in v0.72.0

func (s *CreateRoleRequest) WithOrReplace(orReplace bool) *CreateRoleRequest

func (*CreateRoleRequest) WithTag added in v0.72.0

type CreateSchemaOptions added in v0.70.0

type CreateSchemaOptions 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:"-"`
	WithManagedAccess          *bool            `ddl:"keyword" sql:"WITH MANAGED ACCESS"`
	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"`
	Tag                        []TagAssociation `ddl:"keyword,parentheses" sql:"TAG"`
	Comment                    *string          `ddl:"parameter,single_quotes" sql:"COMMENT"`
	// contains filtered or unexported fields
}

CreateSchemaOptions based on https://docs.snowflake.com/en/sql-reference/sql/create-schema

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
}

CreateSecondaryDatabaseOptions is based on https://docs.snowflake.com/en/sql-reference/sql/create-database.

type CreateSecondaryReplicationGroupOptions added in v0.66.0

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

CreateSecondaryReplicationGroupOptions is based on https://docs.snowflake.com/en/sql-reference/sql/create-failover-group.

type CreateSessionPolicyOptions added in v0.66.0

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

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

	SessionIdleTimeoutMins   *int    `ddl:"parameter,no_quotes" sql:"SESSION_IDLE_TIMEOUT_MINS"`
	SessionUiIdleTimeoutMins *int    `ddl:"parameter,no_quotes" sql:"SESSION_UI_IDLE_TIMEOUT_MINS"`
	Comment                  *string `ddl:"parameter,single_quotes" sql:"COMMENT"`
	// contains filtered or unexported fields
}

CreateSessionPolicyOptions is based on https://docs.snowflake.com/en/sql-reference/sql/create-session-policy.

type CreateSessionPolicyRequest added in v0.72.0

type CreateSessionPolicyRequest struct {
	OrReplace   *bool
	IfNotExists *bool

	SessionIdleTimeoutMins   *int
	SessionUiIdleTimeoutMins *int
	Comment                  *string
	// contains filtered or unexported fields
}

func NewCreateSessionPolicyRequest added in v0.72.0

func NewCreateSessionPolicyRequest(
	name SchemaObjectIdentifier,
) *CreateSessionPolicyRequest

func (*CreateSessionPolicyRequest) WithComment added in v0.72.0

func (*CreateSessionPolicyRequest) WithIfNotExists added in v0.72.0

func (s *CreateSessionPolicyRequest) WithIfNotExists(IfNotExists *bool) *CreateSessionPolicyRequest

func (*CreateSessionPolicyRequest) WithOrReplace added in v0.72.0

func (s *CreateSessionPolicyRequest) WithOrReplace(OrReplace *bool) *CreateSessionPolicyRequest

func (*CreateSessionPolicyRequest) WithSessionIdleTimeoutMins added in v0.72.0

func (s *CreateSessionPolicyRequest) WithSessionIdleTimeoutMins(SessionIdleTimeoutMins *int) *CreateSessionPolicyRequest

func (*CreateSessionPolicyRequest) WithSessionUiIdleTimeoutMins added in v0.72.0

func (s *CreateSessionPolicyRequest) WithSessionUiIdleTimeoutMins(SessionUiIdleTimeoutMins *int) *CreateSessionPolicyRequest

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
}

CreateShareOptions is based on https://docs.snowflake.com/en/sql-reference/sql/create-share.

type CreateSharedDatabaseOptions added in v0.66.0

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

CreateSharedDatabaseOptions is based on https://docs.snowflake.com/en/sql-reference/sql/create-database.

type CreateTableOptions added in v0.72.0

type CreateTableOptions struct{}

placeholder for the real implementation.

type CreateTagOptions added in v0.72.0

type CreateTagOptions struct{}

placeholder for the real implementation.

type CreateTaskOptions added in v0.73.0

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

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

	Warehouse                   *CreateTaskWarehouse     `ddl:"keyword"`
	Schedule                    *string                  `ddl:"parameter,single_quotes" sql:"SCHEDULE"`
	Config                      *string                  `ddl:"parameter,no_quotes" sql:"CONFIG"`
	AllowOverlappingExecution   *bool                    `ddl:"parameter" sql:"ALLOW_OVERLAPPING_EXECUTION"`
	SessionParameters           *SessionParameters       `ddl:"list,no_parentheses"`
	UserTaskTimeoutMs           *int                     `ddl:"parameter" sql:"USER_TASK_TIMEOUT_MS"`
	SuspendTaskAfterNumFailures *int                     `ddl:"parameter" sql:"SUSPEND_TASK_AFTER_NUM_FAILURES"`
	ErrorIntegration            *string                  `ddl:"parameter,no_quotes" sql:"ERROR_INTEGRATION"`
	CopyGrants                  *bool                    `ddl:"keyword" sql:"COPY GRANTS"`
	Comment                     *string                  `ddl:"parameter,single_quotes" sql:"COMMENT"`
	After                       []SchemaObjectIdentifier `ddl:"parameter,no_equals" sql:"AFTER"`
	Tag                         []TagAssociation         `ddl:"keyword,parentheses" sql:"TAG"`
	When                        *string                  `ddl:"parameter,no_quotes,no_equals" sql:"WHEN"`
	// contains filtered or unexported fields
}

CreateTaskOptions is based on https://docs.snowflake.com/en/sql-reference/sql/create-task.

type CreateTaskRequest added in v0.73.0

type CreateTaskRequest struct {
	OrReplace   *bool
	IfNotExists *bool

	Warehouse                   *CreateTaskWarehouseRequest
	Schedule                    *string
	Config                      *string
	AllowOverlappingExecution   *bool
	SessionParameters           *SessionParameters
	UserTaskTimeoutMs           *int
	SuspendTaskAfterNumFailures *int
	ErrorIntegration            *string
	CopyGrants                  *bool
	Comment                     *string
	After                       []SchemaObjectIdentifier
	Tag                         []TagAssociation
	When                        *string
	// contains filtered or unexported fields
}

func NewCreateTaskRequest added in v0.73.0

func NewCreateTaskRequest(
	name SchemaObjectIdentifier,
	sql string,
) *CreateTaskRequest

func (*CreateTaskRequest) WithAfter added in v0.73.0

func (*CreateTaskRequest) WithAllowOverlappingExecution added in v0.73.0

func (s *CreateTaskRequest) WithAllowOverlappingExecution(AllowOverlappingExecution *bool) *CreateTaskRequest

func (*CreateTaskRequest) WithComment added in v0.73.0

func (s *CreateTaskRequest) WithComment(Comment *string) *CreateTaskRequest

func (*CreateTaskRequest) WithConfig added in v0.73.0

func (s *CreateTaskRequest) WithConfig(Config *string) *CreateTaskRequest

func (*CreateTaskRequest) WithCopyGrants added in v0.73.0

func (s *CreateTaskRequest) WithCopyGrants(CopyGrants *bool) *CreateTaskRequest

func (*CreateTaskRequest) WithErrorIntegration added in v0.73.0

func (s *CreateTaskRequest) WithErrorIntegration(ErrorIntegration *string) *CreateTaskRequest

func (*CreateTaskRequest) WithIfNotExists added in v0.73.0

func (s *CreateTaskRequest) WithIfNotExists(IfNotExists *bool) *CreateTaskRequest

func (*CreateTaskRequest) WithOrReplace added in v0.73.0

func (s *CreateTaskRequest) WithOrReplace(OrReplace *bool) *CreateTaskRequest

func (*CreateTaskRequest) WithSchedule added in v0.73.0

func (s *CreateTaskRequest) WithSchedule(Schedule *string) *CreateTaskRequest

func (*CreateTaskRequest) WithSessionParameters added in v0.73.0

func (s *CreateTaskRequest) WithSessionParameters(SessionParameters *SessionParameters) *CreateTaskRequest

func (*CreateTaskRequest) WithSuspendTaskAfterNumFailures added in v0.73.0

func (s *CreateTaskRequest) WithSuspendTaskAfterNumFailures(SuspendTaskAfterNumFailures *int) *CreateTaskRequest

func (*CreateTaskRequest) WithTag added in v0.73.0

func (*CreateTaskRequest) WithUserTaskTimeoutMs added in v0.73.0

func (s *CreateTaskRequest) WithUserTaskTimeoutMs(UserTaskTimeoutMs *int) *CreateTaskRequest

func (*CreateTaskRequest) WithWarehouse added in v0.73.0

func (s *CreateTaskRequest) WithWarehouse(Warehouse *CreateTaskWarehouseRequest) *CreateTaskRequest

func (*CreateTaskRequest) WithWhen added in v0.73.0

func (s *CreateTaskRequest) WithWhen(When *string) *CreateTaskRequest

type CreateTaskWarehouse added in v0.73.0

type CreateTaskWarehouse struct {
	Warehouse                           *AccountObjectIdentifier `ddl:"identifier,equals" sql:"WAREHOUSE"`
	UserTaskManagedInitialWarehouseSize *WarehouseSize           `ddl:"parameter,single_quotes" sql:"USER_TASK_MANAGED_INITIAL_WAREHOUSE_SIZE"`
}

type CreateTaskWarehouseRequest added in v0.73.0

type CreateTaskWarehouseRequest struct {
	Warehouse                           *AccountObjectIdentifier
	UserTaskManagedInitialWarehouseSize *WarehouseSize
}

func NewCreateTaskWarehouseRequest added in v0.73.0

func NewCreateTaskWarehouseRequest() *CreateTaskWarehouseRequest

func (*CreateTaskWarehouseRequest) WithUserTaskManagedInitialWarehouseSize added in v0.73.0

func (s *CreateTaskWarehouseRequest) WithUserTaskManagedInitialWarehouseSize(UserTaskManagedInitialWarehouseSize *WarehouseSize) *CreateTaskWarehouseRequest

func (*CreateTaskWarehouseRequest) WithWarehouse added in v0.73.0

type CreateUserOptions added in v0.66.0

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

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

	ObjectProperties  *UserObjectProperties `ddl:"keyword"`
	ObjectParameters  *UserObjectParameters `ddl:"keyword"`
	SessionParameters *SessionParameters    `ddl:"keyword"`
	With              *bool                 `ddl:"keyword" sql:"WITH"`
	Tags              []TagAssociation      `ddl:"keyword,parentheses" sql:"TAG"`
	// contains filtered or unexported fields
}

CreateUserOptions is based on https://docs.snowflake.com/en/sql-reference/sql/create-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
}

CreateWarehouseOptions is based on https://docs.snowflake.com/en/sql-reference/sql/create-warehouse.

type CreateWithManualPartitioningExternalTableOptions added in v0.72.0

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

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

	Columns                    []ExternalTableColumn `ddl:"list,parentheses"`
	CloudProviderParams        *CloudProviderParams
	PartitionBy                []string                  `ddl:"keyword,parentheses" sql:"PARTITION BY"`
	Location                   string                    `ddl:"parameter" sql:"LOCATION"`
	UserSpecifiedPartitionType *bool                     `ddl:"keyword" sql:"PARTITION_TYPE = USER_SPECIFIED"`
	FileFormat                 []ExternalTableFileFormat `ddl:"parameter,parentheses" sql:"FILE_FORMAT"`
	CopyGrants                 *bool                     `ddl:"keyword" sql:"COPY GRANTS"`
	Comment                    *string                   `ddl:"parameter,single_quotes" sql:"COMMENT"`
	RowAccessPolicy            *RowAccessPolicy          `ddl:"keyword"`
	Tag                        []TagAssociation          `ddl:"keyword,parentheses" sql:"TAG"`
	// contains filtered or unexported fields
}

CreateWithManualPartitioningExternalTableOptions based on https://docs.snowflake.com/en/sql-reference/sql/create-external-table

type CreateWithManualPartitioningExternalTableRequest added in v0.72.0

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

func NewCreateWithManualPartitioningExternalTableRequest added in v0.72.0

func NewCreateWithManualPartitioningExternalTableRequest(
	name AccountObjectIdentifier,
	location string,
	fileFormat *ExternalTableFileFormatRequest,
) *CreateWithManualPartitioningExternalTableRequest

func (*CreateWithManualPartitioningExternalTableRequest) WithCloudProviderParams added in v0.72.0

func (*CreateWithManualPartitioningExternalTableRequest) WithColumns added in v0.72.0

func (*CreateWithManualPartitioningExternalTableRequest) WithComment added in v0.72.0

func (*CreateWithManualPartitioningExternalTableRequest) WithCopyGrants added in v0.72.0

func (*CreateWithManualPartitioningExternalTableRequest) WithIfNotExists added in v0.72.0

func (*CreateWithManualPartitioningExternalTableRequest) WithOrReplace added in v0.72.0

func (*CreateWithManualPartitioningExternalTableRequest) WithPartitionBy added in v0.72.0

func (*CreateWithManualPartitioningExternalTableRequest) WithRowAccessPolicy added in v0.72.0

func (*CreateWithManualPartitioningExternalTableRequest) WithTag added in v0.72.0

func (*CreateWithManualPartitioningExternalTableRequest) WithUserSpecifiedPartitionType added in v0.72.0

func (s *CreateWithManualPartitioningExternalTableRequest) WithUserSpecifiedPartitionType(userSpecifiedPartitionType *bool) *CreateWithManualPartitioningExternalTableRequest

type CurrentSecondaryRoles added in v0.72.0

type CurrentSecondaryRoles struct {
	Roles []AccountObjectIdentifier
	Value SecondaryRoleOption
}

type DataType

type DataType string
const (
	DataTypeNumber       DataType = "NUMBER"
	DataTypeFloat        DataType = "FLOAT"
	DataTypeVARCHAR      DataType = "VARCHAR"
	DataTypeString       DataType = "STRING"
	DataTypeBinary       DataType = "BINARY"
	DataTypeBoolean      DataType = "BOOLEAN"
	DataTypeDate         DataType = "DATE"
	DataTypeTime         DataType = "TIME"
	DataTypeTimestamp    DataType = "TIMESTAMP"
	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 DatabaseObjectIdentifier added in v0.70.0

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

func NewDatabaseObjectIdentifier added in v0.70.0

func NewDatabaseObjectIdentifier(databaseName, name string) DatabaseObjectIdentifier

func NewDatabaseObjectIdentifierFromFullyQualifiedName added in v0.70.0

func NewDatabaseObjectIdentifierFromFullyQualifiedName(fullyQualifiedName string) DatabaseObjectIdentifier

func (DatabaseObjectIdentifier) DatabaseName added in v0.70.0

func (i DatabaseObjectIdentifier) DatabaseName() string

func (DatabaseObjectIdentifier) FullyQualifiedName added in v0.70.0

func (i DatabaseObjectIdentifier) FullyQualifiedName() string

func (DatabaseObjectIdentifier) Name added in v0.70.0

type DatabaseRole added in v0.70.0

type DatabaseRole struct {
	CreatedOn              string
	Name                   string
	IsDefault              bool
	IsCurrent              bool
	IsInherited            bool
	GrantedToRoles         int
	GrantedToDatabaseRoles int
	GrantedDatabaseRoles   int
	Owner                  string
	Comment                string
	OwnerRoleType          string
}

DatabaseRole is a user-friendly result for a SHOW DATABASE ROLES query. At the time of writing there is no format specified in the docs.

type DatabaseRoleGrantOn added in v0.71.0

type DatabaseRoleGrantOn struct {
	Database     *AccountObjectIdentifier `ddl:"identifier" sql:"DATABASE"`
	Schema       *GrantOnSchema           `ddl:"-"`
	SchemaObject *GrantOnSchemaObject     `ddl:"-"`
}

type DatabaseRoleGrantPrivileges added in v0.71.0

type DatabaseRoleGrantPrivileges struct {
	DatabasePrivileges     []AccountObjectPrivilege `ddl:"-"`
	SchemaPrivileges       []SchemaPrivilege        `ddl:"-"`
	SchemaObjectPrivileges []SchemaObjectPrivilege  `ddl:"-"`
}

type DatabaseRoleRename added in v0.70.0

type DatabaseRoleRename struct {
	Name DatabaseObjectIdentifier `ddl:"identifier"`
}

type DatabaseRoleRenameRequest added in v0.70.0

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

func NewDatabaseRoleRenameRequest added in v0.70.0

func NewDatabaseRoleRenameRequest(
	name DatabaseObjectIdentifier,
) *DatabaseRoleRenameRequest

type DatabaseRoleSet added in v0.70.0

type DatabaseRoleSet struct {
	Comment string `ddl:"parameter,single_quotes" sql:"COMMENT"`
}

type DatabaseRoleSetRequest added in v0.70.0

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

func NewDatabaseRoleSetRequest added in v0.70.0

func NewDatabaseRoleSetRequest(
	comment string,
) *DatabaseRoleSetRequest

type DatabaseRoleUnset added in v0.70.0

type DatabaseRoleUnset struct {
	Comment bool `ddl:"keyword" sql:"COMMENT"`
}

type DatabaseRoleUnsetRequest added in v0.70.0

type DatabaseRoleUnsetRequest struct{}

func NewDatabaseRoleUnsetRequest added in v0.70.0

func NewDatabaseRoleUnsetRequest() *DatabaseRoleUnsetRequest

type DatabaseRoles added in v0.70.0

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 DateFormat added in v0.71.0

type DateFormat string
const (
	DateFormatISO   DateFormat = "DateFormatISO"
	DateFormatOther DateFormat = "DateFormatOther"
	DateFormatAny   DateFormat = "DateFormatAny"
)

type DescribeDynamicTableRequest added in v0.72.0

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

func NewDescribeDynamicTableRequest added in v0.72.0

func NewDescribeDynamicTableRequest(
	name SchemaObjectIdentifier,
) *DescribeDynamicTableRequest

type DescribeExternalTableColumnsRequest added in v0.72.0

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

func NewDescribeExternalTableColumnsRequest added in v0.72.0

func NewDescribeExternalTableColumnsRequest(
	id AccountObjectIdentifier,
) *DescribeExternalTableColumnsRequest

type DescribeExternalTableStageRequest added in v0.72.0

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

func NewDescribeExternalTableStageRequest added in v0.72.0

func NewDescribeExternalTableStageRequest(
	id AccountObjectIdentifier,
) *DescribeExternalTableStageRequest

type DescribeNetworkPolicyOptions added in v0.72.0

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

DescribeNetworkPolicyOptions is based on https://docs.snowflake.com/en/sql-reference/sql/desc-network-policy.

type DescribeNetworkPolicyRequest added in v0.72.0

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

func NewDescribeNetworkPolicyRequest added in v0.72.0

func NewDescribeNetworkPolicyRequest(
	name AccountObjectIdentifier,
) *DescribeNetworkPolicyRequest

type DescribeSessionPolicyOptions added in v0.72.0

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

DescribeSessionPolicyOptions is based on https://docs.snowflake.com/en/sql-reference/sql/desc-session-policy.

type DescribeSessionPolicyRequest added in v0.72.0

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

func NewDescribeSessionPolicyRequest added in v0.72.0

func NewDescribeSessionPolicyRequest(
	name SchemaObjectIdentifier,
) *DescribeSessionPolicyRequest

type DescribeTaskOptions added in v0.73.0

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

DescribeTaskOptions is based on https://docs.snowflake.com/en/sql-reference/sql/desc-task.

type DescribeTaskRequest added in v0.73.0

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

func NewDescribeTaskRequest added in v0.73.0

func NewDescribeTaskRequest(
	name SchemaObjectIdentifier,
) *DescribeTaskRequest

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 DropAccountOptions added in v0.72.0

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

DropAccountOptions is based on https://docs.snowflake.com/en/sql-reference/sql/drop-account.

type DropDatabaseOptions added in v0.66.0

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

DropDatabaseOptions is based on https://docs.snowflake.com/en/sql-reference/sql/drop-database.

type DropDatabaseRoleRequest added in v0.70.0

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

func NewDropDatabaseRoleRequest added in v0.70.0

func NewDropDatabaseRoleRequest(
	name DatabaseObjectIdentifier,
) *DropDatabaseRoleRequest

func (*DropDatabaseRoleRequest) WithIfExists added in v0.70.0

func (s *DropDatabaseRoleRequest) WithIfExists(ifExists bool) *DropDatabaseRoleRequest

type DropDynamicTableRequest added in v0.72.0

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

func NewDropDynamicTableRequest added in v0.72.0

func NewDropDynamicTableRequest(
	name SchemaObjectIdentifier,
) *DropDynamicTableRequest

type DropExternalTableOptions added in v0.72.0

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

	DropOption *ExternalTableDropOption
	// contains filtered or unexported fields
}

DropExternalTableOptions based on https://docs.snowflake.com/en/sql-reference/sql/drop-external-table

type DropExternalTableRequest added in v0.72.0

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

func NewDropExternalTableRequest added in v0.72.0

func NewDropExternalTableRequest(
	name AccountObjectIdentifier,
) *DropExternalTableRequest

func (*DropExternalTableRequest) WithDropOption added in v0.72.0

func (*DropExternalTableRequest) WithIfExists added in v0.72.0

func (s *DropExternalTableRequest) WithIfExists(ifExists *bool) *DropExternalTableRequest

type DropFailoverGroupOptions added in v0.66.0

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

DropFailoverGroupOptions is based on https://docs.snowflake.com/en/sql-reference/sql/drop-failover-group.

type DropFileFormatOptions added in v0.68.0

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

DropFileFormatOptions is based on https://docs.snowflake.com/en/sql-reference/sql/drop-file-format.

type DropMaskingPolicyOptions added in v0.66.0

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

DropMaskingPolicyOptions is based on https://docs.snowflake.com/en/sql-reference/sql/drop-masking-policy.

type DropNetworkPolicyOptions added in v0.72.0

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

DropNetworkPolicyOptions is based on https://docs.snowflake.com/en/sql-reference/sql/drop-network-policy.

type DropNetworkPolicyRequest added in v0.72.0

type DropNetworkPolicyRequest struct {
	IfExists *bool
	// contains filtered or unexported fields
}

func NewDropNetworkPolicyRequest added in v0.72.0

func NewDropNetworkPolicyRequest(
	name AccountObjectIdentifier,
) *DropNetworkPolicyRequest

func (*DropNetworkPolicyRequest) WithIfExists added in v0.72.0

func (s *DropNetworkPolicyRequest) WithIfExists(IfExists *bool) *DropNetworkPolicyRequest

type DropPasswordPolicyOptions added in v0.66.0

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

DropPasswordPolicyOptions is based on https://docs.snowflake.com/en/sql-reference/sql/drop-password-policy.

type DropPipeOptions added in v0.72.0

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

DropPipeOptions is based on https://docs.snowflake.com/en/sql-reference/sql/drop-pipe.

type DropRoleOptions added in v0.72.0

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

DropRoleOptions based on https://docs.snowflake.com/en/sql-reference/sql/drop-role

type DropRoleRequest added in v0.72.0

type DropRoleRequest struct {
	IfExists *bool
	// contains filtered or unexported fields
}

func NewDropRoleRequest added in v0.72.0

func NewDropRoleRequest(name AccountObjectIdentifier) *DropRoleRequest

func (*DropRoleRequest) WithIfExists added in v0.72.0

func (s *DropRoleRequest) WithIfExists(ifExists bool) *DropRoleRequest

type DropSchemaOptions added in v0.70.0

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

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

DropSchemaOptions Based on https://docs.snowflake.com/en/sql-reference/sql/drop-schema

type DropSessionPolicyOptions added in v0.66.0

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

DropSessionPolicyOptions is based on https://docs.snowflake.com/en/sql-reference/sql/drop-session-policy.

type DropSessionPolicyRequest added in v0.72.0

type DropSessionPolicyRequest struct {
	IfExists *bool
	// contains filtered or unexported fields
}

func NewDropSessionPolicyRequest added in v0.72.0

func NewDropSessionPolicyRequest(
	name SchemaObjectIdentifier,
) *DropSessionPolicyRequest

func (*DropSessionPolicyRequest) WithIfExists added in v0.72.0

func (s *DropSessionPolicyRequest) WithIfExists(IfExists *bool) *DropSessionPolicyRequest

type DropTaskOptions added in v0.73.0

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

DropTaskOptions is based on https://docs.snowflake.com/en/sql-reference/sql/drop-task.

type DropTaskRequest added in v0.73.0

type DropTaskRequest struct {
	IfExists *bool
	// contains filtered or unexported fields
}

func NewDropTaskRequest added in v0.73.0

func NewDropTaskRequest(
	name SchemaObjectIdentifier,
) *DropTaskRequest

func (*DropTaskRequest) WithIfExists added in v0.73.0

func (s *DropTaskRequest) WithIfExists(IfExists *bool) *DropTaskRequest

type DropUserOptions added in v0.66.0

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

DropUserOptions is based on https://docs.snowflake.com/en/sql-reference/sql/drop-user.

type DropWarehouseOptions added in v0.66.0

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

DropWarehouseOptions is based on https://docs.snowflake.com/en/sql-reference/sql/drop-warehouse.

type DynamicTable added in v0.72.0

type DynamicTable struct {
	CreatedOn           time.Time
	Name                string
	Reserved            string
	DatabaseName        string
	SchemaName          string
	ClusterBy           string
	Rows                int
	Bytes               int
	Owner               string
	TargetLag           string
	RefreshMode         DynamicTableRefreshMode
	RefreshModeReason   string
	Warehouse           string
	Comment             string
	Text                string
	AutomaticClustering bool
	SchedulingState     DynamicTableSchedulingState
	LastSuspendedOn     time.Time
	IsClone             bool
	IsReplica           bool
	DataTimestamp       time.Time
}

func (*DynamicTable) ID added in v0.72.0

type DynamicTableDetails added in v0.72.0

type DynamicTableDetails struct {
	Name       string
	Type       DataType
	Kind       string
	IsNull     bool
	Default    string
	PrimaryKey string
	UniqueKey  string
	Check      string
	Expression string
	Comment    string
	PolicyName string
}

type DynamicTableRefreshMode added in v0.72.0

type DynamicTableRefreshMode string
const (
	DynamicTableRefreshModeIncremental DynamicTableRefreshMode = "INCREMENTAL"
	DynamicTableRefreshModeFull        DynamicTableRefreshMode = "FULL"
)

type DynamicTableSchedulingState added in v0.72.0

type DynamicTableSchedulingState string
const (
	DynamicTableSchedulingStateRunning   DynamicTableSchedulingState = "RUNNING"
	DynamicTableSchedulingStateSuspended DynamicTableSchedulingState = "SUSPENDED"
)

type DynamicTableSet added in v0.72.0

type DynamicTableSet struct {
	TargetLag *TargetLag               `ddl:"parameter,no_quotes" sql:"TARGET_LAG"`
	Warehouse *AccountObjectIdentifier `ddl:"identifier,equals" sql:"WAREHOUSE"`
}

type DynamicTableSetRequest added in v0.72.0

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

func NewDynamicTableSetRequest added in v0.72.0

func NewDynamicTableSetRequest() *DynamicTableSetRequest

func (*DynamicTableSetRequest) WithTargetLag added in v0.72.0

func (s *DynamicTableSetRequest) WithTargetLag(targetLag *TargetLag) *DynamicTableSetRequest

func (*DynamicTableSetRequest) WithWarehourse added in v0.72.0

type DynamicTables added in v0.72.0

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 ExecuteTaskOptions added in v0.73.0

type ExecuteTaskOptions struct {
	RetryLast *bool `ddl:"keyword" sql:"RETRY LAST"`
	// contains filtered or unexported fields
}

ExecuteTaskOptions is based on https://docs.snowflake.com/en/sql-reference/sql/execute-task.

type ExecuteTaskRequest added in v0.73.0

type ExecuteTaskRequest struct {
	RetryLast *bool
	// contains filtered or unexported fields
}

func NewExecuteTaskRequest added in v0.73.0

func NewExecuteTaskRequest(
	name SchemaObjectIdentifier,
) *ExecuteTaskRequest

func (*ExecuteTaskRequest) WithRetryLast added in v0.73.0

func (s *ExecuteTaskRequest) WithRetryLast(RetryLast *bool) *ExecuteTaskRequest

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 ExternalTable added in v0.72.0

type ExternalTable struct {
	CreatedOn           time.Time
	Name                string
	DatabaseName        string
	SchemaName          string
	Invalid             bool
	InvalidReason       string
	Owner               string
	Comment             string
	Stage               string
	Location            string
	FileFormatName      string
	FileFormatType      string
	Cloud               string
	Region              string
	NotificationChannel string
	LastRefreshedOn     time.Time
	TableFormat         string
	LastRefreshDetails  string
	OwnerRoleType       string
}

func (*ExternalTable) ID added in v0.72.0

func (*ExternalTable) ObjectType added in v0.72.0

func (v *ExternalTable) ObjectType() ObjectType

type ExternalTableAvroCompression added in v0.72.0

type ExternalTableAvroCompression string
var (
	ExternalTableAvroCompressionAuto       ExternalTableAvroCompression = "AUTO"
	ExternalTableAvroCompressionGzip       ExternalTableAvroCompression = "GZIP"
	ExternalTableAvroCompressionBz2        ExternalTableAvroCompression = "BZ2"
	ExternalTableAvroCompressionBrotli     ExternalTableAvroCompression = "BROTLI"
	ExternalTableAvroCompressionZstd       ExternalTableAvroCompression = "ZSTD"
	ExternalTableAvroCompressionDeflate    ExternalTableAvroCompression = "DEFLATE"
	ExternalTableAvroCompressionRawDeflate ExternalTableAvroCompression = "RAW_DEFLATE"
	ExternalTableAvroCompressionNone       ExternalTableAvroCompression = "NONE"
)

type ExternalTableColumn added in v0.72.0

type ExternalTableColumn struct {
	Name             string   `ddl:"keyword"`
	Type             DataType `ddl:"keyword"`
	AsExpression     []string `ddl:"keyword,parentheses" sql:"AS"`
	InlineConstraint *ColumnInlineConstraint
}

type ExternalTableColumnDetails added in v0.72.0

type ExternalTableColumnDetails struct {
	Name       string
	Type       DataType
	Kind       string
	IsNullable bool
	Default    *string
	IsPrimary  bool
	IsUnique   bool
	Check      *bool
	Expression *string
	Comment    *string
	PolicyName *string
}

type ExternalTableColumnRequest added in v0.72.0

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

func NewExternalTableColumnRequest added in v0.72.0

func NewExternalTableColumnRequest(
	name string,
	dataType DataType,
	asExpression string,
) *ExternalTableColumnRequest

func (*ExternalTableColumnRequest) WithInlineConstraint added in v0.72.0

func (s *ExternalTableColumnRequest) WithInlineConstraint(inlineConstraint *ColumnInlineConstraintRequest) *ExternalTableColumnRequest

type ExternalTableCsvCompression added in v0.72.0

type ExternalTableCsvCompression string
var (
	ExternalTableCsvCompressionAuto       ExternalTableCsvCompression = "AUTO"
	ExternalTableCsvCompressionGzip       ExternalTableCsvCompression = "GZIP"
	ExternalTableCsvCompressionBz2        ExternalTableCsvCompression = "BZ2"
	ExternalTableCsvCompressionBrotli     ExternalTableCsvCompression = "BROTLI"
	ExternalTableCsvCompressionZstd       ExternalTableCsvCompression = "ZSTD"
	ExternalTableCsvCompressionDeflate    ExternalTableCsvCompression = "DEFLATE"
	ExternalTableCsvCompressionRawDeflate ExternalTableCsvCompression = "RAW_DEFALTE"
	ExternalTableCsvCompressionNone       ExternalTableCsvCompression = "NONE"
)

type ExternalTableDropOption added in v0.72.0

type ExternalTableDropOption struct {
	Restrict *bool `ddl:"keyword" sql:"RESTRICT"`
	Cascade  *bool `ddl:"keyword" sql:"CASCADE"`
}

type ExternalTableDropOptionRequest added in v0.72.0

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

func NewExternalTableDropOptionRequest added in v0.72.0

func NewExternalTableDropOptionRequest() *ExternalTableDropOptionRequest

func (*ExternalTableDropOptionRequest) WithCascade added in v0.72.0

func (*ExternalTableDropOptionRequest) WithRestrict added in v0.72.0

type ExternalTableFile added in v0.72.0

type ExternalTableFile struct {
	Name string `ddl:"keyword,single_quotes"`
}

type ExternalTableFileFormat added in v0.72.0

type ExternalTableFileFormat struct {
	Name    *string                      `ddl:"parameter,single_quotes" sql:"FORMAT_NAME"`
	Type    *ExternalTableFileFormatType `ddl:"parameter" sql:"TYPE"`
	Options *ExternalTableFileFormatTypeOptions
}

type ExternalTableFileFormatRequest added in v0.72.0

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

func NewExternalTableFileFormatRequest added in v0.72.0

func NewExternalTableFileFormatRequest() *ExternalTableFileFormatRequest

func (*ExternalTableFileFormatRequest) WithFileFormatType added in v0.72.0

func (*ExternalTableFileFormatRequest) WithName added in v0.72.0

func (*ExternalTableFileFormatRequest) WithOptions added in v0.72.0

type ExternalTableFileFormatType added in v0.72.0

type ExternalTableFileFormatType string
var (
	ExternalTableFileFormatTypeCSV     ExternalTableFileFormatType = "CSV"
	ExternalTableFileFormatTypeJSON    ExternalTableFileFormatType = "JSON"
	ExternalTableFileFormatTypeAvro    ExternalTableFileFormatType = "AVRO"
	ExternalTableFileFormatTypeORC     ExternalTableFileFormatType = "ORC"
	ExternalTableFileFormatTypeParquet ExternalTableFileFormatType = "PARQUET"
)

type ExternalTableFileFormatTypeOptions added in v0.72.0

type ExternalTableFileFormatTypeOptions struct {
	// CSV type options
	CSVCompression               *ExternalTableCsvCompression `ddl:"parameter" sql:"COMPRESSION"`
	CSVRecordDelimiter           *string                      `ddl:"parameter,single_quotes" sql:"RECORD_DELIMITER"`
	CSVFieldDelimiter            *string                      `ddl:"parameter,single_quotes" sql:"FIELD_DELIMITER"`
	CSVSkipHeader                *int                         `ddl:"parameter" sql:"SKIP_HEADER"`
	CSVSkipBlankLines            *bool                        `ddl:"parameter" sql:"SKIP_BLANK_LINES"`
	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"`
	CSVEmptyFieldAsNull          *bool                        `ddl:"parameter" sql:"EMPTY_FIELD_AS_NULL"`
	CSVEncoding                  *CSVEncoding                 `ddl:"parameter,single_quotes" sql:"ENCODING"`

	// JSON type options
	JSONCompression              *ExternalTableJsonCompression `ddl:"parameter" sql:"COMPRESSION"`
	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"`

	// AVRO type options
	AvroCompression              *ExternalTableAvroCompression `ddl:"parameter" sql:"COMPRESSION"`
	AvroReplaceInvalidCharacters *bool                         `ddl:"parameter" sql:"REPLACE_INVALID_CHARACTERS"`

	// 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              *ExternalTableParquetCompression `ddl:"parameter" sql:"COMPRESSION"`
	ParquetBinaryAsText             *bool                            `ddl:"parameter" sql:"BINARY_AS_TEXT"`
	ParquetReplaceInvalidCharacters *bool                            `ddl:"parameter" sql:"REPLACE_INVALID_CHARACTERS"`
}

type ExternalTableFileFormatTypeOptionsRequest added in v0.72.0

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

func NewExternalTableFileFormatTypeOptionsRequest added in v0.72.0

func NewExternalTableFileFormatTypeOptionsRequest() *ExternalTableFileFormatTypeOptionsRequest

func (*ExternalTableFileFormatTypeOptionsRequest) WithAvroCompression added in v0.72.0

func (*ExternalTableFileFormatTypeOptionsRequest) WithAvroReplaceInvalidCharacters added in v0.72.0

func (s *ExternalTableFileFormatTypeOptionsRequest) WithAvroReplaceInvalidCharacters(avroReplaceInvalidCharacters *bool) *ExternalTableFileFormatTypeOptionsRequest

func (*ExternalTableFileFormatTypeOptionsRequest) WithCsvCompression added in v0.72.0

func (*ExternalTableFileFormatTypeOptionsRequest) WithCsvEmptyFieldAsNull added in v0.72.0

func (s *ExternalTableFileFormatTypeOptionsRequest) WithCsvEmptyFieldAsNull(csvEmptyFieldAsNull *bool) *ExternalTableFileFormatTypeOptionsRequest

func (*ExternalTableFileFormatTypeOptionsRequest) WithCsvEncoding added in v0.72.0

func (*ExternalTableFileFormatTypeOptionsRequest) WithCsvEscapeUnenclosedField added in v0.72.0

func (s *ExternalTableFileFormatTypeOptionsRequest) WithCsvEscapeUnenclosedField(csvEscapeUnenclosedField *string) *ExternalTableFileFormatTypeOptionsRequest

func (*ExternalTableFileFormatTypeOptionsRequest) WithCsvFieldDelimiter added in v0.72.0

func (*ExternalTableFileFormatTypeOptionsRequest) WithCsvFieldOptionallyEnclosedBy added in v0.72.0

func (s *ExternalTableFileFormatTypeOptionsRequest) WithCsvFieldOptionallyEnclosedBy(csvFieldOptionallyEnclosedBy *string) *ExternalTableFileFormatTypeOptionsRequest

func (*ExternalTableFileFormatTypeOptionsRequest) WithCsvNullIf added in v0.72.0

func (*ExternalTableFileFormatTypeOptionsRequest) WithCsvRecordDelimiter added in v0.72.0

func (s *ExternalTableFileFormatTypeOptionsRequest) WithCsvRecordDelimiter(csvRecordDelimiter *string) *ExternalTableFileFormatTypeOptionsRequest

func (*ExternalTableFileFormatTypeOptionsRequest) WithCsvSkipBlankLines added in v0.72.0

func (*ExternalTableFileFormatTypeOptionsRequest) WithCsvSkipHeader added in v0.72.0

func (*ExternalTableFileFormatTypeOptionsRequest) WithCsvTrimSpace added in v0.72.0

func (*ExternalTableFileFormatTypeOptionsRequest) WithJsonAllowDuplicate added in v0.72.0

func (s *ExternalTableFileFormatTypeOptionsRequest) WithJsonAllowDuplicate(jsonAllowDuplicate *bool) *ExternalTableFileFormatTypeOptionsRequest

func (*ExternalTableFileFormatTypeOptionsRequest) WithJsonCompression added in v0.72.0

func (*ExternalTableFileFormatTypeOptionsRequest) WithJsonReplaceInvalidCharacters added in v0.72.0

func (s *ExternalTableFileFormatTypeOptionsRequest) WithJsonReplaceInvalidCharacters(jsonReplaceInvalidCharacters *bool) *ExternalTableFileFormatTypeOptionsRequest

func (*ExternalTableFileFormatTypeOptionsRequest) WithJsonStripNullValues added in v0.72.0

func (s *ExternalTableFileFormatTypeOptionsRequest) WithJsonStripNullValues(jsonStripNullValues *bool) *ExternalTableFileFormatTypeOptionsRequest

func (*ExternalTableFileFormatTypeOptionsRequest) WithJsonStripOuterArray added in v0.72.0

func (s *ExternalTableFileFormatTypeOptionsRequest) WithJsonStripOuterArray(jsonStripOuterArray *bool) *ExternalTableFileFormatTypeOptionsRequest

func (*ExternalTableFileFormatTypeOptionsRequest) WithOrcNullIf added in v0.72.0

func (*ExternalTableFileFormatTypeOptionsRequest) WithOrcReplaceInvalidCharacters added in v0.72.0

func (s *ExternalTableFileFormatTypeOptionsRequest) WithOrcReplaceInvalidCharacters(orcReplaceInvalidCharacters *bool) *ExternalTableFileFormatTypeOptionsRequest

func (*ExternalTableFileFormatTypeOptionsRequest) WithOrcTrimSpace added in v0.72.0

func (*ExternalTableFileFormatTypeOptionsRequest) WithParquetBinaryAsText added in v0.72.0

func (s *ExternalTableFileFormatTypeOptionsRequest) WithParquetBinaryAsText(parquetBinaryAsText *bool) *ExternalTableFileFormatTypeOptionsRequest

func (*ExternalTableFileFormatTypeOptionsRequest) WithParquetCompression added in v0.72.0

func (*ExternalTableFileFormatTypeOptionsRequest) WithParquetReplaceInvalidCharacters added in v0.72.0

func (s *ExternalTableFileFormatTypeOptionsRequest) WithParquetReplaceInvalidCharacters(parquetReplaceInvalidCharacters *bool) *ExternalTableFileFormatTypeOptionsRequest

type ExternalTableFileRequest added in v0.72.0

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

func NewExternalTableFileRequest added in v0.72.0

func NewExternalTableFileRequest(
	name string,
) *ExternalTableFileRequest

type ExternalTableJsonCompression added in v0.72.0

type ExternalTableJsonCompression string
var (
	ExternalTableJsonCompressionAuto       ExternalTableJsonCompression = "AUTO"
	ExternalTableJsonCompressionGzip       ExternalTableJsonCompression = "GZIP"
	ExternalTableJsonCompressionBz2        ExternalTableJsonCompression = "BZ2"
	ExternalTableJsonCompressionBrotli     ExternalTableJsonCompression = "BROTLI"
	ExternalTableJsonCompressionZstd       ExternalTableJsonCompression = "ZSTD"
	ExternalTableJsonCompressionDeflate    ExternalTableJsonCompression = "DEFLATE"
	ExternalTableJsonCompressionRawDeflate ExternalTableJsonCompression = "RAW_DEFLATE"
	ExternalTableJsonCompressionNone       ExternalTableJsonCompression = "NONE"
)

type ExternalTableParquetCompression added in v0.72.0

type ExternalTableParquetCompression string
var (
	ExternalTableParquetCompressionAuto   ExternalTableParquetCompression = "AUTO"
	ExternalTableParquetCompressionSnappy ExternalTableParquetCompression = "SNAPPY"
	ExternalTableParquetCompressionNone   ExternalTableParquetCompression = "NONE"
)

type ExternalTableStageDetails added in v0.72.0

type ExternalTableStageDetails struct {
	ParentProperty  string
	Property        string
	PropertyType    string
	PropertyValue   string
	PropertyDefault string
}

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 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 ForeignKeyOnAction added in v0.72.0

type ForeignKeyOnAction struct {
	OnUpdate *bool `ddl:"parameter,no_equals" sql:"ON UPDATE"`
	OnDelete *bool `ddl:"parameter,no_equals" sql:"ON DELETE"`
}

type ForeignKeyOnActionRequest added in v0.72.0

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

func NewForeignKeyOnActionRequest added in v0.72.0

func NewForeignKeyOnActionRequest() *ForeignKeyOnActionRequest

func (*ForeignKeyOnActionRequest) WithOnDelete added in v0.72.0

func (s *ForeignKeyOnActionRequest) WithOnDelete(onDelete *bool) *ForeignKeyOnActionRequest

func (*ForeignKeyOnActionRequest) WithOnUpdate added in v0.72.0

func (s *ForeignKeyOnActionRequest) WithOnUpdate(onUpdate *bool) *ForeignKeyOnActionRequest

type Frequency added in v0.69.0

type Frequency string
const (
	FrequencyMonthly Frequency = "MONTHLY"
	FrequencyDaily   Frequency = "DAILY"
	FrequencyWeekly  Frequency = "WEEKLY"
	FrequencyYearly  Frequency = "YEARLY"
	FrequencyNever   Frequency = "NEVER"
)

func FrequencyFromString added in v0.69.0

func FrequencyFromString(s string) (*Frequency, 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"
	// | MANAGE WAREHOUSES
	GlobalPrivilegeManageWarehouses GlobalPrivilege = "MANAGE WAREHOUSES"

	// | 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
	GrantOn     ObjectType
	Name        ObjectIdentifier
	GrantedTo   ObjectType
	GrantTo     ObjectType
	GranteeName AccountObjectIdentifier
	GrantOption bool
	GrantedBy   AccountObjectIdentifier
}

func (*Grant) ID added in v0.65.0

func (v *Grant) ID() ObjectIdentifier

type GrantDatabaseRoleRequest added in v0.70.0

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

func NewGrantDatabaseRoleRequest added in v0.70.0

func NewGrantDatabaseRoleRequest(
	name DatabaseObjectIdentifier,
) *GrantDatabaseRoleRequest

func (*GrantDatabaseRoleRequest) WithAccountRole added in v0.70.0

func (*GrantDatabaseRoleRequest) WithDatabaseRole added in v0.70.0

type GrantDatabaseRoleToShareRequest added in v0.70.0

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

func NewGrantDatabaseRoleToShareRequest added in v0.70.0

func NewGrantDatabaseRoleToShareRequest(
	name DatabaseObjectIdentifier,
	share AccountObjectIdentifier,
) *GrantDatabaseRoleToShareRequest

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                  *DatabaseObjectIdentifier `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         *DatabaseObjectIdentifier `ddl:"identifier" sql:"IN SCHEMA"`
}

type GrantOwnershipOptions added in v0.72.0

type GrantOwnershipOptions struct {
	On            OwnershipGrantOn        `ddl:"keyword" sql:"ON"`
	To            OwnershipGrantTo        `ddl:"keyword" sql:"TO"`
	CurrentGrants *OwnershipCurrentGrants `ddl:"-"`
	// contains filtered or unexported fields
}

GrantOwnershipOptions is based on https://docs.snowflake.com/en/sql-reference/sql/grant-ownership#syntax. Description is a bit misleading, ownership can be given not only to schema objects but also to account level objects.

type GrantPrivilegeToShareOn added in v0.65.0

type GrantPrivilegeToShareOn struct {
	Database AccountObjectIdentifier  `ddl:"identifier" sql:"DATABASE"`
	Schema   DatabaseObjectIdentifier `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
}

GrantPrivilegesToAccountRoleOptions is based on https://docs.snowflake.com/en/sql-reference/sql/grant-privilege#syntax.

type GrantPrivilegesToDatabaseRoleOptions added in v0.71.0

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

GrantPrivilegesToDatabaseRoleOptions is based on https://docs.snowflake.com/en/sql-reference/sql/grant-privilege#syntax.

type GrantRole added in v0.72.0

type GrantRole struct {
	// one of
	Role *AccountObjectIdentifier `ddl:"identifier" sql:"ROLE"`
	User *AccountObjectIdentifier `ddl:"identifier" sql:"USER"`
}

type GrantRoleOptions added in v0.72.0

type GrantRoleOptions struct {
	Grant GrantRole `ddl:"keyword,no_parentheses" sql:"TO"`
	// contains filtered or unexported fields
}

GrantRoleOptions based on https://docs.snowflake.com/en/sql-reference/sql/grant-role

type GrantRoleRequest added in v0.72.0

type GrantRoleRequest struct {
	Grant GrantRole // required
	// contains filtered or unexported fields
}

func NewGrantRoleRequest added in v0.72.0

func NewGrantRoleRequest(name AccountObjectIdentifier, grant GrantRole) *GrantRoleRequest

type Grants added in v0.65.0

type IP added in v0.72.0

type IP struct {
	IP string `ddl:"keyword,single_quotes"`
}

type IPRequest added in v0.72.0

type IPRequest struct {
	IP string // required
}

func NewIPRequest added in v0.72.0

func NewIPRequest(
	IP string,
) *IPRequest

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   DatabaseObjectIdentifier `ddl:"identifier" sql:"SCHEMA"`
}

type InlineForeignKey added in v0.72.0

type InlineForeignKey struct {
	TableName  string              `ddl:"keyword" sql:"REFERENCES"`
	ColumnName []string            `ddl:"keyword,parentheses"`
	Match      *MatchType          `ddl:"keyword" sql:"MATCH"`
	On         *ForeignKeyOnAction `ddl:"keyword" sql:"ON"`
}

type InlineForeignKeyRequest added in v0.72.0

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

func NewInlineForeignKeyRequest added in v0.72.0

func NewInlineForeignKeyRequest(
	tableName string,
) *InlineForeignKeyRequest

func (*InlineForeignKeyRequest) WithColumnName added in v0.72.0

func (s *InlineForeignKeyRequest) WithColumnName(columnName []string) *InlineForeignKeyRequest

func (*InlineForeignKeyRequest) WithMatch added in v0.72.0

func (*InlineForeignKeyRequest) WithOn added in v0.72.0

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 LikeRequest added in v0.72.0

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

func NewLikeRequest added in v0.72.0

func NewLikeRequest(pattern string) *LikeRequest

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 LimitFromRequest added in v0.72.0

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

func NewLimitFromRequest added in v0.72.0

func NewLimitFromRequest() *LimitFromRequest

func (*LimitFromRequest) WithFrom added in v0.72.0

func (s *LimitFromRequest) WithFrom(from *string) *LimitFromRequest

func (*LimitFromRequest) WithRows added in v0.72.0

func (s *LimitFromRequest) WithRows(rows *int) *LimitFromRequest

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 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 MatchType added in v0.72.0

type MatchType string
var (
	FullMatchType    MatchType = "FULL"
	SimpleMatchType  MatchType = "SIMPLE"
	PartialMatchType MatchType = "PARTIAL"
)

type NetworkPolicies added in v0.72.0

type NetworkPolicy added in v0.72.0

type NetworkPolicy struct {
	CreatedOn              string
	Name                   string
	Comment                string
	EntriesInAllowedIpList int
	EntriesInBlockedIpList int
}

type NetworkPolicyDescription added in v0.72.0

type NetworkPolicyDescription struct {
	Name  string
	Value string
}

type NetworkPolicySet added in v0.72.0

type NetworkPolicySet struct {
	AllowedIpList []IP    `ddl:"parameter,parentheses" sql:"ALLOWED_IP_LIST"`
	BlockedIpList []IP    `ddl:"parameter,parentheses" sql:"BLOCKED_IP_LIST"`
	Comment       *string `ddl:"parameter,single_quotes" sql:"COMMENT"`
}

type NetworkPolicySetRequest added in v0.72.0

type NetworkPolicySetRequest struct {
	AllowedIpList []IPRequest
	BlockedIpList []IPRequest
	Comment       *string
}

func NewNetworkPolicySetRequest added in v0.72.0

func NewNetworkPolicySetRequest() *NetworkPolicySetRequest

func (*NetworkPolicySetRequest) WithAllowedIpList added in v0.72.0

func (s *NetworkPolicySetRequest) WithAllowedIpList(AllowedIpList []IPRequest) *NetworkPolicySetRequest

func (*NetworkPolicySetRequest) WithBlockedIpList added in v0.72.0

func (s *NetworkPolicySetRequest) WithBlockedIpList(BlockedIpList []IPRequest) *NetworkPolicySetRequest

func (*NetworkPolicySetRequest) WithComment added in v0.72.0

func (s *NetworkPolicySetRequest) WithComment(Comment *string) *NetworkPolicySetRequest

type NotifiedUser added in v0.69.0

type NotifiedUser struct {
	Name string `ddl:"keyword,double_quotes"`
}

type NotifyUsers added in v0.69.0

type NotifyUsers struct {
	Users []NotifiedUser `ddl:"list,parentheses,comma"`
}

type NullString added in v0.68.0

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

type NullStringRequest added in v0.72.0

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

func NewNullStringRequest added in v0.72.0

func NewNullStringRequest() *NullStringRequest

func (*NullStringRequest) WithStr added in v0.72.0

func (s *NullStringRequest) WithStr(str string) *NullStringRequest

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"`
	EnableUnredactedQuerySyntaxError    *bool          `ddl:"parameter" sql:"ENABLE_UNREDACTED_QUERY_SYNTAX_ERROR"`
	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"`
}

ObjectParameters is based on https://docs.snowflake.com/en/sql-reference/parameters#object-parameters.

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"
	ObjectTypeManagedAccount     ObjectType = "MANAGED ACCOUNT"
	ObjectTypeUser               ObjectType = "USER"
	ObjectTypeDatabaseRole       ObjectType = "DATABASE ROLE"
	ObjectTypeRole               ObjectType = "ROLE"
	ObjectTypeIntegration        ObjectType = "INTEGRATION"
	ObjectTypeNetworkPolicy      ObjectType = "NETWORK POLICY"
	ObjectTypePasswordPolicy     ObjectType = "PASSWORD POLICY"
	ObjectTypeSessionPolicy      ObjectType = "SESSION POLICY"
	ObjectTypeReplicationGroup   ObjectType = "REPLICATION GROUP"
	ObjectTypeFailoverGroup      ObjectType = "FAILOVER GROUP"
	ObjectTypeConnection         ObjectType = "CONNECTION"
	ObjectTypeParameter          ObjectType = "PARAMETER"
	ObjectTypeWarehouse          ObjectType = "WAREHOUSE"
	ObjectTypeResourceMonitor    ObjectType = "RESOURCE MONITOR"
	ObjectTypeDatabase           ObjectType = "DATABASE"
	ObjectTypeSchema             ObjectType = "SCHEMA"
	ObjectTypeShare              ObjectType = "SHARE"
	ObjectTypeTable              ObjectType = "TABLE"
	ObjectTypeDynamicTable       ObjectType = "DYNAMIC TABLE"
	ObjectTypeExternalTable      ObjectType = "EXTERNAL TABLE"
	ObjectTypeEventTable         ObjectType = "EVENT TABLE"
	ObjectTypeView               ObjectType = "VIEW"
	ObjectTypeMaterializedView   ObjectType = "MATERIALIZED VIEW"
	ObjectTypeSequence           ObjectType = "SEQUENCE"
	ObjectTypeFunction           ObjectType = "FUNCTION"
	ObjectTypeExternalFunction   ObjectType = "EXTERNAL FUNCTION"
	ObjectTypeProcedure          ObjectType = "PROCEDURE"
	ObjectTypeStream             ObjectType = "STREAM"
	ObjectTypeTask               ObjectType = "TASK"
	ObjectTypeMaskingPolicy      ObjectType = "MASKING POLICY"
	ObjectTypeRowAccessPolicy    ObjectType = "ROW ACCESS POLICY"
	ObjectTypeTag                ObjectType = "TAG"
	ObjectTypeSecret             ObjectType = "SECRET"
	ObjectTypeStage              ObjectType = "STAGE"
	ObjectTypeFileFormat         ObjectType = "FILE FORMAT"
	ObjectTypePipe               ObjectType = "PIPE"
	ObjectTypeAlert              ObjectType = "ALERT"
	ObjectTypeApplication        ObjectType = "APPLICATION"
	ObjectTypeApplicationPackage ObjectType = "APPLICATION PACKAGE"
	ObjectTypeApplicationRole    ObjectType = "APPLICATION ROLE"
	ObjectTypeStreamlit          ObjectType = "STREAMLIT"
)

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 DatabaseObjectIdentifier `ddl:"identifier" sql:"ALL TABLES IN SCHEMA"`
}

type OnView added in v0.65.0

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

type OwnershipCurrentGrants added in v0.72.0

type OwnershipCurrentGrants struct {
	OutboundPrivileges OwnershipCurrentGrantsOutboundPrivileges `ddl:"keyword"`
	// contains filtered or unexported fields
}

type OwnershipCurrentGrantsOutboundPrivileges added in v0.72.0

type OwnershipCurrentGrantsOutboundPrivileges string

type OwnershipGrantOn added in v0.72.0

type OwnershipGrantOn struct {
	// One of
	Object *Object                `ddl:"-"`
	All    *GrantOnSchemaObjectIn `ddl:"keyword" sql:"ALL"`
	Future *GrantOnSchemaObjectIn `ddl:"keyword" sql:"FUTURE"`
}

type OwnershipGrantTo added in v0.72.0

type OwnershipGrantTo struct {
	// One of
	DatabaseRoleName *DatabaseObjectIdentifier `ddl:"identifier" sql:"DATABASE ROLE"`
	AccountRoleName  *AccountObjectIdentifier  `ddl:"identifier" sql:"ROLE"`
}

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 Parameters added in v0.71.0

type Parameters interface {
	SetAccountParameter(ctx context.Context, parameter AccountParameter, value string) error
	SetSessionParameterOnAccount(ctx context.Context, parameter SessionParameter, value string) error
	SetSessionParameterOnUser(ctx context.Context, userID AccountObjectIdentifier, parameter SessionParameter, value string) error
	SetObjectParameterOnAccount(ctx context.Context, parameter ObjectParameter, value string) error
	SetObjectParameterOnObject(ctx context.Context, object Object, parameter ObjectParameter, value string) 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, object Object) (*Parameter, error)
}

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    DatabaseObjectIdentifier `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 Partition added in v0.72.0

type Partition struct {
	ColumnName string `ddl:"keyword"`
	Value      string `ddl:"parameter,single_quotes"`
}

type PartitionRequest added in v0.72.0

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

func NewPartitionRequest added in v0.72.0

func NewPartitionRequest(
	columnName string,
	value string,
) *PartitionRequest

type PasswordPolicy

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

PasswordPolicy 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 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 Pipe added in v0.70.0

type Pipe struct {
	CreatedOn           string
	Name                string
	DatabaseName        string
	SchemaName          string
	Definition          string
	Owner               string
	NotificationChannel string
	Comment             string
	Integration         string
	Pattern             string
	ErrorIntegration    string
	OwnerRoleType       string
	InvalidReason       string
}

Pipe is a user-friendly result for a SHOW PIPES and DESCRIBE PIPE queries.

Based on https://docs.snowflake.com/en/sql-reference/sql/show-pipes#output and https://docs.snowflake.com/en/sql-reference/sql/desc-pipe#output.

func (*Pipe) ID added in v0.70.0

func (v *Pipe) ID() SchemaObjectIdentifier

func (*Pipe) ObjectType added in v0.70.0

func (v *Pipe) ObjectType() ObjectType

type PipeRefresh added in v0.70.0

type PipeRefresh struct {
	Prefix        *string `ddl:"parameter,single_quotes" sql:"PREFIX"`
	ModifiedAfter *string `ddl:"parameter,single_quotes" sql:"MODIFIED_AFTER"`
}

type PipeSet added in v0.70.0

type PipeSet struct {
	ErrorIntegration    *string `ddl:"parameter,no_quotes" sql:"ERROR_INTEGRATION"`
	PipeExecutionPaused *bool   `ddl:"parameter" sql:"PIPE_EXECUTION_PAUSED"`
	Comment             *string `ddl:"parameter,single_quotes" sql:"COMMENT"`
}

type PipeSetTags added in v0.70.0

type PipeSetTags struct {
	Tag []TagAssociation `ddl:"keyword"`
}

type PipeUnset added in v0.70.0

type PipeUnset struct {
	PipeExecutionPaused *bool `ddl:"keyword" sql:"PIPE_EXECUTION_PAUSED"`
	Comment             *bool `ddl:"keyword" sql:"COMMENT"`
}

type PipeUnsetTags added in v0.70.0

type PipeUnsetTags struct {
	Tag []ObjectIdentifier `ddl:"keyword"`
}

type Pipes added in v0.70.0

type Pipes interface {
	Create(ctx context.Context, id SchemaObjectIdentifier, copyStatement string, opts *CreatePipeOptions) error
	Alter(ctx context.Context, id SchemaObjectIdentifier, opts *AlterPipeOptions) error
	Drop(ctx context.Context, id SchemaObjectIdentifier) error
	Show(ctx context.Context, opts *ShowPipeOptions) ([]Pipe, error)
	ShowByID(ctx context.Context, id SchemaObjectIdentifier) (*Pipe, error)
	Describe(ctx context.Context, id SchemaObjectIdentifier) (*Pipe, error)
}

type PluralObjectType added in v0.65.0

type PluralObjectType string
const (
	PluralObjectTypeAccounts            PluralObjectType = "ACCOUNTS"
	PluralObjectTypeManagedAccounts     PluralObjectType = "MANAGED ACCOUNTS"
	PluralObjectTypeUsers               PluralObjectType = "USERS"
	PluralObjectTypeDatabaseRoles       PluralObjectType = "DATABASE ROLES"
	PluralObjectTypeRoles               PluralObjectType = "ROLES"
	PluralObjectTypeIntegrations        PluralObjectType = "INTEGRATIONS"
	PluralObjectTypeNetworkPolicies     PluralObjectType = "NETWORK POLICIES"
	PluralObjectTypePasswordPolicies    PluralObjectType = "PASSWORD POLICIES"
	PluralObjectTypeSessionPolicies     PluralObjectType = "SESSION POLICIES"
	PluralObjectTypeReplicationGroups   PluralObjectType = "REPLICATION GROUPS"
	PluralObjectTypeFailoverGroups      PluralObjectType = "FAILOVER GROUPS"
	PluralObjectTypeConnections         PluralObjectType = "CONNECTIONS"
	PluralObjectTypeParameters          PluralObjectType = "PARAMETERS"
	PluralObjectTypeWarehouses          PluralObjectType = "WAREHOUSES"
	PluralObjectTypeResourceMonitors    PluralObjectType = "RESOURCE MONITORS"
	PluralObjectTypeDatabases           PluralObjectType = "DATABASES"
	PluralObjectTypeSchemas             PluralObjectType = "SCHEMAS"
	PluralObjectTypeShares              PluralObjectType = "SHARES"
	PluralObjectTypeTables              PluralObjectType = "TABLES"
	PluralObjectTypeDynamicTables       PluralObjectType = "DYNAMIC TABLES"
	PluralObjectTypeExternalTables      PluralObjectType = "EXTERNAL TABLES"
	PluralObjectTypeEventTables         PluralObjectType = "EVENT TABLES"
	PluralObjectTypeViews               PluralObjectType = "VIEWS"
	PluralObjectTypeMaterializedViews   PluralObjectType = "MATERIALIZED VIEWS"
	PluralObjectTypeSequences           PluralObjectType = "SEQUENCES"
	PluralObjectTypeFunctions           PluralObjectType = "FUNCTIONS"
	PluralObjectTypeExternalFunctions   PluralObjectType = "EXTERNAL FUNCTIONS"
	PluralObjectTypeProcedures          PluralObjectType = "PROCEDURES"
	PluralObjectTypeStreams             PluralObjectType = "STREAMS"
	PluralObjectTypeTasks               PluralObjectType = "TASKS"
	PluralObjectTypeMaskingPolicies     PluralObjectType = "MASKING POLICIES"
	PluralObjectTypeRowAccessPolicies   PluralObjectType = "ROW ACCESS POLICIES"
	PluralObjectTypeTags                PluralObjectType = "TAGS"
	PluralObjectTypeSecrets             PluralObjectType = "SECRETS"
	PluralObjectTypeStages              PluralObjectType = "STAGES"
	PluralObjectTypeFileFormats         PluralObjectType = "FILE FORMATS"
	PluralObjectTypePipes               PluralObjectType = "PIPES"
	PluralObjectTypeAlerts              PluralObjectType = "ALERTS"
	PluralObjectTypeApplications        PluralObjectType = "APPLICATIONS"
	PluralObjectTypeApplicationPackages PluralObjectType = "APPLICATION PACKAGES"
	PluralObjectTypeApplicationRoles    PluralObjectType = "APPLICATION ROLES"
	PluralObjectTypeStreamlits          PluralObjectType = "STREAMLITS"
)

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 RefreshExternalTable added in v0.72.0

type RefreshExternalTable struct {
	Path string `ddl:"parameter,no_equals,single_quotes"`
}

type RefreshExternalTableRequest added in v0.72.0

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

func NewRefreshExternalTableRequest added in v0.72.0

func NewRefreshExternalTableRequest(
	path string,
) *RefreshExternalTableRequest

type Region added in v0.65.0

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

type RemoveDelegatedAuthorization added in v0.70.0

type RemoveDelegatedAuthorization struct {
	// one of
	Role           *string `ddl:"parameter,no_equals" sql:"REMOVE DELEGATED AUTHORIZATION OF ROLE"`
	Authorizations *bool   `ddl:"parameter,no_equals" sql:"REMOVE DELEGATED AUTHORIZATIONS"`

	Integration string `ddl:"parameter,no_equals" sql:"FROM SECURITY INTEGRATION"`
}

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 {
	ShowReplicationAccounts(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
	CreditQuota        float64
	UsedCredits        float64
	RemainingCredits   float64
	Frequency          Frequency
	StartTime          string
	EndTime            string
	SuspendAt          *int
	SuspendImmediateAt *int
	NotifyTriggers     []int
	Level              ResourceMonitorLevel
	Comment            string
	NotifyUsers        []string
}

func (*ResourceMonitor) ID added in v0.65.0

func (*ResourceMonitor) ObjectType added in v0.65.0

func (v *ResourceMonitor) ObjectType() ObjectType

type ResourceMonitorLevel added in v0.69.0

type ResourceMonitorLevel int

type ResourceMonitorSet added in v0.69.0

type ResourceMonitorSet struct {
	// at least one
	CreditQuota    *int       `ddl:"parameter,equals" sql:"CREDIT_QUOTA"`
	Frequency      *Frequency `ddl:"parameter,equals" sql:"FREQUENCY"`
	StartTimestamp *string    `ddl:"parameter,equals,single_quotes" sql:"START_TIMESTAMP"`
	EndTimestamp   *string    `ddl:"parameter,equals,single_quotes" sql:"END_TIMESTAMP"`
}

type ResourceMonitorWith added in v0.69.0

type ResourceMonitorWith struct {
	CreditQuota    *int                `ddl:"parameter,equals" sql:"CREDIT_QUOTA"`
	Frequency      *Frequency          `ddl:"parameter,equals" sql:"FREQUENCY"`
	StartTimestamp *string             `ddl:"parameter,equals,single_quotes" sql:"START_TIMESTAMP"`
	EndTimestamp   *string             `ddl:"parameter,equals,single_quotes" sql:"END_TIMESTAMP"`
	NotifyUsers    *NotifyUsers        `ddl:"parameter,equals" sql:"NOTIFY_USERS"`
	Triggers       []TriggerDefinition `ddl:"keyword,no_comma" sql:"TRIGGERS"`
}

type RevokeDatabaseRoleFromShareRequest added in v0.70.0

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

func NewRevokeDatabaseRoleFromShareRequest added in v0.70.0

func NewRevokeDatabaseRoleFromShareRequest(
	name DatabaseObjectIdentifier,
	share AccountObjectIdentifier,
) *RevokeDatabaseRoleFromShareRequest

type RevokeDatabaseRoleRequest added in v0.70.0

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

func NewRevokeDatabaseRoleRequest added in v0.70.0

func NewRevokeDatabaseRoleRequest(
	name DatabaseObjectIdentifier,
) *RevokeDatabaseRoleRequest

func (*RevokeDatabaseRoleRequest) WithAccountRole added in v0.70.0

func (*RevokeDatabaseRoleRequest) WithDatabaseRole added in v0.70.0

type RevokePrivilegeFromShareOn added in v0.65.0

type RevokePrivilegeFromShareOn struct {
	Database AccountObjectIdentifier  `ddl:"identifier" sql:"DATABASE"`
	Schema   DatabaseObjectIdentifier `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
}

RevokePrivilegesFromAccountRoleOptions is based on https://docs.snowflake.com/en/sql-reference/sql/revoke-privilege#syntax.

type RevokePrivilegesFromDatabaseRoleOptions added in v0.71.0

type RevokePrivilegesFromDatabaseRoleOptions 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
}

RevokePrivilegesFromDatabaseRoleOptions is based on https://docs.snowflake.com/en/sql-reference/sql/revoke-privilege#syntax.

type RevokeRole added in v0.72.0

type RevokeRole struct {
	// one of
	User *AccountObjectIdentifier `ddl:"identifier" sql:"USER"`
	Role *AccountObjectIdentifier `ddl:"identifier" sql:"ROLE"`
}

type RevokeRoleOptions added in v0.72.0

type RevokeRoleOptions struct {
	Revoke RevokeRole `ddl:"keyword,no_parentheses" sql:"FROM"`
	// contains filtered or unexported fields
}

RevokeRoleOptions based on https://docs.snowflake.com/en/sql-reference/sql/revoke-role

type RevokeRoleRequest added in v0.72.0

type RevokeRoleRequest struct {
	Revoke RevokeRole // required
	// contains filtered or unexported fields
}

func NewRevokeRoleRequest added in v0.72.0

func NewRevokeRoleRequest(name AccountObjectIdentifier, revoke RevokeRole) *RevokeRoleRequest

type Role added in v0.65.0

type Role struct {
	CreatedOn       time.Time
	Name            string
	IsDefault       bool
	IsCurrent       bool
	IsInherited     bool
	AssignedToUsers int
	GrantedToRoles  int
	GrantedRoles    int
	Owner           string
	Comment         string
}

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 Roles added in v0.65.0

type Roles interface {
	Create(ctx context.Context, req *CreateRoleRequest) error
	Alter(ctx context.Context, req *AlterRoleRequest) error
	Drop(ctx context.Context, req *DropRoleRequest) error
	Show(ctx context.Context, req *ShowRoleRequest) ([]Role, error)
	ShowByID(ctx context.Context, req *ShowRoleByIdRequest) (*Role, error)
	Grant(ctx context.Context, req *GrantRoleRequest) error
	Revoke(ctx context.Context, req *RevokeRoleRequest) error
	Use(ctx context.Context, req *UseRoleRequest) error
	UseSecondary(ctx context.Context, req *UseSecondaryRolesRequest) error
}

type RolesInClass added in v0.72.0

type RolesInClass struct {
	Class ObjectIdentifier `ddl:"identifier"`
}

type RowAccessPolicy added in v0.72.0

type RowAccessPolicy struct {
	Name SchemaObjectIdentifier `ddl:"identifier"`
	On   []string               `ddl:"keyword,parentheses" sql:"ON"`
	// contains filtered or unexported fields
}

type RowAccessPolicyRequest added in v0.72.0

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

func NewRowAccessPolicyRequest added in v0.72.0

func NewRowAccessPolicyRequest(
	name SchemaObjectIdentifier,
	on []string,
) *RowAccessPolicyRequest

type ScalingPolicy added in v0.65.0

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

type Schema

type Schema struct {
	CreatedOn     time.Time
	Name          string
	IsDefault     bool
	IsCurrent     bool
	DatabaseName  string
	Owner         string
	Comment       *string
	Options       *string
	RetentionTime string
	OwnerRoleType string
}

func (*Schema) ID

func (*Schema) ObjectType added in v0.65.0

func (v *Schema) ObjectType() ObjectType

type SchemaDetails added in v0.70.0

type SchemaDetails struct {
	CreatedOn time.Time `db:"created_on"`
	Name      string    `db:"name"`
	Kind      string    `db:"kind"`
}

type SchemaIn added in v0.70.0

type SchemaIn struct {
	Account  *bool                   `ddl:"keyword" sql:"ACCOUNT"`
	Database *bool                   `ddl:"keyword" sql:"DATABASE"`
	Name     AccountObjectIdentifier `ddl:"identifier"`
}

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 NewSchemaObjectIdentifierWithArguments added in v0.70.0

func NewSchemaObjectIdentifierWithArguments(databaseName, schemaName, name string, arguments []DataType) SchemaObjectIdentifier

func (SchemaObjectIdentifier) Arguments added in v0.70.0

func (i SchemaObjectIdentifier) Arguments() []DataType

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) SchemaIdentifier added in v0.70.0

func (i SchemaObjectIdentifier) SchemaIdentifier() DatabaseObjectIdentifier

func (SchemaObjectIdentifier) SchemaName

func (i SchemaObjectIdentifier) SchemaName() string

type SchemaObjectPrivilege added in v0.68.0

type SchemaObjectPrivilege string
const (
	SchemaObjectOwnership SchemaObjectPrivilege = "OWNERSHIP"

	// -- 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 SchemaSet added in v0.70.0

type SchemaSet 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"`
	Tag                        []TagAssociation `ddl:"keyword" sql:"TAG"`
}

type SchemaUnset added in v0.70.0

type SchemaUnset 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 SecondaryRole added in v0.70.0

type SecondaryRole struct {
	Value string `ddl:"keyword,single_quotes"`
}

type SecondaryRoleOption added in v0.72.0

type SecondaryRoleOption string

SecondaryRoleOption is based on https://docs.snowflake.com/en/sql-reference/sql/use-secondary-roles.

const (
	SecondaryRolesAll  SecondaryRoleOption = "ALL"
	SecondaryRolesNone SecondaryRoleOption = "NONE"
)

type SecondaryRoles added in v0.70.0

type SecondaryRoles struct {
	Roles []SecondaryRole `ddl:"list,no_parentheses"`
	// contains filtered or unexported fields
}

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"
	SessionParameterClientMetadataRequestUseConnectionCtx SessionParameter = "CLIENT_METADATA_REQUEST_USE_CONNECTION_CTX"
	SessionParameterClientMetadataUseSessionDatabase      SessionParameter = "CLIENT_METADATA_USE_SESSION_DATABASE"
	SessionParameterClientResultColumnCaseInsensitive     SessionParameter = "CLIENT_RESULT_COLUMN_CASE_INSENSITIVE"
	SessionParameterDateInputFormat                       SessionParameter = "DATE_INPUT_FORMAT"
	SessionParameterGeographyOutputFormat                 SessionParameter = "GEOGRAPHY_OUTPUT_FORMAT"
	SessionParameterDateOutputFormat                      SessionParameter = "DATE_OUTPUT_FORMAT"
	SessionParameterErrorOnNondeterministicMerge          SessionParameter = "ERROR_ON_NONDETERMINISTIC_MERGE"
	SessionParameterErrorOnNondeterministicUpdate         SessionParameter = "ERROR_ON_NONDETERMINISTIC_UPDATE"
	SessionParameterJSONIndent                            SessionParameter = "JSON_INDENT"
	SessionParameterLockTimeout                           SessionParameter = "LOCK_TIMEOUT"
	SessionParameterMultiStatementCount                   SessionParameter = "MULTI_STATEMENT_COUNT"
	SessionParameterQueryTag                              SessionParameter = "QUERY_TAG"
	SessionParameterQuotedIdentifiersIgnoreCase           SessionParameter = "QUOTED_IDENTIFIERS_IGNORE_CASE"
	SessionParameterRowsPerResultset                      SessionParameter = "ROWS_PER_RESULTSET"
	SessionParameterSimulatedDataSharingConsumer          SessionParameter = "SIMULATED_DATA_SHARING_CONSUMER"
	SessionParameterStatementTimeoutInSeconds             SessionParameter = "STATEMENT_TIMEOUT_IN_SECONDS"
	SessionParameterStrictJSONOutput                      SessionParameter = "STRICT_JSON_OUTPUT"
	SessionParameterTimeInputFormat                       SessionParameter = "TIME_INPUT_FORMAT"
	SessionParameterTimeOutputFormat                      SessionParameter = "TIME_OUTPUT_FORMAT"
	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"
	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                     *BinaryInputFormat                `ddl:"parameter,single_quotes" sql:"BINARY_INPUT_FORMAT"`
	BinaryOutputFormat                    *BinaryOutputFormat               `ddl:"parameter,single_quotes" sql:"BINARY_OUTPUT_FORMAT"`
	ClientMetadataRequestUseConnectionCtx *bool                             `ddl:"parameter" sql:"CLIENT_METADATA_REQUEST_USE_CONNECTION_CTX"`
	ClientMetadataUseSessionDatabase      *bool                             `ddl:"parameter" sql:"CLIENT_METADATA_USE_SESSION_DATABASE"`
	ClientResultColumnCaseInsensitive     *bool                             `ddl:"parameter" sql:"CLIENT_RESULT_COLUMN_CASE_INSENSITIVE"`
	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"`
	MultiStatementCount                   *int                              `ddl:"parameter" sql:"MULTI_STATEMENT_COUNT"`
	QueryTag                              *string                           `ddl:"parameter,single_quotes" sql:"QUERY_TAG"`
	QuotedIdentifiersIgnoreCase           *bool                             `ddl:"parameter,single_quotes" sql:"QUOTED_IDENTIFIERS_IGNORE_CASE"`
	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"`
}

SessionParameters is based on https://docs.snowflake.com/en/sql-reference/parameters#session-parameters.

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 SessionPolicy added in v0.65.0

type SessionPolicy struct {
	CreatedOn    string
	Name         string
	DatabaseName string
	SchemaName   string
	Kind         string
	Owner        string
	Comment      string
	Options      string
}

func (*SessionPolicy) ID added in v0.65.0

type SessionPolicyDescription added in v0.72.0

type SessionPolicyDescription struct {
	CreatedOn                string
	Name                     string
	SessionIdleTimeoutMins   int
	SessionUIIdleTimeoutMins int
	Comment                  string
}

type SessionPolicySet added in v0.72.0

type SessionPolicySet struct {
	SessionIdleTimeoutMins   *int    `ddl:"parameter,no_quotes" sql:"SESSION_IDLE_TIMEOUT_MINS"`
	SessionUiIdleTimeoutMins *int    `ddl:"parameter,no_quotes" sql:"SESSION_UI_IDLE_TIMEOUT_MINS"`
	Comment                  *string `ddl:"parameter,single_quotes" sql:"COMMENT"`
}

type SessionPolicySetRequest added in v0.72.0

type SessionPolicySetRequest struct {
	SessionIdleTimeoutMins   *int
	SessionUiIdleTimeoutMins *int
	Comment                  *string
}

func NewSessionPolicySetRequest added in v0.72.0

func NewSessionPolicySetRequest() *SessionPolicySetRequest

func (*SessionPolicySetRequest) WithComment added in v0.72.0

func (s *SessionPolicySetRequest) WithComment(Comment *string) *SessionPolicySetRequest

func (*SessionPolicySetRequest) WithSessionIdleTimeoutMins added in v0.72.0

func (s *SessionPolicySetRequest) WithSessionIdleTimeoutMins(SessionIdleTimeoutMins *int) *SessionPolicySetRequest

func (*SessionPolicySetRequest) WithSessionUiIdleTimeoutMins added in v0.72.0

func (s *SessionPolicySetRequest) WithSessionUiIdleTimeoutMins(SessionUiIdleTimeoutMins *int) *SessionPolicySetRequest

type SessionPolicyUnset added in v0.72.0

type SessionPolicyUnset struct {
	SessionIdleTimeoutMins   *bool `ddl:"keyword" sql:"SESSION_IDLE_TIMEOUT_MINS"`
	SessionUiIdleTimeoutMins *bool `ddl:"keyword" sql:"SESSION_UI_IDLE_TIMEOUT_MINS"`
	Comment                  *bool `ddl:"keyword" sql:"COMMENT"`
}

type SessionPolicyUnsetRequest added in v0.72.0

type SessionPolicyUnsetRequest struct {
	SessionIdleTimeoutMins   *bool
	SessionUiIdleTimeoutMins *bool
	Comment                  *bool
}

func NewSessionPolicyUnsetRequest added in v0.72.0

func NewSessionPolicyUnsetRequest() *SessionPolicyUnsetRequest

func (*SessionPolicyUnsetRequest) WithComment added in v0.72.0

func (s *SessionPolicyUnsetRequest) WithComment(Comment *bool) *SessionPolicyUnsetRequest

func (*SessionPolicyUnsetRequest) WithSessionIdleTimeoutMins added in v0.72.0

func (s *SessionPolicyUnsetRequest) WithSessionIdleTimeoutMins(SessionIdleTimeoutMins *bool) *SessionPolicyUnsetRequest

func (*SessionPolicyUnsetRequest) WithSessionUiIdleTimeoutMins added in v0.72.0

func (s *SessionPolicyUnsetRequest) WithSessionUiIdleTimeoutMins(SessionUiIdleTimeoutMins *bool) *SessionPolicyUnsetRequest

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)
	// Context
	UseWarehouse(ctx context.Context, warehouse AccountObjectIdentifier) error
	UseDatabase(ctx context.Context, database AccountObjectIdentifier) error
	UseSchema(ctx context.Context, schema DatabaseObjectIdentifier) error
	UseRole(ctx context.Context, role AccountObjectIdentifier) error
	UseSecondaryRoles(ctx context.Context, opt SecondaryRoleOption) 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
}

SetColumnCommentOptions is based on https://docs.snowflake.com/en/sql-reference/sql/comment.

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
}

SetCommentOptions is based on https://docs.snowflake.com/en/sql-reference/sql/comment.

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 ShowAccountOptions added in v0.66.0

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

ShowAccountOptions is based on https://docs.snowflake.com/en/sql-reference/sql/show-organisation-accounts.

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
}

ShowAlertOptions is based on https://docs.snowflake.com/en/sql-reference/sql/show-alerts.

type ShowDatabaseRoleRequest added in v0.70.0

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

func NewShowDatabaseRoleRequest added in v0.70.0

func NewShowDatabaseRoleRequest(
	database AccountObjectIdentifier,
) *ShowDatabaseRoleRequest

func (*ShowDatabaseRoleRequest) WithLike added in v0.70.0

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
}

ShowDatabasesOptions is based on https://docs.snowflake.com/en/sql-reference/sql/show-databases.

type ShowDynamicTableRequest added in v0.72.0

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

func NewShowDynamicTableRequest added in v0.72.0

func NewShowDynamicTableRequest() *ShowDynamicTableRequest

func (*ShowDynamicTableRequest) WithIn added in v0.72.0

func (*ShowDynamicTableRequest) WithLike added in v0.72.0

func (*ShowDynamicTableRequest) WithLimit added in v0.72.0

func (*ShowDynamicTableRequest) WithStartsWith added in v0.72.0

func (s *ShowDynamicTableRequest) WithStartsWith(startsWith *string) *ShowDynamicTableRequest

type ShowExternalTableByIDRequest added in v0.72.0

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

func NewShowExternalTableByIDRequest added in v0.72.0

func NewShowExternalTableByIDRequest(
	id AccountObjectIdentifier,
) *ShowExternalTableByIDRequest

type ShowExternalTableInRequest added in v0.72.0

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

func NewShowExternalTableInRequest added in v0.72.0

func NewShowExternalTableInRequest() *ShowExternalTableInRequest

func (*ShowExternalTableInRequest) WithAccount added in v0.72.0

func (*ShowExternalTableInRequest) WithDatabase added in v0.72.0

func (*ShowExternalTableInRequest) WithSchema added in v0.72.0

type ShowExternalTableOptions added in v0.72.0

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

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

ShowExternalTableOptions based on https://docs.snowflake.com/en/sql-reference/sql/show-external-tables

type ShowExternalTableRequest added in v0.72.0

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

func NewShowExternalTableRequest added in v0.72.0

func NewShowExternalTableRequest() *ShowExternalTableRequest

func (*ShowExternalTableRequest) WithIn added in v0.72.0

func (*ShowExternalTableRequest) WithLike added in v0.72.0

func (*ShowExternalTableRequest) WithLimitFrom added in v0.72.0

func (*ShowExternalTableRequest) WithStartsWith added in v0.72.0

func (s *ShowExternalTableRequest) WithStartsWith(startsWith *string) *ShowExternalTableRequest

func (*ShowExternalTableRequest) WithTerse added in v0.72.0

type ShowFailoverGroupOptions added in v0.66.0

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

ShowFailoverGroupOptions is based on https://docs.snowflake.com/en/sql-reference/sql/show-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
}

ShowFileFormatsOptions is based on https://docs.snowflake.com/en/sql-reference/sql/show-file-formats.

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
}

ShowGrantOptions is based on https://docs.snowflake.com/en/sql-reference/sql/show-grants.

type ShowGrantsIn added in v0.68.0

type ShowGrantsIn struct {
	Schema   *DatabaseObjectIdentifier `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"`
	DatabaseRole DatabaseObjectIdentifier `ddl:"identifier" sql:"DATABASE ROLE"`
}

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 is based on https://docs.snowflake.com/en/sql-reference/sql/show-masking-policies.

type ShowNetworkPolicyOptions added in v0.72.0

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

ShowNetworkPolicyOptions is based on https://docs.snowflake.com/en/sql-reference/sql/show-network-policies.

type ShowNetworkPolicyRequest added in v0.72.0

type ShowNetworkPolicyRequest struct{}

func NewShowNetworkPolicyRequest added in v0.72.0

func NewShowNetworkPolicyRequest() *ShowNetworkPolicyRequest

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
}

ShowParametersOptions is based on https://docs.snowflake.com/en/sql-reference/sql/show-parameters.

type ShowPasswordPolicyOptions added in v0.72.0

type ShowPasswordPolicyOptions 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
}

ShowPasswordPolicyOptions is based on https://docs.snowflake.com/en/sql-reference/sql/show-password-policies.

type ShowPipeOptions added in v0.72.0

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

ShowPipeOptions is based on https://docs.snowflake.com/en/sql-reference/sql/show-pipes.

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 is based on https://docs.snowflake.com/en/sql-reference/sql/show-resource-monitors.

type ShowRoleByIdRequest added in v0.72.0

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

func NewShowByIdRoleRequest added in v0.72.0

func NewShowByIdRoleRequest(id AccountObjectIdentifier) *ShowRoleByIdRequest

type ShowRoleOptions added in v0.72.0

type ShowRoleOptions struct {
	Like    *Like         `ddl:"keyword" sql:"LIKE"`
	InClass *RolesInClass `ddl:"keyword" sql:"IN CLASS"`
	// contains filtered or unexported fields
}

ShowRoleOptions based on https://docs.snowflake.com/en/sql-reference/sql/show-roles

type ShowRoleRequest added in v0.72.0

type ShowRoleRequest struct {
	Like    *Like
	InClass *RolesInClass
}

func NewShowRoleRequest added in v0.72.0

func NewShowRoleRequest() *ShowRoleRequest

func (*ShowRoleRequest) WithInClass added in v0.72.0

func (s *ShowRoleRequest) WithInClass(inClass RolesInClass) *ShowRoleRequest

func (*ShowRoleRequest) WithLike added in v0.72.0

func (s *ShowRoleRequest) WithLike(like *LikeRequest) *ShowRoleRequest

type ShowSchemaOptions added in v0.70.0

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

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

ShowSchemaOptions based on https://docs.snowflake.com/en/sql-reference/sql/show-schemas

type ShowSessionPolicyOptions added in v0.72.0

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

ShowSessionPolicyOptions is based on https://docs.snowflake.com/en/sql-reference/sql/show-session-policies.

type ShowSessionPolicyRequest added in v0.72.0

type ShowSessionPolicyRequest struct{}

func NewShowSessionPolicyRequest added in v0.72.0

func NewShowSessionPolicyRequest() *ShowSessionPolicyRequest

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
}

ShowShareOptions is based on https://docs.snowflake.com/en/sql-reference/sql/show-shares.

type ShowTaskOptions added in v0.73.0

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

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

ShowTaskOptions is based on https://docs.snowflake.com/en/sql-reference/sql/show-tasks.

type ShowTaskRequest added in v0.73.0

type ShowTaskRequest struct {
	Terse      *bool
	Like       *Like
	In         *In
	StartsWith *string
	RootOnly   *bool
	Limit      *LimitFrom
}

func NewShowTaskRequest added in v0.73.0

func NewShowTaskRequest() *ShowTaskRequest

func (*ShowTaskRequest) WithIn added in v0.73.0

func (s *ShowTaskRequest) WithIn(In *In) *ShowTaskRequest

func (*ShowTaskRequest) WithLike added in v0.73.0

func (s *ShowTaskRequest) WithLike(Like *Like) *ShowTaskRequest

func (*ShowTaskRequest) WithLimit added in v0.73.0

func (s *ShowTaskRequest) WithLimit(Limit *LimitFrom) *ShowTaskRequest

func (*ShowTaskRequest) WithRootOnly added in v0.73.0

func (s *ShowTaskRequest) WithRootOnly(RootOnly *bool) *ShowTaskRequest

func (*ShowTaskRequest) WithStartsWith added in v0.73.0

func (s *ShowTaskRequest) WithStartsWith(StartsWith *string) *ShowTaskRequest

func (*ShowTaskRequest) WithTerse added in v0.73.0

func (s *ShowTaskRequest) WithTerse(Terse *bool) *ShowTaskRequest

type ShowUserOptions added in v0.66.0

type ShowUserOptions struct {
	Terse *bool `ddl:"static" sql:"TERSE"`

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

ShowUserOptions is based on https://docs.snowflake.com/en/sql-reference/sql/show-users.

type ShowWarehouseOptions added in v0.66.0

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

ShowWarehouseOptions is based on https://docs.snowflake.com/en/sql-reference/sql/show-warehouses.

type Stage added in v0.70.0

type Stage struct {
	DatabaseName string
	SchemaName   string
	Name         string
}

Stage is a placeholder for now, will be implemented later.

func (*Stage) ID added in v0.70.0

func (v *Stage) ID() SchemaObjectIdentifier

func (*Stage) ObjectType added in v0.70.0

func (v *Stage) ObjectType() ObjectType

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 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 TagAssociationRequest added in v0.72.0

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

func NewTagAssociationRequest added in v0.72.0

func NewTagAssociationRequest(
	name ObjectIdentifier,
	value string,
) *TagAssociationRequest

type TargetLag added in v0.72.0

type TargetLag struct {
	Lagtime    *string `ddl:"keyword,single_quotes"`
	Downstream *bool   `ddl:"keyword" sql:"DOWNSTREAM"`
}

type Task added in v0.73.0

type Task struct {
	CreatedOn                 string
	Name                      string
	Id                        string
	DatabaseName              string
	SchemaName                string
	Owner                     string
	Comment                   string
	Warehouse                 string
	Schedule                  string
	Predecessors              string
	State                     string
	Definition                string
	Condition                 string
	AllowOverlappingExecution bool
	ErrorIntegration          string
	LastCommittedOn           string
	LastSuspendedOn           string
	OwnerRoleType             string
	Config                    string
	Budget                    string
}

func (*Task) ID added in v0.73.0

func (v *Task) ID() SchemaObjectIdentifier

type TaskSet added in v0.73.0

type TaskSet struct {
	Warehouse                   *AccountObjectIdentifier `ddl:"identifier" sql:"WAREHOUSE"`
	Schedule                    *string                  `ddl:"parameter,single_quotes" sql:"SCHEDULE"`
	Config                      *string                  `ddl:"parameter,no_quotes" sql:"CONFIG"`
	AllowOverlappingExecution   *bool                    `ddl:"parameter" sql:"ALLOW_OVERLAPPING_EXECUTION"`
	UserTaskTimeoutMs           *int                     `ddl:"parameter" sql:"USER_TASK_TIMEOUT_MS"`
	SuspendTaskAfterNumFailures *int                     `ddl:"parameter" sql:"SUSPEND_TASK_AFTER_NUM_FAILURES"`
	Comment                     *string                  `ddl:"parameter,single_quotes" sql:"COMMENT"`
	SessionParameters           *SessionParameters       `ddl:"list,no_parentheses"`
}

type TaskSetRequest added in v0.73.0

type TaskSetRequest struct {
	Warehouse                   *AccountObjectIdentifier
	Schedule                    *string
	Config                      *string
	AllowOverlappingExecution   *bool
	UserTaskTimeoutMs           *int
	SuspendTaskAfterNumFailures *int
	Comment                     *string
	SessionParameters           *SessionParameters
}

func NewTaskSetRequest added in v0.73.0

func NewTaskSetRequest() *TaskSetRequest

func (*TaskSetRequest) WithAllowOverlappingExecution added in v0.73.0

func (s *TaskSetRequest) WithAllowOverlappingExecution(AllowOverlappingExecution *bool) *TaskSetRequest

func (*TaskSetRequest) WithComment added in v0.73.0

func (s *TaskSetRequest) WithComment(Comment *string) *TaskSetRequest

func (*TaskSetRequest) WithConfig added in v0.73.0

func (s *TaskSetRequest) WithConfig(Config *string) *TaskSetRequest

func (*TaskSetRequest) WithSchedule added in v0.73.0

func (s *TaskSetRequest) WithSchedule(Schedule *string) *TaskSetRequest

func (*TaskSetRequest) WithSessionParameters added in v0.73.0

func (s *TaskSetRequest) WithSessionParameters(SessionParameters *SessionParameters) *TaskSetRequest

func (*TaskSetRequest) WithSuspendTaskAfterNumFailures added in v0.73.0

func (s *TaskSetRequest) WithSuspendTaskAfterNumFailures(SuspendTaskAfterNumFailures *int) *TaskSetRequest

func (*TaskSetRequest) WithUserTaskTimeoutMs added in v0.73.0

func (s *TaskSetRequest) WithUserTaskTimeoutMs(UserTaskTimeoutMs *int) *TaskSetRequest

func (*TaskSetRequest) WithWarehouse added in v0.73.0

func (s *TaskSetRequest) WithWarehouse(Warehouse *AccountObjectIdentifier) *TaskSetRequest

type TaskUnset added in v0.73.0

type TaskUnset struct {
	Warehouse                   *bool                   `ddl:"keyword" sql:"WAREHOUSE"`
	Schedule                    *bool                   `ddl:"keyword" sql:"SCHEDULE"`
	Config                      *bool                   `ddl:"keyword" sql:"CONFIG"`
	AllowOverlappingExecution   *bool                   `ddl:"keyword" sql:"ALLOW_OVERLAPPING_EXECUTION"`
	UserTaskTimeoutMs           *bool                   `ddl:"keyword" sql:"USER_TASK_TIMEOUT_MS"`
	SuspendTaskAfterNumFailures *bool                   `ddl:"keyword" sql:"SUSPEND_TASK_AFTER_NUM_FAILURES"`
	Comment                     *bool                   `ddl:"keyword" sql:"COMMENT"`
	SessionParametersUnset      *SessionParametersUnset `ddl:"list,no_parentheses"`
}

type TaskUnsetRequest added in v0.73.0

type TaskUnsetRequest struct {
	Warehouse                   *bool
	Schedule                    *bool
	Config                      *bool
	AllowOverlappingExecution   *bool
	UserTaskTimeoutMs           *bool
	SuspendTaskAfterNumFailures *bool
	Comment                     *bool
	SessionParametersUnset      *SessionParametersUnset
}

func NewTaskUnsetRequest added in v0.73.0

func NewTaskUnsetRequest() *TaskUnsetRequest

func (*TaskUnsetRequest) WithAllowOverlappingExecution added in v0.73.0

func (s *TaskUnsetRequest) WithAllowOverlappingExecution(AllowOverlappingExecution *bool) *TaskUnsetRequest

func (*TaskUnsetRequest) WithComment added in v0.73.0

func (s *TaskUnsetRequest) WithComment(Comment *bool) *TaskUnsetRequest

func (*TaskUnsetRequest) WithConfig added in v0.73.0

func (s *TaskUnsetRequest) WithConfig(Config *bool) *TaskUnsetRequest

func (*TaskUnsetRequest) WithSchedule added in v0.73.0

func (s *TaskUnsetRequest) WithSchedule(Schedule *bool) *TaskUnsetRequest

func (*TaskUnsetRequest) WithSessionParametersUnset added in v0.73.0

func (s *TaskUnsetRequest) WithSessionParametersUnset(SessionParametersUnset *SessionParametersUnset) *TaskUnsetRequest

func (*TaskUnsetRequest) WithSuspendTaskAfterNumFailures added in v0.73.0

func (s *TaskUnsetRequest) WithSuspendTaskAfterNumFailures(SuspendTaskAfterNumFailures *bool) *TaskUnsetRequest

func (*TaskUnsetRequest) WithUserTaskTimeoutMs added in v0.73.0

func (s *TaskUnsetRequest) WithUserTaskTimeoutMs(UserTaskTimeoutMs *bool) *TaskUnsetRequest

func (*TaskUnsetRequest) WithWarehouse added in v0.73.0

func (s *TaskUnsetRequest) WithWarehouse(Warehouse *bool) *TaskUnsetRequest

type Tasks added in v0.73.0

type Tasks interface {
	Create(ctx context.Context, request *CreateTaskRequest) error
	Clone(ctx context.Context, request *CloneTaskRequest) error
	Alter(ctx context.Context, request *AlterTaskRequest) error
	Drop(ctx context.Context, request *DropTaskRequest) error
	Show(ctx context.Context, request *ShowTaskRequest) ([]Task, error)
	ShowByID(ctx context.Context, id SchemaObjectIdentifier) (*Task, error)
	Describe(ctx context.Context, id SchemaObjectIdentifier) (*Task, error)
	Execute(ctx context.Context, request *ExecuteTaskRequest) error
}

type TimeFormat added in v0.71.0

type TimeFormat string
const (
	TimeFormatISO TimeFormat = "TimeFormatISO"
	TimeFormatRFC TimeFormat = "TimeFormatRFC"
	TimeFormatAny TimeFormat = "TimeFormatAny"
)

type TimeStampFormat added in v0.71.0

type TimeStampFormat string
const (
	TimeStampFormatISO   TimeStampFormat = "TimeStampFormatISO"
	TimeStampFormatRFC   TimeStampFormat = "TimeStampFormatRFC"
	TimeStampFormatOther TimeStampFormat = "TimeStampFormatOther"
	TimeStampFormatAny   TimeStampFormat = "TimeStampFormatAny"
)

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 TriggerAction added in v0.69.0

type TriggerAction string
const (
	TriggerActionSuspend          TriggerAction = "SUSPEND"
	TriggerActionSuspendImmediate TriggerAction = "SUSPEND_IMMEDIATE"
	TriggerActionNotify           TriggerAction = "NOTIFY"
)

type TriggerDefinition added in v0.69.0

type TriggerDefinition struct {
	Threshold     int           `ddl:"parameter,no_equals" sql:"ON"`
	TriggerAction TriggerAction `ddl:"parameter,no_equals" sql:"PERCENT DO"`
}

type UnsupportedDDLAction added in v0.65.0

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

type UseRoleRequest added in v0.72.0

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

func NewUseRoleRequest added in v0.72.0

func NewUseRoleRequest(id AccountObjectIdentifier) *UseRoleRequest

type UseSecondaryRolesRequest added in v0.72.0

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

func NewUseSecondaryRolesRequest added in v0.72.0

func NewUseSecondaryRolesRequest(option SecondaryRoleOption) *UseSecondaryRolesRequest

type User added in v0.65.0

type User struct {
	Name                  string
	CreatedOn             time.Time
	LoginName             string
	DisplayName           string
	FirstName             string
	LastName              string
	Email                 string
	MinsToUnlock          string
	DaysToExpiry          string
	Comment               string
	Disabled              bool
	MustChangePassword    bool
	SnowflakeLock         bool
	DefaultWarehouse      string
	DefaultNamespace      string
	DefaultRole           string
	DefaultSecondaryRoles string
	ExtAuthnDuo           bool
	ExtAuthnUid           string
	MinsToBypassMfa       string
	Owner                 string
	LastSuccessLogin      time.Time
	ExpiresAtTime         time.Time
	LockedUntilTime       time.Time
	HasPassword           bool
	HasRsaPublicKey       bool
}

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 {
	Name                                *StringProperty
	Comment                             *StringProperty
	DisplayName                         *StringProperty
	LoginName                           *StringProperty
	FirstName                           *StringProperty
	MiddleName                          *StringProperty
	LastName                            *StringProperty
	Email                               *StringProperty
	Password                            *StringProperty
	MustChangePassword                  *BoolProperty
	Disabled                            *BoolProperty
	SnowflakeLock                       *BoolProperty
	SnowflakeSupport                    *BoolProperty
	DaysToExpiry                        *IntProperty
	MinsToUnlock                        *IntProperty
	DefaultWarehouse                    *StringProperty
	DefaultNamespace                    *StringProperty
	DefaultRole                         *StringProperty
	DefaultSecondaryRoles               *StringProperty
	ExtAuthnDuo                         *BoolProperty
	ExtAuthnUid                         *StringProperty
	MinsToBypassMfa                     *IntProperty
	MinsToBypassNetworkPolicy           *IntProperty
	RsaPublicKey                        *StringProperty
	RsaPublicKeyFp                      *StringProperty
	RsaPublicKey2                       *StringProperty
	RsaPublicKey2Fp                     *StringProperty
	PasswordLastSetTime                 *StringProperty
	CustomLandingPageUrl                *StringProperty
	CustomLandingPageUrlFlushNextUiLoad *BoolProperty
}

UserDetails contains details about a user.

type UserObjectParameters added in v0.70.0

type UserObjectParameters struct {
	EnableUnredactedQuerySyntaxError *bool   `ddl:"parameter,no_quotes" sql:"ENABLE_UNREDACTED_QUERY_SYNTAX_ERROR"`
	NetworkPolicy                    *string `ddl:"parameter,single_quotes" sql:"NETWORK_POLICY"`
}

type UserObjectParametersUnset added in v0.70.0

type UserObjectParametersUnset struct {
	EnableUnredactedQuerySyntaxError *bool `ddl:"keyword" sql:"ENABLE_UNREDACTED_QUERY_SYNTAX_ERROR"`
	NetworkPolicy                    *bool `ddl:"keyword" sql:"NETWORK_POLICY"`
}

type UserObjectProperties added in v0.70.0

type UserObjectProperties struct {
	Password             *string         `ddl:"parameter,single_quotes" sql:"PASSWORD"`
	LoginName            *string         `ddl:"parameter,single_quotes" sql:"LOGIN_NAME"`
	DisplayName          *string         `ddl:"parameter,single_quotes" sql:"DISPLAY_NAME"`
	FirstName            *string         `ddl:"parameter,single_quotes" sql:"FIRST_NAME"`
	MiddleName           *string         `ddl:"parameter,single_quotes" sql:"MIDDLE_NAME"`
	LastName             *string         `ddl:"parameter,single_quotes" sql:"LAST_NAME"`
	Email                *string         `ddl:"parameter,single_quotes" sql:"EMAIL"`
	MustChangePassword   *bool           `ddl:"parameter,no_quotes" sql:"MUST_CHANGE_PASSWORD"`
	Disable              *bool           `ddl:"parameter,no_quotes" sql:"DISABLED"`
	DaysToExpiry         *int            `ddl:"parameter,single_quotes" sql:"DAYS_TO_EXPIRY"`
	MinsToUnlock         *int            `ddl:"parameter,single_quotes" sql:"MINS_TO_UNLOCK"`
	DefaultWarehosue     *string         `ddl:"parameter,single_quotes" sql:"DEFAULT_WAREHOUSE"`
	DefaultNamespace     *string         `ddl:"parameter,single_quotes" sql:"DEFAULT_NAMESPACE"`
	DefaultRole          *string         `ddl:"parameter,single_quotes" sql:"DEFAULT_ROLE"`
	DefaultSeconaryRoles *SecondaryRoles `ddl:"keyword" sql:"DEFAULT_SECONDARY_ROLES"`
	MinsToBypassMFA      *int            `ddl:"parameter,single_quotes" sql:"MINS_TO_BYPASS_MFA"`
	RSAPublicKey         *string         `ddl:"parameter,single_quotes" sql:"RSA_PUBLIC_KEY"`
	RSAPublicKey2        *string         `ddl:"parameter,single_quotes" sql:"RSA_PUBLIC_KEY_2"`
	Comment              *string         `ddl:"parameter,single_quotes" sql:"COMMENT"`
}

type UserObjectPropertiesUnset added in v0.70.0

type UserObjectPropertiesUnset struct {
	Password             *bool `ddl:"keyword" sql:"PASSWORD"`
	LoginName            *bool `ddl:"keyword" sql:"LOGIN_NAME"`
	DisplayName          *bool `ddl:"keyword" sql:"DISPLAY_NAME"`
	FirstName            *bool `ddl:"keyword" sql:"FIRST_NAME"`
	MiddleName           *bool `ddl:"keyword" sql:"MIDDLE_NAME"`
	LastName             *bool `ddl:"keyword" sql:"LAST_NAME"`
	Email                *bool `ddl:"keyword" sql:"EMAIL"`
	MustChangePassword   *bool `ddl:"keyword" sql:"MUST_CHANGE_PASSWORD"`
	Disable              *bool `ddl:"keyword" sql:"DISABLED"`
	DaysToExpiry         *bool `ddl:"keyword" sql:"DAYS_TO_EXPIRY"`
	MinsToUnlock         *bool `ddl:"keyword" sql:"MINS_TO_UNLOCK"`
	DefaultWarehosue     *bool `ddl:"keyword" sql:"DEFAULT_WAREHOUSE"`
	DefaultNamespace     *bool `ddl:"keyword" sql:"DEFAULT_NAMESPACE"`
	DefaultRole          *bool `ddl:"keyword" sql:"DEFAULT_ROLE"`
	DefaultSeconaryRoles *bool `ddl:"keyword" sql:"DEFAULT_SECONDARY_ROLES"`
	MinsToBypassMFA      *bool `ddl:"keyword" sql:"MINS_TO_BYPASS_MFA"`
	RSAPublicKey         *bool `ddl:"keyword" sql:"RSA_PUBLIC_KEY"`
	RSAPublicKey2        *bool `ddl:"keyword" sql:"RSA_PUBLIC_KEY_2"`
	Comment              *bool `ddl:"keyword" sql:"COMMENT"`
}

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"
	UserParameterClientMetadataRequestUseConnectionCtx UserParameter = "CLIENT_METADATA_REQUEST_USE_CONNECTION_CTX"
	UserParameterClientMetadataUseSessionDatabase      UserParameter = "CLIENT_METADATA_USE_SESSION_DATABASE"
	UserParameterClientResultColumnCaseInsensitive     UserParameter = "CLIENT_RESULT_COLUMN_CASE_INSENSITIVE"
	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"
	UserParameterMultiStatementCount                   UserParameter = "MULTI_STATEMENT_COUNT"
	UserParameterQueryTag                              UserParameter = "QUERY_TAG"
	UserParameterQuotedIdentifiersIgnoreCase           UserParameter = "QUOTED_IDENTIFIERS_IGNORE_CASE"
	UserParameterRowsPerResultset                      UserParameter = "ROWS_PER_RESULTSET"
	UserParameterSimulatedDataSharingConsumer          UserParameter = "SIMULATED_DATA_SHARING_CONSUMER"
	UserParameterStatementTimeoutInSeconds             UserParameter = "STATEMENT_TIMEOUT_IN_SECONDS"
	UserParameterStrictJsonOutput                      UserParameter = "STRICT_JSON_OUTPUT"
	UserParameterTimeInputFormat                       UserParameter = "TIME_INPUT_FORMAT"
	UserParameterTimeOutputFormat                      UserParameter = "TIME_OUTPUT_FORMAT"
	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"
	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 UserSet added in v0.70.0

type UserSet struct {
	PasswordPolicy    *string               `ddl:"parameter" sql:"PASSWORD POLICY"`
	SessionPolicy     *string               `ddl:"parameter" sql:"SESSION POLICY"`
	Tags              []TagAssociation      `ddl:"keyword,parentheses" sql:"TAG"`
	ObjectProperties  *UserObjectProperties `ddl:"keyword"`
	ObjectParameters  *UserObjectParameters `ddl:"keyword"`
	SessionParameters *SessionParameters    `ddl:"keyword"`
}

type UserTag added in v0.70.0

type UserTag struct {
	Name  ObjectIdentifier `ddl:"keyword"`
	Value string           `ddl:"parameter,single_quotes"`
}

type UserUnset added in v0.70.0

type UserUnset struct {
	PasswordPolicy    *bool                      `ddl:"keyword" sql:"PASSWORD POLICY"`
	SessionPolicy     *bool                      `ddl:"keyword" sql:"SESSION POLICY"`
	Tags              *[]string                  `ddl:"keyword" sql:"TAG"`
	ObjectProperties  *UserObjectPropertiesUnset `ddl:"list"`
	ObjectParameters  *UserObjectParametersUnset `ddl:"list"`
	SessionParameters *SessionParametersUnset    `ddl:"list"`
}

type Users added in v0.65.0

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 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"
)

Source Files

Directories

Path Synopsis
dto-builder-generator
poc

Jump to

Keyboard shortcuts

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