file

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 28, 2025 License: Apache-2.0 Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTableNameFromTablePathExpressionNode

func CreateTableNameFromTablePathExpressionNode(node *ast.TablePathExpressionNode) (string, bool)

func ListAstNode

func ListAstNode[T locationRangeNode](n ast.ScriptNode) []T

func ListResolvedAstNode

func ListResolvedAstNode[T locationRangeNode](output *zetasql.AnalyzerOutput) []T

func LookupNode

func LookupNode[T astNode](n ast.Node) (T, bool)

func SearchAstNode

func SearchAstNode[T locationRangeNode](node ast.Node, termOffset int) (T, bool)

func SearchResolvedAstNode

func SearchResolvedAstNode[T locationRangeNode](output *zetasql.AnalyzerOutput, termOffset int) (T, bool)

Types

type Analyzer

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

func NewAnalyzer

func NewAnalyzer(logger *logrus.Logger, bqClient bigquery.Client) *Analyzer

func (*Analyzer) AnalyzeStatement

func (a *Analyzer) AnalyzeStatement(rawText string, stmt ast.StatementNode, catalog types.Catalog) (*zetasql.AnalyzerOutput, error)

func (*Analyzer) GetTableMetadataFromPath

func (a *Analyzer) GetTableMetadataFromPath(ctx context.Context, path string) (*bq.TableMetadata, error)

func (*Analyzer) ParseFile

func (a *Analyzer) ParseFile(uri lsp.DocumentURI, src string) ParsedFile

type Catalog

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

func NewCatalog

func NewCatalog(bqClient bigquery.Client) *Catalog

func (*Catalog) AddFunctionWithName

func (c *Catalog) AddFunctionWithName(name string, fn *types.Function)

func (*Catalog) Clone

func (c *Catalog) Clone() *Catalog

func (*Catalog) ExtendedTypeSuperTypes

func (c *Catalog) ExtendedTypeSuperTypes(typ types.Type) (*types.TypeListView, error)

func (*Catalog) FindConnection

func (c *Catalog) FindConnection(path []string) (types.Connection, error)

func (*Catalog) FindConstant

func (c *Catalog) FindConstant(path []string) (types.Constant, int, error)

func (*Catalog) FindConversion

func (c *Catalog) FindConversion(from, to types.Type) (types.Conversion, error)

func (*Catalog) FindFunction

func (c *Catalog) FindFunction(path []string) (*types.Function, error)

func (*Catalog) FindModel

func (c *Catalog) FindModel(path []string) (types.Model, error)

func (*Catalog) FindProcedure

func (c *Catalog) FindProcedure(path []string) (*types.Procedure, error)

func (*Catalog) FindTable

func (c *Catalog) FindTable(path []string) (types.Table, error)

func (*Catalog) FindTableValuedFunction

func (c *Catalog) FindTableValuedFunction(path []string) (types.TableValuedFunction, error)

func (*Catalog) FindType

func (c *Catalog) FindType(path []string) (types.Type, error)

func (*Catalog) FullName

func (c *Catalog) FullName() string

func (*Catalog) SuggestConstant

func (c *Catalog) SuggestConstant(mistypedPath []string) string

func (*Catalog) SuggestFunction

func (c *Catalog) SuggestFunction(mistypedPath []string) string

func (*Catalog) SuggestModel

func (c *Catalog) SuggestModel(mistypedPath []string) string

func (*Catalog) SuggestTable

func (c *Catalog) SuggestTable(mistypedPath []string) string

func (*Catalog) SuggestTableValuedFunction

func (c *Catalog) SuggestTableValuedFunction(mistypedPath []string) string

type Error

type Error struct {
	Msg                  string
	Position             lsp.Position
	TermLength           int
	IncompleteColumnName string
	Severity             lsp.DiagnosticSeverity
}

func (Error) Error

func (e Error) Error() string

type FixOffset

type FixOffset struct {
	Offset int
	Length int
}

type ParsedFile

type ParsedFile struct {
	URI lsp.DocumentURI
	Src string

	Node ast.ScriptNode
	// index is Node's statement order
	RNode []*zetasql.AnalyzerOutput

	FixOffsets []FixOffset
	Errors     []Error
}

func (ParsedFile) ExtractSQL

func (p ParsedFile) ExtractSQL(locationRange *types.ParseLocationRange) (string, bool)

func (*ParsedFile) FindIncompleteColumnName

func (p *ParsedFile) FindIncompleteColumnName(pos lsp.Position) string

func (*ParsedFile) FindTargetAnalyzeOutput

func (p *ParsedFile) FindTargetAnalyzeOutput(termOffset int) (*zetasql.AnalyzerOutput, bool)

func (ParsedFile) FindTargetStatementNode

func (p ParsedFile) FindTargetStatementNode(termOffset int) (ast.StatementNode, bool)

func (ParsedFile) TermOffset

func (p ParsedFile) TermOffset(pos lsp.Position) int

func (ParsedFile) ToLspRange

func (p ParsedFile) ToLspRange(r *types.ParseLocationRange) (lsp.Range, bool)

Jump to

Keyboard shortcuts

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