cli

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: Apache-2.0 Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cli is the sqlshape command: `vet` (the go/analysis checker, also what a bare invocation runs so `go vet -vettool` keeps working), `diff` (the DDL from a database or schema text to schema.sql), `apply` (a DDL file, checked by its end state and by the consumers of what it drops, then run), and `verify-schema` (drift between a database and schema.sql).

Every comparison is between canonical forms (dump.Canonical / dump.Load): the live side is read back through pg_dump, the target is applied to an embedded PostgreSQL and read back the same way, so the two compare object by object in PostgreSQL's own spelling.

Index

Constants

This section is empty.

Variables

View Source
var Subcommands = []string{"vet", "diff", "apply", "verify-schema", "version", "help"}

Subcommands lists the names Main handles; anything else is the checker's business.

Functions

func IsSubcommand

func IsSubcommand(name string) bool

IsSubcommand reports whether name is one of Subcommands.

func Run

func Run(ctx context.Context, name string, args []string, stdout, stderr io.Writer) int

Run executes subcommand name with args, writing results to stdout and problems to stderr. The exit code is 0 for success, 1 for a finding (a difference, a refused apply), 2 for a usage or environment error.

func Version

func Version() string

Version is the version string `sqlshape version` prints: the release build's, else the module version recorded by `go install`, else "devel" with the VCS revision when known.

Types

This section is empty.

Jump to

Keyboard shortcuts

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