Documentation ¶
Index ¶
- func DoubleSlashComment(s string) string
- func Generate(r Generateable, settings config.CombinedSettings) (map[string]string, error)
- func HasStarRef(cf nodes.ColumnRef) bool
- func Imports(r Generateable, settings config.CombinedSettings) func(string) [][]string
- func LowerTitle(s string) string
- func ParseCatalog(schemas []string) (core.Catalog, error)
- func ParseMetadata(t string, commentStyle CommentSyntax) (string, string, error)
- func ReadSQLFiles(paths []string) ([]string, error)
- func StructName(name string, settings config.CombinedSettings) string
- func UsesArrays(r Generateable, settings config.CombinedSettings) bool
- func UsesType(r Generateable, typ string, settings config.CombinedSettings) bool
- type CommentSyntax
- type FileErr
- type Generateable
- type GoConstant
- type GoEnum
- type GoField
- type GoQuery
- type GoQueryValue
- type GoStruct
- type Parameter
- type ParserErr
- type ParserOpts
- type Query
- type QueryCatalog
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoubleSlashComment ¶ added in v1.0.0
func Generate ¶
func Generate(r Generateable, settings config.CombinedSettings) (map[string]string, error)
func HasStarRef ¶
func Imports ¶
func Imports(r Generateable, settings config.CombinedSettings) func(string) [][]string
func LowerTitle ¶
func ParseMetadata ¶ added in v1.0.0
func ParseMetadata(t string, commentStyle CommentSyntax) (string, string, error)
func ReadSQLFiles ¶
func StructName ¶
func StructName(name string, settings config.CombinedSettings) string
func UsesArrays ¶
func UsesArrays(r Generateable, settings config.CombinedSettings) bool
func UsesType ¶
func UsesType(r Generateable, typ string, settings config.CombinedSettings) bool
Types ¶
type CommentSyntax ¶ added in v1.0.0
type CommentSyntax int
const ( CommentSyntaxDash CommentSyntax = iota CommentSyntaxStar // Note: this is the only style supported by the MySQL sqlparser CommentSyntaxHash )
type Generateable ¶
type Generateable interface { Structs(settings config.CombinedSettings) []GoStruct GoQueries(settings config.CombinedSettings) []GoQuery Enums(settings config.CombinedSettings) []GoEnum }
type GoConstant ¶
type GoEnum ¶
type GoEnum struct { Name string Comment string Constants []GoConstant }
type GoQuery ¶
type GoQuery struct { Cmd string Comments []string MethodName string FieldName string ConstantName string SQL string SourceName string Ret GoQueryValue Arg GoQueryValue }
A struct used to generate methods and fields on the Queries struct
type GoQueryValue ¶
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 ParserErr ¶
type ParserErr struct {
Errs []FileErr
}
func NewParserErr ¶
func NewParserErr() *ParserErr
type ParserOpts ¶ added in v1.0.0
type ParserOpts struct {
UsePositionalParameters bool
}
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 Comments []string // XXX: Hack Filename string }
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
}
type Result ¶
func ParseQueries ¶
Click to show internal directories.
Click to hide internal directories.