Documentation ¶
Index ¶
- func Generate(r *Result, settings GenerateSettings) (string, error)
- func IsStarRef(cf nodes.ColumnRef) bool
- func ParseCatalog(dir string, settings GenerateSettings) (core.Catalog, error)
- func RemoveGooseRollback(contents string) string
- func Walk(f Visitor, node nodes.Node)
- type Error
- type GenerateSettings
- type GoConstant
- type GoEnum
- type GoField
- type GoQuery
- type GoQueryValue
- type GoStruct
- type Parameter
- type Query
- type QueryCatalog
- type Result
- type TypeOverride
- type Visitor
- type VisitorFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseCatalog ¶
func ParseCatalog(dir string, settings GenerateSettings) (core.Catalog, error)
func RemoveGooseRollback ¶
Remove all lines after a `-- +goose Down` comment
Types ¶
type GenerateSettings ¶
type GoConstant ¶
type GoEnum ¶
type GoEnum struct { Name string Constants []GoConstant }
type GoQuery ¶
type GoQuery struct { Cmd string MethodName string FieldName string ConstantName string SQL string Ret GoQueryValue Arg GoQueryValue }
A struct used to generate methods and fields on the Queries struct
type GoQueryValue ¶
type GoQueryValue struct { Emit bool Name string Struct *GoStruct // contains filtered or unexported fields }
TODO: Terrible name
func (GoQueryValue) EmitStruct ¶
func (v GoQueryValue) EmitStruct() bool
func (GoQueryValue) IsStruct ¶
func (v GoQueryValue) IsStruct() bool
func (GoQueryValue) Pair ¶
func (v GoQueryValue) Pair() string
func (GoQueryValue) Params ¶
func (v GoQueryValue) Params() string
func (GoQueryValue) Scan ¶
func (v GoQueryValue) Scan() string
func (GoQueryValue) Type ¶
func (v GoQueryValue) Type() string
type Query ¶
type Query struct { SQL string Columns []core.Column Params []Parameter Name string Cmd string // TODO: Pick a better name. One of: one, many, exec, execrows // XXX: Hack NeedsEdit bool }
Name and Cmd may be empty Maybe I don't need the SQL string if I have the raw Stmt?
type QueryCatalog ¶
type QueryCatalog struct {
// contains filtered or unexported fields
}
func NewQueryCatalog ¶
func NewQueryCatalog(c core.Catalog, with *nodes.WithClause) QueryCatalog
type Result ¶
type Result struct { Settings GenerateSettings Queries []*Query Catalog core.Catalog }
func ParseQueries ¶
func ParseQueries(c core.Catalog, settings GenerateSettings) (*Result, error)
func (Result) PkgImports ¶
func (r Result) PkgImports(settings GenerateSettings) []string
func (Result) StdImports ¶
type TypeOverride ¶
type VisitorFunc ¶
Click to show internal directories.
Click to hide internal directories.