cmd

package
v0.0.0-...-a63ec11 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: MIT Imports: 54 Imported by: 0

Documentation

Index

Constants

View Source
const QueryFlagSqlcVetDisable = "@sqlc-vet-disable"
View Source
const RuleDbPrepare = "sqlc/db-prepare"

Variables

View Source
var ErrFailedChecks = errors.New("failed checks")
View Source
var ErrPluginProcessDisabled = errors.New("plugin: process-based plugins disabled via SQLCDEBUG=processplugins=0")

Functions

func CreateDB

func CreateDB(ctx context.Context, dir, filename, querySetName string, o *Options) error

func Diff

func Diff(ctx context.Context, dir, name string, opts *Options) error

func Do

func Do(args []string, stdin io.Reader, stdout io.Writer, stderr io.Writer) int

Do runs the command logic.

func Generate

func Generate(ctx context.Context, dir, filename string, o *Options) (map[string]string, error)

func NewCmdVet

func NewCmdVet() *cobra.Command

func Vet

func Vet(ctx context.Context, dir, filename string, opts *Options) error

Types

type Env

type Env struct {
	DryRun   bool
	Debug    opts.Debug
	Remote   bool
	NoRemote bool
}

func ParseEnv

func ParseEnv(c *cobra.Command) Env

func (*Env) Validate

func (e *Env) Validate(cfg *config.Config) error

type Options

type Options struct {
	Env          Env
	Stderr       io.Writer
	MutateConfig func(*config.Config)
}

func (*Options) ReadConfig

func (o *Options) ReadConfig(dir, filename string) (string, *config.Config, error)

Jump to

Keyboard shortcuts

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