Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTableColumns ¶
GetTableColumns extracts column names from a catalog table. tableName can be a bare name ("users") or schema-qualified ("shop.users"). When schema-qualified, it matches only the specific schema; when bare, it searches all schemas (backward-compatible behavior).
func SetCustomTemplateDir ¶
func SetCustomTemplateDir(dir string)
SetCustomTemplateDir sets the directory for user-provided CRUD templates.
Types ¶
type ColumnData ¶
ColumnData represents a column with its placeholder.
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator generates CRUD SQL files from config and catalog.
func (*Generator) GenerateTable ¶
func (g *Generator) GenerateTable( sqlTableName string, bareTableName string, tableConfig config.TableConfig, defaultCrud *config.CrudDefaultsConfig, columns []string, ) ([]byte, error)
GenerateTable generates all CRUD SQL for a single table. sqlTableName is the schema-qualified name used in SQL (e.g. "shop.orders"), bareTableName is the plain name used for Go identifiers (e.g. "orders").
type TemplateData ¶
type TemplateData struct {
MethodName string
OperationType string
TableName string
PrimaryColumn string
Columns []ColumnData
Returning string
WhereClause string
SoftDeleteWhere bool
SoftDeleteColumn string
OrderClause string
LimitClause string
}
TemplateData holds all data needed to render a CRUD SQL template.