snowflake

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package snowflake implements the Snowflake driver using the SQL REST API v2. Uses net/http (no external dependencies) with PAT (Personal Access Token) auth.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClassifyError

func ClassifyError(err error) error

ClassifyError classifies a Snowflake error. Exported for testing.

func Connect

func Connect(opts Opts) (driver.Connection, error)

Connect creates a new Snowflake connection via the SQL REST API v2.

func ParseValue

func ParseValue(raw *string, col columnType) any

ParseValue converts a raw Snowflake string value to the appropriate Go type. Exported for testing.

func ValidateReadOnly

func ValidateReadOnly(sqlStr string) error

ValidateReadOnly checks if a SQL statement is allowed in read-only mode. Exported for testing.

Types

type Opts

type Opts struct {
	Account   string
	Database  string
	Schema    string
	Warehouse string
	Role      string
	Token     string // PAT secret
	Readonly  bool
	BaseURL   string // override API base URL (for testing with mock servers)
}

Opts holds Snowflake connection options.

Jump to

Keyboard shortcuts

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