lint

package
v2.0.5-0...-bd0d250 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ENABLE_PGSQL_CHECK = "CREATE EXTENSION IF NOT EXISTS plpgsql_check"

Variables

View Source
var (
	AllowedLevels = []string{
		"warning",
		"error",
	}
)

Functions

func Run

func Run(ctx context.Context, schema []string, level string, failOn string, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error

Types

type Issue

type Issue struct {
	Level     string     `json:"level"`
	Message   string     `json:"message"`
	Statement *Statement `json:"statement,omitempty"`
	Query     *Query     `json:"query,omitempty"`
	Hint      string     `json:"hint,omitempty"`
	Detail    string     `json:"detail,omitempty"`
	Context   string     `json:"context,omitempty"`
	SQLState  string     `json:"sqlState,omitempty"`
}

type LintLevel

type LintLevel int

type Query

type Query struct {
	Position string `json:"position"`
	Text     string `json:"text"`
}

type Result

type Result struct {
	Function string  `json:"function"`
	Issues   []Issue `json:"issues"`
}

func LintDatabase

func LintDatabase(ctx context.Context, conn *pgx.Conn, schema []string) ([]Result, error)

type Statement

type Statement struct {
	LineNumber string `json:"lineNumber"`
	Text       string `json:"text"`
}

Jump to

Keyboard shortcuts

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