Documentation ¶
Index ¶
- Variables
- func EnumReplace(value string) string
- func EnumValueName(value string) string
- func Generate(req *plugin.CodeGenRequest) (*plugin.CodeGenResponse, error)
- func JSONTagName(name string, settings *plugin.Settings) string
- func SetCaseStyle(name string, style string) string
- func StructName(name string, settings *plugin.Settings) string
- type Constant
- type Enum
- type Field
- type ImportSpec
- type Query
- type QueryValue
- func (v QueryValue) ColumnNames() string
- func (v *QueryValue) DefineType() string
- func (v QueryValue) EmitStruct() bool
- func (v QueryValue) IsPointer() bool
- func (v QueryValue) IsStruct() bool
- func (v QueryValue) Pair() string
- func (v QueryValue) Params() string
- func (v *QueryValue) ReturnName() string
- func (v QueryValue) Scan() string
- func (v QueryValue) SlicePair() string
- func (v QueryValue) Type() string
- func (v QueryValue) UniqueFields() []Field
- type SQLDriver
- 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 Generate ¶
func Generate(req *plugin.CodeGenRequest) (*plugin.CodeGenResponse, error)
func SetCaseStyle ¶
Types ¶
type Field ¶
type ImportSpec ¶
func (ImportSpec) String ¶
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 // Used for :copyfrom Table *plugin.Identifier }
A struct used to generate methods and fields on the Queries struct
func (Query) TableIdentifier ¶
type QueryValue ¶
type QueryValue struct { Emit bool EmitPointer bool Name string Struct *Struct Typ string SQLPackage SQLPackage }
func (QueryValue) ColumnNames ¶
func (v QueryValue) ColumnNames() string
func (*QueryValue) DefineType ¶
func (v *QueryValue) DefineType() string
func (QueryValue) EmitStruct ¶
func (v QueryValue) EmitStruct() bool
func (QueryValue) IsPointer ¶
func (v QueryValue) IsPointer() 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) ReturnName ¶
func (v *QueryValue) ReturnName() string
func (QueryValue) Scan ¶
func (v QueryValue) Scan() string
func (QueryValue) SlicePair ¶
func (v QueryValue) SlicePair() string
func (QueryValue) Type ¶
func (v QueryValue) Type() string
func (QueryValue) UniqueFields ¶
func (v QueryValue) UniqueFields() []Field
type SQLPackage ¶
type SQLPackage string
const ( SQLPackagePGX SQLPackage = "pgx/v4" SQLPackageStandard SQLPackage = "database/sql" )
func SQLPackageFromString ¶
func SQLPackageFromString(s string) SQLPackage
Click to show internal directories.
Click to hide internal directories.