Documentation
¶
Index ¶
- func GenInputStruct(inputName string, params []GoParam) *codegen.GoStruct
- func GenMainStruct(tb schema.SQLTable, name string) *codegen.GoStruct
- func GenOutputStruct(outputName string, output []GoVar) *codegen.GoStruct
- type CodegenPass
- func (c *CodegenPass) GenMutationFuncs(mainStruct *codegen.GoStruct, mainTable schema.SQLTable, ...) (rst []*codegen.MutationFunc)
- func (c *CodegenPass) GenMutationSockets(mutations []*driver.Mutation) ([]MutationSocket, error)
- func (c *CodegenPass) GenQueryFuncs(mainStruct *codegen.GoStruct, mainTable schema.SQLTable, ...) (queryFuncs []*codegen.QueryFunc)
- func (c *CodegenPass) GenQuerySockets(queries []*driver.Query) ([]QuerySocket, error)
- func (c *CodegenPass) Run(repo *driver.Repo) error
- type GoParam
- type GoVar
- type MutationSocket
- type NormalizePass
- type Pass
- type QuerySocket
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenInputStruct ¶
GenInputStruct - generate input struct 1. introduce table name when name conflicts. 2. append numbers on fields when they still conflict. 3. add "List" suffix on lists params.
func GenMainStruct ¶
GenMainStruct - generate main struct.
Types ¶
type CodegenPass ¶
type CodegenPass struct {
Code string
}
CodegenPass - prepare for codegen.
func (*CodegenPass) GenMutationFuncs ¶
func (c *CodegenPass) GenMutationFuncs( mainStruct *codegen.GoStruct, mainTable schema.SQLTable, mutationSockets []MutationSocket, queryFuncs []*codegen.QueryFunc) (rst []*codegen.MutationFunc)
GenMutationFuncs from mutation sockets.
func (*CodegenPass) GenMutationSockets ¶
func (c *CodegenPass) GenMutationSockets(mutations []*driver.Mutation) ([]MutationSocket, error)
GenMutationSockets for mutations.
func (*CodegenPass) GenQueryFuncs ¶
func (c *CodegenPass) GenQueryFuncs(mainStruct *codegen.GoStruct, mainTable schema.SQLTable, querySockets []QuerySocket) (queryFuncs []*codegen.QueryFunc)
GenQueryFuncs from query sockets.
func (*CodegenPass) GenQuerySockets ¶
func (c *CodegenPass) GenQuerySockets(queries []*driver.Query) ([]QuerySocket, error)
GenQuerySockets for queries.
type MutationSocket ¶
MutationSocket the gateway between go code and sql mutation.
type NormalizePass ¶
type NormalizePass struct {
}
NormalizePass - replace colName with fully qualified names.
Click to show internal directories.
Click to hide internal directories.