Versions in this module Expand all Collapse all v2 v2.0.0 Mar 13, 2026 Changes in this version + const DateType + const ErrAsync + const ErrBindSerialization + const ErrBindUpload + const ErrCodeClientConfigFailed + const ErrCodeEmptyAccountCode + const ErrCodeEmptyOAuthParameters + const ErrCodeEmptyPasswordAndToken + const ErrCodeEmptyPasswordCode + const ErrCodeEmptyUsernameCode + const ErrCodeFailedToConnect + const ErrCodeFailedToFindDSNInToml + const ErrCodeFailedToParseAuthenticator + const ErrCodeFailedToParseHost + const ErrCodeFailedToParsePort + const ErrCodeIdpConnectionError + const ErrCodeInvalidFilePermission + const ErrCodeMissingTLSConfig + const ErrCodePrivateKeyParseError + const ErrCodeRegionOverlap + const ErrCodeSSOURLNotMatch + const ErrCodeServiceUnavailable + const ErrCodeTomlFileParsingFailed + const ErrCommandNotRecognized + const ErrCompressionNotSupported + const ErrFailedToAuth + const ErrFailedToAuthOKTA + const ErrFailedToAuthSAML + const ErrFailedToCancelQuery + const ErrFailedToCloseSession + const ErrFailedToConvertToS3Client + const ErrFailedToDownloadFromStage + const ErrFailedToGetChunk + const ErrFailedToGetExternalBrowserResponse + const ErrFailedToGetSSO + const ErrFailedToHeartbeat + const ErrFailedToParseResponse + const ErrFailedToPostQuery + const ErrFailedToRenewSession + const ErrFailedToUploadToStage + const ErrFileNotExists + const ErrInternalNotMatchEncryptMaterial + const ErrInvalidBinaryHexForm + const ErrInvalidOffsetStr + const ErrInvalidPadding + const ErrInvalidStageFs + const ErrInvalidStageLocation + const ErrInvalidTimestampTz + const ErrLocalPathNotDirectory + const ErrMissingAccessATokenButRefreshTokenPresent + const ErrNoDefaultTransactionIsolationLevel + const ErrNoReadOnlyTransaction + const ErrNoResultIDs + const ErrNonArrowResponseInArrowBatches + const ErrNotImplemented + const ErrNullValueInArray + const ErrNullValueInMap + const ErrOCSPInvalidValidity + const ErrOCSPNoOCSPResponderURL + const ErrOCSPStatusRevoked + const ErrOCSPStatusUnknown + const ErrObjectNotExistOrAuthorized + const ErrQueryIDFormat + const ErrQueryIsRunning + const ErrQueryReportedError + const ErrQueryStatus + const ErrRoleNotExist + const ErrSessionGone + const ErrTooHighTimestampPrecision + const SFQueryAborted + const SFQueryAborting + const SFQueryBlocked + const SFQueryDisconnected + const SFQueryFailedWithError + const SFQueryFailedWithIncident + const SFQueryNoData + const SFQueryQueueRepairingWarehouse + const SFQueryQueued + const SFQueryRestarted + const SFQueryResumingWarehouse + const SFQueryRunning + const SFQuerySuccess + const SQLStateConnectionFailure + const SQLStateConnectionRejected + const SQLStateConnectionWasNotEstablished + const SQLStateFeatureNotSupported + const SQLStateInvalidDataTimeFormat + const SQLStateNumericValueOutOfRange + const SnowflakeGoDriverVersion + const TimeType + const TimestampLTZType + const TimestampNTZType + const TimestampTZType + var DataTypeArray = []byte + var DataTypeBinary = []byte + var DataTypeBoolean = []byte + var DataTypeDate = []byte + var DataTypeDecfloat = []byte + var DataTypeFixed = []byte + var DataTypeNilArray = []byte + var DataTypeNilMap = []byte + var DataTypeNilObject = []byte + var DataTypeObject = []byte + var DataTypeReal = []byte + var DataTypeText = []byte + var DataTypeTime = []byte + var DataTypeTimestampLtz = []byte + var DataTypeTimestampNtz = []byte + var DataTypeTimestampTz = []byte + var DataTypeVariant = []byte + var OcspCacheServerTimeout = defaultOCSPCacheServerTimeout + var OcspMaxRetryCount = defaultOCSPMaxRetryCount + var OcspResponderTimeout = defaultOCSPResponderTimeout + var S3LoggingMode aws.ClientLogMode + func Array(a interface{}, typ ...any) (interface{}, error) + func DSN(cfg *Config) (dsn string, err error) + func DeregisterTLSConfig(key string) error + func GetClientLogContextHooks() map[string]ClientLogContextHook + func GetFromEnv(name string, failOnMissing bool) (string, error) + func Location(offset int) *time.Location + func LocationWithOffsetString(offsets string) (loc *time.Location, err error) + func NewConnector(driver InternalSnowflakeDriver, config Config) driver.Connector + func RegisterLogContextHook(contextKey string, ctxExtractor ClientLogContextHook) + func RegisterTLSConfig(key string, config *tls.Config) error + func SetLogKeys(keys ...ContextKey) + func SetLogger(logger SFLogger) error + func StartOCSPCacheClearer() + func StopOCSPCacheClearer() + func WithArrowAllocator(ctx context.Context, pool memory.Allocator) context.Context + func WithAsyncMode(ctx context.Context) context.Context + func WithDecfloatMappingEnabled(ctx context.Context) context.Context + func WithDescribeOnly(ctx context.Context) context.Context + func WithEmbeddedValuesNullable(ctx context.Context) context.Context + func WithFetchResultByID(ctx context.Context, queryID string) context.Context + func WithFileGetStream(ctx context.Context, writer io.Writer) context.Context + func WithFilePutStream(ctx context.Context, reader io.Reader) context.Context + func WithFileTransferOptions(ctx context.Context, options *SnowflakeFileTransferOptions) context.Context + func WithHigherPrecision(ctx context.Context) context.Context + func WithInternal(ctx context.Context) context.Context + func WithLogQueryParameters(ctx context.Context) context.Context + func WithLogQueryText(ctx context.Context) context.Context + func WithMultiStatement(ctx context.Context, num int) context.Context + func WithQueryIDChan(ctx context.Context, c chan<- string) context.Context + func WithQueryTag(ctx context.Context, tag string) context.Context + func WithRequestID(ctx context.Context, requestID UUID) context.Context + func WithStructuredTypesEnabled(ctx context.Context) context.Context + type ArrayOfScanners []T + func ScanArrayOfScanners[T sql.Scanner](value *[]T) *ArrayOfScanners[T] + func (st *ArrayOfScanners[T]) Scan(val any) error + type ArrowStreamBatch struct + Loc *time.Location + func (asb *ArrowStreamBatch) GetStream(ctx context.Context) (io.ReadCloser, error) + func (asb *ArrowStreamBatch) NumRows() int64 + type ArrowStreamLoader interface + GetBatches func() ([]ArrowStreamBatch, error) + JSONData func() [][]*string + Location func() *time.Location + NextResultSet func(ctx context.Context) error + RowTypes func() []query.ExecResponseRowType + TotalRows func() int64 + type AuthType int + const AuthTypeExternalBrowser + const AuthTypeJwt + const AuthTypeOAuth + const AuthTypeOAuthAuthorizationCode + const AuthTypeOAuthClientCredentials + const AuthTypeOkta + const AuthTypePat + const AuthTypeSnowflake + const AuthTypeTokenAccessor + const AuthTypeUsernamePasswordMFA + const AuthTypeWorkloadIdentityFederation + func (authType AuthType) String() string + type CertRevocationCheckMode int + const CertRevocationCheckAdvisory + const CertRevocationCheckDisabled + const CertRevocationCheckEnabled + func (m CertRevocationCheckMode) String() string + type ClientConfig struct + Common *ClientConfigCommonProps + type ClientConfigCommonProps struct + LogLevel string + LogPath string + type ClientLogContextHook = sflog.ClientLogContextHook + type Config struct + Account string + Application string + Authenticator AuthType + CertRevocationCheckMode CertRevocationCheckMode + ClientConfigFile string + ClientRequestMfaToken ConfigBool + ClientStoreTemporaryCredential ConfigBool + ClientTimeout time.Duration + CloudStorageTimeout time.Duration + ConnectionDiagnosticsAllowlistFile string + ConnectionDiagnosticsEnabled bool + CrlAllowCertificatesWithoutCrlURL ConfigBool + CrlDownloadMaxSize int + CrlHTTPClientTimeout time.Duration + CrlInMemoryCacheDisabled bool + CrlOnDiskCacheDisabled bool + Database string + DisableConsoleLogin ConfigBool + DisableOCSPChecks bool + DisableQueryContextCache bool + DisableSamlURLCheck ConfigBool + EnableSingleUseRefreshTokens bool + ExternalBrowserTimeout time.Duration + Host string + IncludeRetryReason ConfigBool + JWTClientTimeout time.Duration + JWTExpireTimeout time.Duration + LogQueryParameters bool + LogQueryText bool + LoginTimeout time.Duration + MaxRetryCount int + NoProxy string + OCSPFailOpen OCSPFailOpenMode + OauthAuthorizationURL string + OauthClientID string + OauthClientSecret string + OauthRedirectURI string + OauthScope string + OauthTokenRequestURL string + OktaURL *url.URL + Params map[string]*string + Passcode string + PasscodeInPassword bool + Password string + Port int + PrivateKey *rsa.PrivateKey + Protocol string + ProxyHost string + ProxyPassword string + ProxyPort int + ProxyProtocol string + ProxyUser string + Region string + RequestTimeout time.Duration + Role string + Schema string + ServerSessionKeepAlive bool + SingleAuthenticationPrompt ConfigBool + TLSConfigName string + TmpDirPath string + Token string + TokenAccessor TokenAccessor + TokenFilePath string + Tracing string + Transporter http.RoundTripper + User string + ValidateDefaultParameters ConfigBool + Warehouse string + WorkloadIdentityEntraResource string + WorkloadIdentityImpersonationPath []string + WorkloadIdentityProvider string + func GetConfigFromEnv(properties []*ConfigParam) (*Config, error) + func ParseDSN(dsn string) (cfg *Config, err error) + func (c *Config) Validate() error + type ConfigBool uint8 + const ConfigBoolFalse + const ConfigBoolTrue + func (cb ConfigBool) String() string + type ConfigParam struct + EnvName string + FailOnMissing bool + Name string + type Connector struct + func (t Connector) Connect(ctx context.Context) (driver.Conn, error) + func (t Connector) Driver() driver.Driver + type ContextKey string + const SFSessionIDKey + const SFSessionUserKey + func GetLogKeys() []ContextKey + type GoroutineWrapperFunc func(ctx context.Context, f func()) + var GoroutineWrapper GoroutineWrapperFunc = noopGoroutineWrapper + type InternalClient interface + Get func(context.Context, *url.URL, map[string]string, time.Duration) (*http.Response, error) + Post func(context.Context, *url.URL, map[string]string, []byte, time.Duration, ...) (*http.Response, error) + type InternalSnowflakeDriver interface + Open func(dsn string) (driver.Conn, error) + OpenWithConfig func(ctx context.Context, config Config) (driver.Conn, error) + type Level = sflog.Level + type LogEntry = sflog.LogEntry + type MapOfScanners map[K]V + func ScanMapOfScanners[K comparable, V sql.Scanner](m *map[K]V) *MapOfScanners[K, V] + func (st *MapOfScanners[K, V]) Scan(val any) error + type NilMapTypes struct + Key reflect.Type + Value reflect.Type + type OCSPFailOpenMode uint32 + const OCSPFailOpenFalse + const OCSPFailOpenTrue + type ObjectType struct + type QueryStatus string + const QueryFailed + const QueryStatusComplete + const QueryStatusInProgress + type SFLogger = sflog.SFLogger + func CreateDefaultLogger() SFLogger + func GetLogger() SFLogger + type SFSlogLogger = sflog.SFSlogLogger + type SnowflakeConnection interface + AddTelemetryData func(ctx context.Context, eventDate time.Time, data map[string]string) error + GetQueryStatus func(ctx context.Context, queryID string) (*SnowflakeQueryStatus, error) + type SnowflakeDriver struct + func (d SnowflakeDriver) Open(dsn string) (driver.Conn, error) + func (d SnowflakeDriver) OpenConnector(dsn string) (driver.Connector, error) + func (d SnowflakeDriver) OpenWithConfig(ctx context.Context, config Config) (driver.Conn, error) + type SnowflakeError struct + IncludeQueryID bool + Message string + MessageArgs []interface{} + Number int + QueryID string + SQLState string + func (se *SnowflakeError) Error() string + type SnowflakeFileTransferOptions struct + MultiPartThreshold int64 + type SnowflakeParameter struct + ActivateVersion string + Default string + Description string + ExpiresAt string + IsExpired string + Key string + Level string + ParameterComment string + PartialRollout string + SetByClass string + SetByControllingParameter string + SetByThreadID string + SetByThreadName string + SetByUser string + SetInJob string + SetOn string + Type string + Unknown string + Value string + func ScanSnowflakeParameter(rows *sql.Rows) (*SnowflakeParameter, error) + type SnowflakeQueryStatus struct + EndTime int64 + ErrorCode string + ErrorMessage string + ProducedRows int64 + SQLText string + ScanBytes int64 + StartTime int64 + type SnowflakeResult interface + GetQueryID func() string + GetStatus func() QueryStatus + type SnowflakeRows interface + GetQueryID func() string + GetStatus func() QueryStatus + NextResultSet func() error + type SnowflakeStmt interface + GetQueryID func() string + type StructuredObject interface + GetBigFloat func(fieldName string) (*big.Float, error) + GetBigInt func(fieldName string) (*big.Int, error) + GetBool func(fieldName string) (bool, error) + GetByte func(fieldName string) (byte, error) + GetBytes func(fieldName string) ([]byte, error) + GetFloat32 func(fieldName string) (float32, error) + GetFloat64 func(fieldName string) (float64, error) + GetInt16 func(fieldName string) (int16, error) + GetInt32 func(fieldName string) (int32, error) + GetInt64 func(fieldName string) (int64, error) + GetNullBool func(fieldName string) (sql.NullBool, error) + GetNullByte func(fieldName string) (sql.NullByte, error) + GetNullFloat64 func(fieldName string) (sql.NullFloat64, error) + GetNullInt16 func(fieldName string) (sql.NullInt16, error) + GetNullInt32 func(fieldName string) (sql.NullInt32, error) + GetNullInt64 func(fieldName string) (sql.NullInt64, error) + GetNullString func(fieldName string) (sql.NullString, error) + GetNullTime func(fieldName string) (sql.NullTime, error) + GetRaw func(fieldName string) (any, error) + GetString func(fieldName string) (string, error) + GetStruct func(fieldName string, scanner sql.Scanner) (sql.Scanner, error) + GetTime func(fieldName string) (time.Time, error) + ScanTo func(sc sql.Scanner) error + type StructuredObjectWriter interface + Write func(sowc StructuredObjectWriterContext) error + type StructuredObjectWriterContext interface + WriteAll func(sow StructuredObjectWriter) error + WriteBool func(fieldName string, value bool) error + WriteByt func(fieldName string, value byte) error + WriteBytes func(fieldName string, value []byte) error + WriteFloat32 func(fieldName string, value float32) error + WriteFloat64 func(fieldName string, value float64) error + WriteInt16 func(fieldName string, value int16) error + WriteInt32 func(fieldName string, value int32) error + WriteInt64 func(fieldName string, value int64) error + WriteNullBool func(fieldName string, value sql.NullBool) error + WriteNullByte func(fieldName string, value sql.NullByte) error + WriteNullFloat64 func(fieldName string, value sql.NullFloat64) error + WriteNullInt16 func(fieldName string, value sql.NullInt16) error + WriteNullInt32 func(fieldName string, value sql.NullInt32) error + WriteNullInt64 func(fieldName string, value sql.NullInt64) error + WriteNullRaw func(fieldName string, typ reflect.Type, tsmode ...[]byte) error + WriteNullString func(fieldName string, value sql.NullString) error + WriteNullTime func(fieldName string, value sql.NullTime, tsmode []byte) error + WriteNullableStruct func(fieldName string, value StructuredObjectWriter, typ reflect.Type) error + WriteRaw func(fieldName string, value any, tsmode ...[]byte) error + WriteString func(fieldName string, value string) error + WriteStruct func(fieldName string, value StructuredObjectWriter) error + WriteTime func(fieldName string, value time.Time, tsmode []byte) error + type TokenAccessor interface + GetTokens func() (token string, masterToken string, sessionID int64) + Lock func() error + SetTokens func(token string, masterToken string, sessionID int64) + Unlock func() + type TypedNullTime struct + Time sql.NullTime + TzType timezoneType + type UUID [16]byte + func NewUUID() UUID + func ParseUUID(str string) UUID + func (u UUID) String() string Other modules containing this package github.com/influxdata/gosnowflake