Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Column ¶
type Column struct {
*sqlparser.ColumnDefinition
Table string
}
type FromTable ¶
type FromTable struct {
TrueName string // the true table name as described in the schema
IsLeftJoined bool // which could result in null columns
}
FromTable describes a table reference in the "FROM" clause of a query.
type FromTables ¶
FromTables describes a map between table alias expressions and the proper table name
type PackageGenerator ¶
type PackageGenerator struct {
*Schema
config.CombinedSettings
// contains filtered or unexported fields
}
type Param ¶
Param describes a runtime query parameter with its associated type. Example: "SELECT name FROM users id = ?"
type Query ¶
type Query struct {
SQL string // the string representation of the parsed query
Columns []Column
Params []*Param // "?" params in the query string
Name string // the Go function name
Cmd string // TODO: Pick a better name. One of: one, many, exec, execrows
DefaultTableName string // for columns that are not qualified
Filename string
}
Query holds the data for walking and validating mysql querys
type Result ¶
type Result struct {
PackageGenerator
Queries []*Query
}
func GeneratePkg ¶
func GeneratePkg(pkgName string, schemaPath, querysPath []string, settings config.CombinedSettings) (*Result, error)
GeneratePkg is the main entry to mysql generator package
func (*Result) Enums ¶
func (r *Result) Enums(settings config.CombinedSettings) []golang.Enum
Enums generates parser-agnostic GoEnum types
Click to show internal directories.
Click to hide internal directories.