analyzer

package
v1.31.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Analyzer

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

func New

func New(client dbmanager.Client, db config.Database) *Analyzer

func (*Analyzer) Analyze

func (a *Analyzer) Analyze(ctx context.Context, n ast.Node, query string, migrations []string, ps *named.ParamSet) (*core.Analysis, error)

Don't create a database per query

func (*Analyzer) Close

func (a *Analyzer) Close(_ context.Context) error

func (*Analyzer) EnsureConn added in v1.31.0

func (a *Analyzer) EnsureConn(ctx context.Context, migrations []string) error

EnsureConn initializes the database connection pool if not already done. This is useful for database-only mode where we need to connect before analyzing queries.

func (*Analyzer) GetColumnNames added in v1.31.0

func (a *Analyzer) GetColumnNames(ctx context.Context, query string) ([]string, error)

GetColumnNames implements the expander.ColumnGetter interface. It prepares a query and returns the column names from the result set description.

func (*Analyzer) IntrospectSchema added in v1.31.0

func (a *Analyzer) IntrospectSchema(ctx context.Context, schemas []string) (*catalog.Catalog, error)

IntrospectSchema queries the database to build a catalog containing tables, columns, and enum types for the specified schemas.

Jump to

Keyboard shortcuts

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