snowflake

package
v0.0.0-...-0ade494 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AWSAccessKey       = "accessKey"
	AWSAccessSecret    = "accessKeyID"
	StorageIntegration = "storageIntegration"
	SFAccount          = "account"
	SFWarehouse        = "warehouse"
	SFDbName           = "database"
	SFUserName         = "user"
	SFPassword         = "password"
)

String constants for snowflake destination config

Variables

This section is empty.

Functions

func ColumnsWithDataTypes

func ColumnsWithDataTypes(columns map[string]string, prefix string) string

func Connect

func Connect(cred SnowflakeCredentialsT) (*sql.DB, error)

func Init

func Init()

Types

type HandleT

type HandleT struct {
	Db             *sql.DB
	Namespace      string
	CloudProvider  string
	ObjectStorage  string
	Warehouse      warehouseutils.WarehouseT
	Uploader       warehouseutils.UploaderI
	ConnectTimeout time.Duration
}

func (*HandleT) AddColumn

func (sf *HandleT) AddColumn(tableName, columnName, columnType string) (err error)

func (*HandleT) AlterColumn

func (sf *HandleT) AlterColumn(_, _, _ string) (err error)

func (*HandleT) Cleanup

func (sf *HandleT) Cleanup()

func (*HandleT) Connect

func (sf *HandleT) Connect(warehouse warehouseutils.WarehouseT) (client.Client, error)

func (*HandleT) CrashRecover

func (sf *HandleT) CrashRecover(_ warehouseutils.WarehouseT) (err error)

func (*HandleT) CreateSchema

func (sf *HandleT) CreateSchema() (err error)

func (*HandleT) CreateTable

func (sf *HandleT) CreateTable(tableName string, columnMap map[string]string) (err error)

func (*HandleT) DownloadIdentityRules

func (sf *HandleT) DownloadIdentityRules(gzWriter *misc.GZipWriter) (err error)

DownloadIdentityRules gets distinct combinations of anonymous_id, user_id from tables in warehouse

func (*HandleT) DropTable

func (sf *HandleT) DropTable(tableName string) (err error)

func (*HandleT) FetchSchema

func (sf *HandleT) FetchSchema(warehouse warehouseutils.WarehouseT) (schema warehouseutils.SchemaT, err error)

FetchSchema queries snowflake and returns the schema assoiciated with provided namespace

func (*HandleT) GetTotalCountInTable

func (sf *HandleT) GetTotalCountInTable(tableName string) (total int64, err error)

func (*HandleT) IsEmpty

func (sf *HandleT) IsEmpty(warehouse warehouseutils.WarehouseT) (empty bool, err error)

func (*HandleT) LoadIdentityMappingsTable

func (sf *HandleT) LoadIdentityMappingsTable() (err error)

func (*HandleT) LoadIdentityMergeRulesTable

func (sf *HandleT) LoadIdentityMergeRulesTable() (err error)

func (*HandleT) LoadTable

func (sf *HandleT) LoadTable(tableName string) error

func (*HandleT) LoadTestTable

func (sf *HandleT) LoadTestTable(location, tableName string, _ map[string]interface{}, _ string) (err error)

func (*HandleT) LoadUserTables

func (sf *HandleT) LoadUserTables() map[string]error

func (*HandleT) SetConnectionTimeout

func (sf *HandleT) SetConnectionTimeout(timeout time.Duration)

func (*HandleT) Setup

func (sf *HandleT) Setup(warehouse warehouseutils.WarehouseT, uploader warehouseutils.UploaderI) (err error)

func (*HandleT) TestConnection

func (sf *HandleT) TestConnection(warehouse warehouseutils.WarehouseT) (err error)

type OptionalCredsT

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

type SnowflakeCredentialsT

type SnowflakeCredentialsT struct {
	Account  string
	WHName   string
	DBName   string
	Username string
	Password string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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