Documentation ¶
Index ¶
- Variables
- func EnumReplace(value string) string
- func EnumValueName(value string) string
- func Generate(r *compiler.Result, settings config.CombinedSettings) (map[string]string, error)
- func JSONTagName(name string, settings config.CombinedSettings) string
- func SetCaseStyle(name string, style string) string
- func StructName(name string, settings config.CombinedSettings) string
- type Constant
- type Enum
- type Field
- type Generateable
- type ImportSpec
- type Query
- type QueryValue
- type SQLPackage
- type Struct
Constants ¶
This section is empty.
Variables ¶
View Source
var IdentPattern = regexp.MustCompile("[^a-zA-Z0-9_]+")
Functions ¶
func EnumReplace ¶
func EnumValueName ¶
func JSONTagName ¶ added in v1.8.0
func JSONTagName(name string, settings config.CombinedSettings) string
func SetCaseStyle ¶ added in v1.8.0
func StructName ¶
func StructName(name string, settings config.CombinedSettings) string
Types ¶
type Generateable ¶
type Generateable interface { Structs(settings config.CombinedSettings) []Struct GoQueries(settings config.CombinedSettings) []Query Enums(settings config.CombinedSettings) []Enum }
type ImportSpec ¶ added in v1.6.0
func (ImportSpec) String ¶ added in v1.6.0
func (s ImportSpec) String() string
type Query ¶
type Query struct { Cmd string Comments []string MethodName string FieldName string ConstantName string SQL string SourceName string Ret QueryValue Arg QueryValue }
A struct used to generate methods and fields on the Queries struct
type QueryValue ¶
type QueryValue struct { Emit bool Name string Struct *Struct Typ string SQLPackage SQLPackage }
func (QueryValue) EmitStruct ¶
func (v QueryValue) EmitStruct() bool
func (QueryValue) IsStruct ¶
func (v QueryValue) IsStruct() bool
func (QueryValue) Pair ¶
func (v QueryValue) Pair() string
func (QueryValue) Params ¶
func (v QueryValue) Params() string
func (QueryValue) Scan ¶
func (v QueryValue) Scan() string
func (QueryValue) Type ¶
func (v QueryValue) Type() string
type SQLPackage ¶ added in v1.9.0
type SQLPackage string
const ( SQLPackagePGX SQLPackage = "pgx/v4" SQLPackageStandard SQLPackage = "database/sql" )
func SQLPackageFromString ¶ added in v1.9.0
func SQLPackageFromString(s string) SQLPackage
Click to show internal directories.
Click to hide internal directories.