snowflake

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

README


title: 'Snowflake'

Snowflake connector allows querying Snowflake data warehouse.

Config Schema

Field Type Required Description
account string yes Snowflake account identifier
database string yes Database name
user string yes Username
password string yes Password
warehouse string yes Warehouse to use for queries
schema string yes Schema name
role string yes Role to assume

Config example:

account: myaccount    # Your Snowflake account identifier
database: MYDB
user: myuser
password: secret
warehouse: COMPUTE_WH # Warehouse to use for queries
schema: PUBLIC        # Schema name
role: ACCOUNTADMIN    # Role to assume 

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Account   string
	Database  string
	User      string
	Password  string
	Warehouse string
	Schema    string
	Role      string
}

func (Config) Doc

func (c Config) Doc() string

func (Config) MakeDSN

func (c Config) MakeDSN() (string, error)

func (Config) Type

func (c Config) Type() string

type Connector

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

func (Connector) Discovery

func (c Connector) Discovery(ctx context.Context) ([]model.Table, error)

func (*Connector) GuessColumnType

func (c *Connector) GuessColumnType(sqlType string) model.ColumnType

GuessColumnType implements TypeGuesser interface for Snowflake

func (*Connector) InferQuery

func (c *Connector) InferQuery(ctx context.Context, query string) ([]model.ColumnSchema, error)

InferQuery implements the Connector interface

func (*Connector) InferResultColumns

func (c *Connector) InferResultColumns(ctx context.Context, query string) ([]model.ColumnSchema, error)

InferResultColumns returns column information for the given query

func (Connector) LoadsColumns

func (c Connector) LoadsColumns(ctx context.Context, tableName string) ([]model.ColumnSchema, error)

func (Connector) Ping

func (c Connector) Ping(ctx context.Context) error

func (Connector) Query

func (c Connector) Query(ctx context.Context, endpoint model.Endpoint, params map[string]any) ([]map[string]any, error)

func (Connector) Sample

func (c Connector) Sample(ctx context.Context, table model.Table) ([]map[string]any, error)

Jump to

Keyboard shortcuts

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