sqlparser

package
v0.11.298 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssetTypeToDialect added in v0.11.192

func AssetTypeToDialect(assetType pipeline.AssetType) (string, error)

Types

type ColumnLineage

type ColumnLineage struct {
	Name     string           `json:"name"`
	Upstream []UpstreamColumn `json:"upstream"`
	Type     string           `json:"type"`
}

type Lineage

type Lineage struct {
	Columns            []ColumnLineage `json:"columns"`
	NonSelectedColumns []ColumnLineage `json:"non_selected_columns"`
	Errors             []string        `json:"errors"`
}

type QueryConfig

type QueryConfig struct {
	Name   string `json:"name"`
	Query  string `json:"query"`
	Schema Schema `json:"schema"`
}

type SQLParser

type SQLParser struct {
	MaxQueryLength int
	// contains filtered or unexported fields
}

func NewSQLParser

func NewSQLParser(randomize bool) (*SQLParser, error)

func NewSQLParserWithConfig added in v0.11.241

func NewSQLParserWithConfig(randomize bool, maxQueryLength int) (*SQLParser, error)

func (*SQLParser) AddLimit added in v0.11.197

func (s *SQLParser) AddLimit(sql string, limit int, dialect string) (string, error)

func (*SQLParser) Close

func (s *SQLParser) Close() error

func (*SQLParser) ColumnLineage

func (s *SQLParser) ColumnLineage(sql, dialect string, schema Schema) (*Lineage, error)

func (*SQLParser) GetMissingDependenciesForAsset added in v0.11.216

func (s *SQLParser) GetMissingDependenciesForAsset(asset *pipeline.Asset, pipeline *pipeline.Pipeline, renderer jinja.RendererInterface) ([]string, error)

func (*SQLParser) IsSingleSelectQuery added in v0.11.254

func (s *SQLParser) IsSingleSelectQuery(sql string, dialect string) (bool, error)

func (*SQLParser) RenameTables added in v0.11.169

func (s *SQLParser) RenameTables(sql string, dialect string, tableMapping map[string]string) (string, error)

func (*SQLParser) Start

func (s *SQLParser) Start() error

func (*SQLParser) UsedTables added in v0.11.4

func (s *SQLParser) UsedTables(sql, dialect string) ([]string, error)

type Schema

type Schema map[string]map[string]string

type UpstreamColumn

type UpstreamColumn struct {
	Column string `json:"column"`
	Table  string `json:"table"`
}

Jump to

Keyboard shortcuts

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