ddlconv

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 7 Imported by: 2 modules, 1 package

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

func ExtractAlterTableAddColComment

func ExtractAlterTableAddColComment(stmt *ast.AlterTableSpec) string

func ExtractAlterTableAddColName

func ExtractAlterTableAddColName(stmt *ast.AlterTableSpec) string

func ExtractAlterTableAddColType

func ExtractAlterTableAddColType(stmt *ast.AlterTableSpec) string

func ExtractAlterTableChangeColComment

func ExtractAlterTableChangeColComment(spec *ast.AlterTableSpec) string

func ExtractAlterTableChangeColNewName

func ExtractAlterTableChangeColNewName(stmt *ast.AlterTableSpec) string

func ExtractAlterTableChangeColOldName

func ExtractAlterTableChangeColOldName(stmt *ast.AlterTableSpec) string

func ExtractAlterTableChangeColType

func ExtractAlterTableChangeColType(spec *ast.AlterTableSpec) string

func ExtractAlterTableDropColName

func ExtractAlterTableDropColName(stmt *ast.AlterTableSpec) string

func ExtractAlterTableModifyColComment

func ExtractAlterTableModifyColComment(stmt *ast.AlterTableSpec) string

func ExtractAlterTableModifyColName

func ExtractAlterTableModifyColName(stmt *ast.AlterTableSpec) string

func ExtractAlterTableModifyColType

func ExtractAlterTableModifyColType(stmt *ast.AlterTableSpec) string

func ExtractAlterTableName

func ExtractAlterTableName(stmt *ast.AlterTableStmt) string

func ExtractColComment

func ExtractColComment(col *ast.ColumnDef) string

func ExtractColName

func ExtractColName(col *ast.ColumnDef) string

func ExtractColType

func ExtractColType(col *ast.ColumnDef) string

func ExtractCreateName

func ExtractCreateName(stmt *ast.CreateTableStmt) string

func ExtractDropNames

func ExtractDropNames(stmt *ast.DropTableStmt) []string

func ExtractRename

func ExtractRename(stmt *ast.RenameTableStmt) (newName, oldName string)

Types

type Components

type Components struct {
	Schemas map[string]OpenapiSchema `json:"schemas" yaml:"schemas"`
}

type DDLConverter

type DDLConverter struct {
	Openapi    string            `json:"openapi" yaml:"openapi"`
	Info       map[string]string `json:"info" yaml:"info"`
	Paths      struct{}          `json:"paths" yaml:"paths"`
	Components Components        `json:"components" yaml:"components"`
}

func New

func New(sql ...string) (*DDLConverter, error)

func (*DDLConverter) Enter

func (o *DDLConverter) Enter(in ast.Node) (ast.Node, bool)

func (*DDLConverter) JSON

func (o *DDLConverter) JSON() []byte

func (*DDLConverter) Leave

func (o *DDLConverter) Leave(in ast.Node) (ast.Node, bool)

func (*DDLConverter) Write

func (o *DDLConverter) Write(sql []byte) (int, error)

func (*DDLConverter) WriteString

func (o *DDLConverter) WriteString(sql string) (int, error)

func (*DDLConverter) YAML

func (o *DDLConverter) YAML() []byte

type OpenapiSchema

type OpenapiSchema struct {
	Name       string                            `json:"-" yaml:"-"`
	Type       string                            `json:"type" yaml:"type"`
	Properties map[string]*openapiSchemaProperty `json:"properties" yaml:"properties"`
}

Jump to

Keyboard shortcuts

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