lint

package
v1.46.4 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: MIT Imports: 11 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, fsys afero.Fs, opts ...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