Versions in this module Expand all Collapse all v0 v0.0.4 Feb 3, 2020 v0.0.3 Feb 3, 2020 Changes in this version + var ErrMissingVersion = errors.New("no version number") + var ErrNoPackageName = errors.New("missing package name") + var ErrNoPackagePath = errors.New("missing package path") + var ErrNoPackages = errors.New("no packages") + var ErrUnknownVersion = errors.New("invalid version number") + func CommentToMeta(comment string) (map[string]string, string) + func FieldJSONName(columnName, commentName string) string + func FieldName(columnName, commentName string, settings GenerateSettings) string + func Generate(r Generateable, settings GenerateSettings) (map[string]string, error) + func HasStarRef(cf nodes.ColumnRef) bool + func Imports(r Generateable, settings GenerateSettings) func(string) [][]string + func LowerTitle(s string) string + func ModelImports(r Generateable, settings GenerateSettings) [][]string + func ParseCatalog(schema string) (core.Catalog, error) + func ParseMetadata(t string, commentStyle CommentSyntax) (string, string, error) + func QueryImports(r Generateable, settings GenerateSettings, filename string) [][]string + func ReadSQLFiles(path string) ([]string, error) + func RemoveRollbackStatements(contents string) string + func StructName(name string, settings GenerateSettings) string + func UsesArrays(r Generateable, settings GenerateSettings) bool + func UsesType(r Generateable, typ string, settings GenerateSettings) bool + func Walk(f Visitor, node nodes.Node) + type CommentSyntax int + const CommentSyntaxDash + const CommentSyntaxHash + const CommentSyntaxStar + type Engine string + const EngineMySQL + const EnginePostgreSQL + type FileErr struct + Column int + Err error + Filename string + Line int + type GenerateSettings struct + Overrides []Override + PackageMap map[string]PackageSettings + Packages []PackageSettings + Rename map[string]string + Version string + func ParseConfig(rd io.Reader) (GenerateSettings, error) + func (s *GenerateSettings) PopulatePkgMap() error + type Generateable interface + Enums func(settings GenerateSettings) []GoEnum + GoQueries func(settings GenerateSettings) []GoQuery + PkgName func() string + Structs func(settings GenerateSettings) []GoStruct + type GoConstant struct + Name string + Type string + Value string + type GoEnum struct + Comment string + Constants []GoConstant + Name string + type GoField struct + Comment string + Name string + Tags map[string]string + Type string + func (gf GoField) Tag() string + type GoQuery struct + Arg GoQueryValue + Cmd string + Comments []string + ConstantName string + FieldName string + MethodName string + Ret GoQueryValue + SQL string + SourceName string + type GoQueryValue struct + Emit bool + Name string + Struct *GoStruct + Typ string + func (v GoQueryValue) EmitStruct() bool + func (v GoQueryValue) IsStruct() bool + func (v GoQueryValue) Pair() string + func (v GoQueryValue) Params() string + func (v GoQueryValue) Scan() string + func (v GoQueryValue) Type() string + type GoStruct struct + Comment string + Fields []GoField + Name string + Table core.FQN + type Override struct + Column string + GoType string + Null bool + PostgresType string + func (o *Override) Parse() error + type PackageSettings struct + EmitInterface bool + EmitJSONTags bool + EmitPreparedQueries bool + Engine Engine + Name string + Overrides []Override + Path string + Queries string + Schema string + type Parameter struct + Column core.Column + Number int + type ParserErr struct + Errs []FileErr + func NewParserErr() *ParserErr + func (e *ParserErr) Add(filename, source string, loc int, err error) + func (e *ParserErr) Error() string + type Query struct + Cmd string + Columns []core.Column + Comments []string + Filename string + Name string + Params []Parameter + SQL string + type QueryCatalog struct + func NewQueryCatalog(c core.Catalog, with *nodes.WithClause) QueryCatalog + func (qc QueryCatalog) GetTable(fqn core.FQN) (core.Table, *core.Error) + type Result struct + Catalog core.Catalog + Queries []*Query + func ParseQueries(c core.Catalog, pkg PackageSettings) (*Result, error) + func (r Result) Enums(settings GenerateSettings) []GoEnum + func (r Result) GoQueries(settings GenerateSettings) []GoQuery + func (r Result) PkgName() string + func (r Result) Structs(settings GenerateSettings) []GoStruct + type Visitor interface + Visit func(nodes.Node) Visitor + type VisitorFunc func(nodes.Node) + func (vf VisitorFunc) Visit(node nodes.Node) Visitor