Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GoStruct ¶
GoStruct - a go struct.
func (GoStruct) ArglistFunc ¶
ArglistFunc - return a function that generates an argument list.
type GoType ¶
GoType - a simple type in go. If both pointer and list, it represents []*T, not *[]T, i.e. nullability is on the inner type.
type InvalidateTemplate ¶
InvalidateTemplate - the invalidate piece in function
type LoadDumpFunc ¶ added in v0.4.1
func (LoadDumpFunc) InsertSQL ¶ added in v0.4.1
func (l LoadDumpFunc) InsertSQL() string
func (LoadDumpFunc) SelectSQL ¶ added in v0.4.1
func (l LoadDumpFunc) SelectSQL() string
type LoadDumpFuncTemplate ¶ added in v0.4.1
type LoadDumpFuncTemplate struct { RepoName string MainStructName string SelectAllSQL string InsertRowSQL string }
LoadDumpFuncTemplate - the load and dump functions.
func (LoadDumpFuncTemplate) Generate ¶ added in v0.4.1
func (l LoadDumpFuncTemplate) Generate() (string, error)
Generate string template
type MutationFunc ¶
MutationFunc - a query function
func (MutationFunc) Signature ¶
func (m MutationFunc) Signature() string
Signature returns the type signature of the mutation, exposed to user. Invalidates are explicitly named in signatures.
type MutationFuncTemplate ¶
type MutationFuncTemplate struct { RepoName string MutationName string MutationSig string SQLVarName string Invalidates []InvalidateTemplate }
MutationFuncTemplate - the mutation function.
func (MutationFuncTemplate) Generate ¶
func (q MutationFuncTemplate) Generate() (string, error)
Generate string template
type QueryFunc ¶
type QueryFunc struct { Name string SQL string CacheDuration *time.Duration Input *GoStruct Output *GoStruct IsList bool }
QueryFunc - a query function
func (QueryFunc) Signature ¶
Signature returns the type signature of the query function, exposed to user.
func (QueryFunc) SignatureInnerFunc ¶
SignatureInnerFunc returns the type signature of the inner query function.
type QueryFuncTemplate ¶
type QueryFuncTemplate struct { RepoName string QueryName string QueryInnerSig string QuerySig string HiddenQueryName string RstTypeName string CacheDuration *time.Duration // nil = nocache, 0s = forever. SQLVarName string IsList bool InitArgsType string // init a empty args in the ourter func, if not empty string. }
QueryFuncTemplate - the query function.
func (QueryFuncTemplate) Generate ¶
func (q QueryFuncTemplate) Generate() (string, error)
Generate string template
type RepoTemplate ¶
type RepoTemplate struct { NeedleVersion string TableSchema string PkgName string InterfaceName string InterfaceSignatures []string RepoName string MainStruct string MainStructName string LoadDump string Statements []SQLStatementDecl Queries []string Mutations []string }
RepoTemplate template for render a repo.
func (RepoTemplate) Generate ¶
func (q RepoTemplate) Generate() (string, error)
Generate string template
type SQLStatementDecl ¶
SQL statements