Documentation
¶
Index ¶
- func DetectImports(columns []Column, isExternal bool) []string
- func DetectQueryImports(tables []Table, queries []Query) []string
- func DetectSharedReturning(queries []Query) map[string][]Column
- func FindCompatible(tables []Table) func(tableName string, cols []Column) string
- func Generate()
- func GenerateDBFile(schema Schema, config SQLCConfig, t *template.Template, outDir string)
- func GenerateEnumFile(schema Schema, t *template.Template, outDir string)
- func GenerateModelFiles(schema Schema, t *template.Template, outDir string)
- func GenerateStoreFile(schema Schema, config SQLCConfig, t *template.Template, outDir string)
- func GetSprintfFormatFromKey(query *Query, from string) string
- func IsBulkQuery(query *Query) bool
- func Singular(s string) string
- func ToCamelCase(name string) string
- func ToGoCase(name string) string
- func ToGoType(col Column, isExternal bool) string
- func ToPascalCase(name string) string
- type CacheOptions
- type Catalog
- type Column
- type Enum
- type Param
- type Query
- type QueryOptions
- type SQLCConfig
- type Schema
- type Table
- type Templates
- type VersionByOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectImports ¶
func DetectQueryImports ¶
func DetectSharedReturning ¶
func FindCompatible ¶
func GenerateDBFile ¶
func GenerateDBFile(schema Schema, config SQLCConfig, t *template.Template, outDir string)
func GenerateModelFiles ¶
func GenerateStoreFile ¶
func GenerateStoreFile(schema Schema, config SQLCConfig, t *template.Template, outDir string)
func GetSprintfFormatFromKey ¶
func IsBulkQuery ¶
func ToCamelCase ¶
func ToPascalCase ¶
Types ¶
type CacheOptions ¶
type Column ¶
type Column struct {
Name string `json:"name"`
NotNull bool `json:"not_null"`
IsArray bool `json:"is_array"`
Table struct {
Name string `json:"name"`
} `json:"table"`
Type struct {
Name string `json:"name"`
} `json:"type"`
}
func FilterColumnsByKeys ¶
type Param ¶
func GetParamsOrdered ¶
type QueryOptions ¶
type QueryOptions struct {
Cache CacheOptions
Order []string
Exclude []string
Returning string
}
func GetQueryOptions ¶
func GetQueryOptions(query *Query) *QueryOptions
type SQLCConfig ¶
func LoadSQLCConfig ¶
func LoadSQLCConfig(path string) SQLCConfig
type Schema ¶
type Schema struct {
Name string `json:"name"`
Tables []Table `json:"tables"`
Enums []Enum `json:"enums"`
}
func GetPublicSchema ¶
func GetPublicSchema(config SQLCConfig) Schema
type Templates ¶
type Templates struct {
DB *template.Template
Model *template.Template
Types *template.Template
Store *template.Template
}
func ParseTemplates ¶
type VersionByOptions ¶
Click to show internal directories.
Click to hide internal directories.