parser

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	Name string
	Type string
}

func (Column) ToStructField

func (column Column) ToStructField(withTag bool) string

type Columns

type Columns []Column

func (Columns) ToStructFields

func (columns Columns) ToStructFields(withTag bool) string

type DDLParser

type DDLParser struct {
	Files      map[string]map[string]Columns // fileName -> TableName -> Columns
	Index      map[string]Indexes
	InputFile  string
	OutputFile string
	IsDir      bool
	// contains filtered or unexported fields
}

func New

func New(input string, output string, isDir bool, packageName string) *DDLParser

func (*DDLParser) Enter

func (parser *DDLParser) Enter(n ast.Node) (node ast.Node, skipChildren bool)

func (*DDLParser) Leave

func (parser *DDLParser) Leave(n ast.Node) (node ast.Node, ok bool)

func (*DDLParser) Parse

func (parser *DDLParser) Parse(sql string) error

func (DDLParser) ToStructs

func (parser DDLParser) ToStructs(withTag bool) (fileContentMap map[string][]byte, err error)

type Index

type Index struct {
}

type Indexes

type Indexes []Index

Jump to

Keyboard shortcuts

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