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 ¶
const ( GeneratedGo = "// Code generated by entlite. DO NOT EDIT.\n\n" GeneratedSQL = "-- 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 ¶
startDir accepts both relative and absolute path rootDir is absolute path for go.mod
func GenEntityGetByIdName ¶
GenEntityGetByIdName returns the name of the query that gets the entity by id.
func GenEntityQueryName ¶
GenEntityQueryName returns the name of the entity's first query of the given type, falling back to the generated name when the entity has no such query. Meant for the single-per-entity query types (create, update, delete).
func GenQueryName ¶
GenQueryName returns the entity qualified name of a query, used both as the sqlc query name and as the base name of its proto messages. A custom Name() from the schema replaces the generated name.
func GenQueryRpcName ¶
GenQueryRpcName returns the rpc name of a query inside its entity service. A custom Name() from the schema replaces the generated name.
func PathToImport ¶
Types ¶
type BufGenConfig ¶
type BufGenConfig struct {
// ProtoTypesDir is the output directory for the generated Go proto types
// (the buf.build/protocolbuffers/go plugin).
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)