snowflake

package
v1.13.0-preview-2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColumnsWithDataTypes

func ColumnsWithDataTypes(columns model.TableSchema, prefix string) string

Types

type Snowflake added in v1.7.0

type Snowflake struct {
	DB            *sqlmw.DB
	Namespace     string
	CloudProvider string
	ObjectStorage string
	Warehouse     model.Warehouse
	Uploader      whutils.Uploader
	// contains filtered or unexported fields
}

func New added in v1.8.0

func New(conf *config.Config, log logger.Logger, stat stats.Stats) (*Snowflake, error)

func (*Snowflake) AddColumns added in v1.7.0

func (sf *Snowflake) AddColumns(ctx context.Context, tableName string, columnsInfo []whutils.ColumnInfo) (err error)

func (*Snowflake) AlterColumn added in v1.7.0

func (*Snowflake) Cleanup added in v1.7.0

func (sf *Snowflake) Cleanup(context.Context)

func (*Snowflake) Connect added in v1.7.0

func (sf *Snowflake) Connect(ctx context.Context, warehouse model.Warehouse) (client.Client, error)

func (*Snowflake) CrashRecover added in v1.7.0

func (*Snowflake) CrashRecover(context.Context)

func (*Snowflake) CreateSchema added in v1.7.0

func (sf *Snowflake) CreateSchema(ctx context.Context) (err error)

func (*Snowflake) CreateTable added in v1.7.0

func (sf *Snowflake) CreateTable(ctx context.Context, tableName string, columnMap model.TableSchema) (err error)

func (*Snowflake) DeleteBy added in v1.7.0

func (sf *Snowflake) DeleteBy(ctx context.Context, tableNames []string, params whutils.DeleteByParams) (err error)

func (*Snowflake) DownloadIdentityRules added in v1.7.0

func (sf *Snowflake) DownloadIdentityRules(ctx context.Context, gzWriter *misc.GZipWriter) (err error)

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

func (*Snowflake) DropTable added in v1.7.0

func (sf *Snowflake) DropTable(ctx context.Context, tableName string) (err error)

func (*Snowflake) ErrorMappings added in v1.7.0

func (*Snowflake) ErrorMappings() []model.JobError

func (*Snowflake) FetchSchema added in v1.7.0

func (sf *Snowflake) FetchSchema(ctx context.Context) (model.Schema, model.Schema, error)

FetchSchema queries the snowflake database and returns the schema

func (*Snowflake) GetTotalCountInTable added in v1.7.0

func (sf *Snowflake) GetTotalCountInTable(ctx context.Context, tableName string) (int64, error)

func (*Snowflake) IsEmpty added in v1.7.0

func (sf *Snowflake) IsEmpty(ctx context.Context, warehouse model.Warehouse) (empty bool, err error)

func (*Snowflake) LoadIdentityMappingsTable added in v1.7.0

func (sf *Snowflake) LoadIdentityMappingsTable(ctx context.Context) error

func (*Snowflake) LoadIdentityMergeRulesTable added in v1.7.0

func (sf *Snowflake) LoadIdentityMergeRulesTable(ctx context.Context) error

func (*Snowflake) LoadTable added in v1.7.0

func (sf *Snowflake) LoadTable(ctx context.Context, tableName string) error

func (*Snowflake) LoadTestTable added in v1.7.0

func (sf *Snowflake) LoadTestTable(
	ctx context.Context, location, tableName string, _ map[string]interface{}, _ string,
) (err error)

func (*Snowflake) LoadUserTables added in v1.7.0

func (sf *Snowflake) LoadUserTables(ctx context.Context) map[string]error

func (*Snowflake) SetConnectionTimeout added in v1.7.0

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

func (*Snowflake) Setup added in v1.7.0

func (sf *Snowflake) Setup(ctx context.Context, warehouse model.Warehouse, uploader whutils.Uploader) (err error)

func (*Snowflake) ShouldAppend

func (sf *Snowflake) ShouldAppend() bool

ShouldAppend returns true if the load table strategy is append mode and the source category is not in "mergeSourceCategoryMap"

func (*Snowflake) TestConnection added in v1.7.0

func (sf *Snowflake) TestConnection(ctx context.Context, _ model.Warehouse) error

Jump to

Keyboard shortcuts

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