cmd

package
v1.24.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 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 added in v1.23.0

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 Process added in v1.24.0

func Process(ctx context.Context, rp ResultProcessor, dir, filename string, o *Options) error

func Push added in v1.24.0

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

func Verify added in v1.24.0

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

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 added in v1.23.0

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

func (*Options) ReadConfig added in v1.23.0

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

type OutputPair added in v1.24.0

type OutputPair struct {
	Gen    config.SQLGen
	Plugin *config.Codegen

	config.SQL
}

type ResultProcessor added in v1.24.0

type ResultProcessor interface {
	Pairs(context.Context, *config.Config) []OutputPair
	ProcessResult(context.Context, config.CombinedSettings, OutputPair, *compiler.Result) error
}

Jump to

Keyboard shortcuts

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