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 Param ¶
Param describes a runtime query parameter with its associated type. Example: "SELECT name FROM users id = ?"
type PositionedErr ¶
func (PositionedErr) Error ¶
func (e PositionedErr) Error() string
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 SchemaLookup *Schema // for validation and conversion to Go types Filename string }
Query holds the data for walking and validating mysql querys
type Result ¶
Result holds the mysql validated queries schema
func GeneratePkg ¶
func GeneratePkg(pkgName, schemaPath, querysPath string, settings dinosql.GenerateSettings) (*Result, error)
GeneratePkg is the main entry to mysql generator package
func (*Result) Enums ¶
func (r *Result) Enums(settings dinosql.GenerateSettings) []dinosql.GoEnum
Enums generates parser-agnostic GoEnum types
func (*Result) GoQueries ¶
func (r *Result) GoQueries(settings dinosql.GenerateSettings) []dinosql.GoQuery
GoQueries generates parser-agnostic query information for code generation
Click to show internal directories.
Click to hide internal directories.