Documentation
¶
Index ¶
- Constants
- func Diff(expected, actual string) string
- func FieldsToStr(fields []string) string
- func FiltersToStr(filters []schema.QueryFilter) string
- func FindModuleInfo(startDir string) (moduleName string, rootDir string, err error)
- func GenEntityGetByIdName(entity schema.Entity) string
- func GenEntityQueryName(entity schema.Entity, queryType schema.QueryType) string
- func GenListMethodName(query schema.Query, entityName string) string
- func GenListRpcName(query schema.Query, entityName string) string
- func GenQueryName(query schema.Query, entityName string) string
- func GenQueryRpcName(query schema.Query, entityName string) string
- func PathToImport(path string) (string, error)
- type BufGenConfig
- type SQLDialect
- type SqlcGenConfig
Constants ¶
View Source
const ( GeneratedGo = "// Code generated by entlite. DO NOT EDIT.\n\n" GeneratedSQL = "-- Code generated by entlite. DO NOT EDIT.\n\n" GeneratedMD = "<!-- Code generated by entlite. DO NOT EDIT. -->\n\n" )
Variables ¶
This section is empty.
Functions ¶
func FieldsToStr ¶
func FiltersToStr ¶
func FiltersToStr(filters []schema.QueryFilter) string
func FindModuleInfo ¶
FindModuleInfo walks up from startDir and returns the module name with the absolute directory holding go.mod. startDir may be relative or absolute.
func GenEntityGetByIdName ¶
GenEntityGetByIdName returns the name of the query that gets the entity by id.
func GenEntityQueryName ¶
GenEntityQueryName returns the entity's first query of the given type, falling back to the generated name. For the single-per-entity types: create, update, delete.
func GenQueryName ¶
GenQueryName returns the entity qualified query name, used as the sqlc query name and the base name of its proto messages. A custom Name() replaces it.
func GenQueryRpcName ¶
GenQueryRpcName returns the rpc name inside the entity service. A custom Name() replaces it.
func PathToImport ¶
Types ¶
type BufGenConfig ¶
type BufGenConfig struct {
// ProtoTypesDir is where the buf.build/protocolbuffers/go plugin writes Go types
ProtoTypesDir string
}
func GetBufConfigFromYaml ¶
func GetBufConfigFromYaml(bufYamlPath string) (*BufGenConfig, error)
type SQLDialect ¶
type SQLDialect string
const ( MySQL SQLDialect = "mysql" SQLite SQLDialect = "sqlite" PostgreSQL SQLDialect = "postgresql" )
type SqlcGenConfig ¶
type SqlcGenConfig struct {
InputDir string
Dialect schema.SQLDialect
}
func GetSqlcConfigFromYaml ¶
func GetSqlcConfigFromYaml(sqlcYamlPath string) (*SqlcGenConfig, error)
Click to show internal directories.
Click to hide internal directories.