snowflake

package
v0.4.23 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetObjectNameFromFqn added in v0.4.21

func GetObjectNameFromFqn(fqn string) string

func ParseCreateStatementsPerObject added in v0.4.21

func ParseCreateStatementsPerObject(ctx context.Context, ddls string) (map[string]string, error)

func QuoteLiteral

func QuoteLiteral(literal string) string

func UnQuote added in v0.4.21

func UnQuote(key string) string

Types

type DatabaseAndSchema added in v0.4.21

type DatabaseAndSchema struct {
	DatabaseName string
	SchemaName   string
}

type DbDesc

type DbDesc struct {
	Name    string `db:"name"    json:"name"`
	Origin  string `db:"origin"  json:"origin"`
	Owner   string `db:"owner"   json:"owner"`
	Comment string `db:"comment" json:"comment"`
	Kind    string `db:"kind"    json:"kind"`
}

func (*DbDesc) String

func (d *DbDesc) String() string

type ShareDesc

type ShareDesc struct {
	Name              string         `db:"name"                json:"name"`
	Kind              string         `db:"kind"                json:"kind"`
	OwnerAccount      string         `db:"owner_account"       json:"owner_account"`
	DatabaseName      string         `db:"database_name"       json:"database_name"`
	To                string         `db:"to"                  json:"to"`
	Owner             string         `db:"owner"               json:"owner"`
	Comment           string         `db:"comment"             json:"comment"`
	ListingGlobalName string         `db:"listing_global_name" json:"listing_global_name"`
	Objects           []*ShareObject `                         json:"objects"`
}

func (*ShareDesc) String

func (d *ShareDesc) String() string

type ShareObject

type ShareObject struct {
	Kind     string    `db:"kind"      json:"kind"`
	Name     string    `db:"name"      json:"name"`
	SharedOn time.Time `db:"shared_on" json:"shared_on"`
}

type ShowStreamsRow added in v0.4.15

type ShowStreamsRow struct {
	// CreatedOn is the timestamp when the stream was created
	CreatedOn string `db:"created_on"`
	// Name is the name of the stream
	Name string `db:"name"`
	// DatabaseName is the database containing the stream
	DatabaseName string `db:"database_name"`
	// SchemaName is the schema containing the stream
	SchemaName string `db:"schema_name"`
	// Owner is the owner of the stream
	Owner string `db:"owner"`
	// Comment is the comment/description for the stream
	Comment string `db:"comment"`
	// TableName is the name of the source table the stream tracks
	TableName string `db:"table_name"`
	// SourceType is the type of source object (Table, View, etc.)
	SourceType string `db:"source_type"`
	// BaseTables lists the base tables the stream tracks
	BaseTables string `db:"base_tables"`
	// Type is the stream type (DELTA, etc.)
	Type string `db:"type"`
	// Stale indicates whether the stream is stale (true/false)
	Stale string `db:"stale"`
	// Mode is the stream mode: DEFAULT (standard/delta), APPEND_ONLY, or INSERT_ONLY
	Mode string `db:"mode"`
	// StaleAfter is the timestamp when the stream becomes stale
	StaleAfter string `db:"stale_after"`
	// InvalidReason provides the reason if the stream is invalid
	InvalidReason string `db:"invalid_reason"`
	// OwnerRoleType is the type of owner role
	OwnerRoleType string `db:"owner_role_type"`
}

ShowStreamsRow represents the structure of a row returned by SHOW STREAMS command

type SnowflakeScrapper

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

func NewSnowflakeScrapper

func NewSnowflakeScrapper(ctx context.Context, conf *SnowflakeScrapperConf) (*SnowflakeScrapper, error)

func (*SnowflakeScrapper) Close

func (e *SnowflakeScrapper) Close() error

func (*SnowflakeScrapper) DialectType added in v0.1.8

func (e *SnowflakeScrapper) DialectType() string

func (*SnowflakeScrapper) Executor

func (*SnowflakeScrapper) GetExistingDbs

func (e *SnowflakeScrapper) GetExistingDbs(ctx context.Context) ([]*DbDesc, error)

func (*SnowflakeScrapper) IsPermissionError added in v0.1.1

func (e *SnowflakeScrapper) IsPermissionError(err error) bool

func (*SnowflakeScrapper) QueryCatalog

func (e *SnowflakeScrapper) QueryCatalog(origCtx context.Context) ([]*scrapper.CatalogColumnRow, error)

func (*SnowflakeScrapper) QueryCustomMetrics

func (e *SnowflakeScrapper) QueryCustomMetrics(ctx context.Context, sql string, args ...any) ([]*scrapper.CustomMetricsRow, error)

func (*SnowflakeScrapper) QueryDatabases

func (e *SnowflakeScrapper) QueryDatabases(ctx context.Context) ([]*scrapper.DatabaseRow, error)

func (*SnowflakeScrapper) QuerySegments

func (e *SnowflakeScrapper) QuerySegments(ctx context.Context, sql string, args ...any) ([]*scrapper.SegmentRow, error)

func (*SnowflakeScrapper) QuerySqlDefinitions

func (e *SnowflakeScrapper) QuerySqlDefinitions(origCtx context.Context) ([]*scrapper.SqlDefinitionRow, error)

func (*SnowflakeScrapper) QueryTableMetrics

func (e *SnowflakeScrapper) QueryTableMetrics(origCtx context.Context, lastMetricsFetchTime time.Time) ([]*scrapper.TableMetricsRow, error)

func (*SnowflakeScrapper) QueryTables

func (e *SnowflakeScrapper) QueryTables(origCtx context.Context) ([]*scrapper.TableRow, error)

func (*SnowflakeScrapper) SqlDialect added in v0.1.8

func (e *SnowflakeScrapper) SqlDialect() sqldialect.Dialect

func (*SnowflakeScrapper) ValidateConfiguration

func (e *SnowflakeScrapper) ValidateConfiguration(ctx context.Context) ([]string, error)

type SnowflakeScrapperConf

type SnowflakeScrapperConf struct {
	dwhexecsnowflake.SnowflakeConf
	NoGetDll       bool
	AccountUsageDb *string
}

func (*SnowflakeScrapperConf) UpperDatabasesLiteral

func (c *SnowflakeScrapperConf) UpperDatabasesLiteral() string

FIXME: I couldn't make it work with `foo IN (?)` binding, so I'm using this

Jump to

Keyboard shortcuts

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