gen

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: MIT Imports: 4 Imported by: ? 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct {
	PrettyCfg tree.PrettyCfg

	// comment out potentially dangerous statements with a warning
	Warnings bool
}

Generator converts cockroachdb tree nodes into strings

func NewGenerator

func NewGenerator() *Generator

NewGenerator configures a generator with sensible defaults

func (*Generator) NewAlterTableAddColumn

func (g *Generator) NewAlterTableAddColumn(col *model.Column) Statement

func (*Generator) NewAlterTableAddConstraint

func (g *Generator) NewAlterTableAddConstraint(cons *model.Constraint) Statement

func (*Generator) NewAlterTableAlterColumnDropNotNull

func (g *Generator) NewAlterTableAlterColumnDropNotNull(col *model.Column) Statement

func (*Generator) NewAlterTableAlterColumnSetNotNull

func (g *Generator) NewAlterTableAlterColumnSetNotNull(col *model.Column) Statement

func (*Generator) NewAlterTableDropColumn

func (g *Generator) NewAlterTableDropColumn(col *model.Column) Statement

func (*Generator) NewAlterTableDropConstraint

func (g *Generator) NewAlterTableDropConstraint(cons *model.Constraint) Statement

func (*Generator) NewAlterTypeAddValue added in v1.2.0

func (g *Generator) NewAlterTypeAddValue(enum *model.Enum, value string, placement *tree.AlterTypeAddValuePlacement) Statement

func (*Generator) NewAlterTypeDropValue added in v1.2.0

func (g *Generator) NewAlterTypeDropValue(enum *model.Enum, value string) Statement

func (*Generator) NewCreateEnum added in v1.2.0

func (g *Generator) NewCreateEnum(enum *model.Enum) Statement

func (*Generator) NewCreateIndex

func (g *Generator) NewCreateIndex(idx *model.Index) Statement

func (*Generator) NewCreateTable

func (g *Generator) NewCreateTable(table *model.Table) Statement

func (*Generator) NewDropEnum added in v1.2.0

func (g *Generator) NewDropEnum(enum *model.Enum) Statement

func (*Generator) NewDropIndex

func (g *Generator) NewDropIndex(idx *model.Index) Statement

func (*Generator) NewDropTable

func (g *Generator) NewDropTable(table *model.Table) Statement

type Statement added in v1.3.0

type Statement struct {
	SQL        string
	HasWarning bool
}

Statement encapsulates a SQL statement, and whether it should generate a warning

Jump to

Keyboard shortcuts

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