snowflake

package
v0.9.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const SPNApplicationId = "SYNQ_Platform"

https://github.com/snowflakedb/gosnowflake/blob/099708d318689634a558f705ccc19b3b7b278972/doc.go#L107

Variables

This section is empty.

Functions

func EnrichSnowflakeContext

func EnrichSnowflakeContext(ctx context.Context, db *sql.DB) context.Context

EnrichSnowflakeContext wraps the context with a query ID channel so the Snowflake driver reports the query ID. Creates or reuses a DriverStats accumulator and registers an onFinish hook to collect the query ID (and optionally detailed stats) when the Collector finishes.

func IsNotFoundOrNoPermissionError added in v0.5.0

func IsNotFoundOrNoPermissionError(err error) bool

IsNotFoundOrNoPermissionError checks if the error is a Snowflake "does not exist or not authorized" error

func IsUnsupportedFeatureDataLineageError added in v0.5.0

func IsUnsupportedFeatureDataLineageError(err error) bool

IsUnsupportedFeatureDataLineageError checks if the error is a Snowflake "Unsupported feature 'Data Lineage'" error

func NewQuerier

func NewQuerier[T any](conn *SnowflakeExecutor) querier.Querier[T]

Types

type Executor

type Executor interface {
	stdsql.StdSqlExecutor
	QueryRows(ctx context.Context, q string, args ...any) (*sqlx.Rows, error)
}

type Mock

type Mock struct {
	SnowflakeExecutor
	// contains filtered or unexported fields
}

func (*Mock) QueryRows

func (bq *Mock) QueryRows(ctx context.Context, q string, args ...any) (*sqlx.Rows, error)

type SnowflakeConf

type SnowflakeConf struct {
	User                 string
	Password             string
	PrivateKey           []byte
	PrivateKeyFile       string
	PrivateKeyPassphrase string
	Account              string
	Warehouse            string
	Databases            []string
	Role                 string
	// AuthType specifies the authentication method: empty (default, uses password or private_key),
	// "externalbrowser" (SSO via browser). When set to "externalbrowser", opens browser for SSO login
	// and caches the ID token locally in the OS credential manager (Keychain on macOS, Credential Manager on Windows).
	AuthType string
	// Transporter is an optional http.RoundTripper to use for the underlying HTTP client. Use [gosnowflake.SnowflakeTransport] as a base.
	Transporter http.RoundTripper
}

type SnowflakeExecutor

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

func NewSnowflakeExecutor

func NewSnowflakeExecutor(ctx context.Context, conf *SnowflakeConf) (*SnowflakeExecutor, error)

func (*SnowflakeExecutor) Close

func (e *SnowflakeExecutor) Close() error

func (*SnowflakeExecutor) Exec

func (e *SnowflakeExecutor) Exec(ctx context.Context, sql string) error

func (*SnowflakeExecutor) GetDb

func (e *SnowflakeExecutor) GetDb() *sqlx.DB

func (*SnowflakeExecutor) QueryRows

func (e *SnowflakeExecutor) QueryRows(ctx context.Context, q string, args ...any) (*sqlx.Rows, error)

Jump to

Keyboard shortcuts

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