Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Analyzer ¶
type Analyzer struct {
Options
}
Analyzer checks data-dependent changes.
func (*Analyzer) Diagnostics ¶
Diagnostics runs the common analysis on the file and returns its diagnostics.
type ColumnHandler ¶ added in v0.5.0
type ColumnHandler func(*ColumnPass) ([]sqlcheck.Diagnostic, error)
ColumnHandler allows provide custom diagnostic for specific column rules.
type ColumnPass ¶ added in v0.5.0
type ColumnPass struct {
*sqlcheck.Pass
Change *sqlcheck.Change // Change context (statement).
Table *schema.Table // The table this column belongs to.
Column *schema.Column // The diagnosed column.
}
ColumnPass wraps the information needed by the handler below to diagnose columns.
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"`
// NotNull indicates if the analyzer should check for modification
// or addition of NOT NULL constraints to columns.
NotNull *bool `spec:"not_null,omitempty"`
// Underlying driver handlers.
Handler struct {
// AddNotNull is applied when a new non-nullable column was
// added to an existing table.
AddNotNull ColumnHandler
}
}
Options defines the configuration options for the data-dependent changes checker.
Click to show internal directories.
Click to hide internal directories.