datadepend

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2022 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, f func(context.Context, *Analyzer, *sqlcheck.Pass) error)

Register allows drivers to override the default analysis with custom behavior.

Types

type Analyzer

type Analyzer struct {
	Options
}

Analyzer checks data-dependent changes.

func New

func New(opts Options) *Analyzer

New creates a new data-dependant analyzer with the given options.

func (*Analyzer) Analyze

func (a *Analyzer) Analyze(ctx context.Context, p *sqlcheck.Pass) error

Analyze implements sqlcheck.Analyzer.

func (*Analyzer) Diagnostics

func (a *Analyzer) Diagnostics(_ context.Context, p *sqlcheck.Pass) (diags []sqlcheck.Diagnostic)

Diagnostics runs the common analysis on the file and returns its diagnostics.

func (*Analyzer) Report

func (a *Analyzer) Report(p *sqlcheck.Pass, diags []sqlcheck.Diagnostic)

Report provides standard reporting for data-dependent changes. Drivers that decorate this Analyzer should call this function to get consistent reporting between dialects.

type Options

type Options struct {
	// UniqueIndex indicates if the analyzer should check for modification or
	// addition of unique indexes to tables that can cause migration to fail.
	UniqueIndex *bool `spec:"drop_schema,omitempty"`

	// Allow drivers to extend the configuration.
	schemahcl.DefaultExtension
}

Options defines the configuration options for the data-dependent changes checker.

Jump to

Keyboard shortcuts

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