Documentation
¶
Index ¶
Constants ¶
const ( LogOpen = "[..." LogClose = "...]" MsgPrefix = "ddlc handler: " MsgExporting = "Exporting DDL schema..." MsgExportFailed = "Export failed: " MsgExportSuccess = "Export successful. Length: " MsgBytes = " bytes" ErrNotConfigured = "ddlc handler: export function not configured" )
Log message prefix and message constants to avoid repeating string literals.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ExportFunc ¶ added in v0.0.2
ExportFunc produces the DDL SQL for the current project.
type Exporter ¶ added in v0.0.2
Exporter is implemented by SQL adapter compilers (sqlt, postgres). ExportDDL returns CREATE TABLE + index statements for all models, in FK dependency order.
type FieldExt ¶ added in v0.0.2
type FieldExt struct {
model.Field
Ref string // FK: target table name. Empty = no FK.
RefColumn string // FK: target column. Empty = auto-detect PK of Ref table.
OnDelete string // Override ON DELETE action. Empty = CASCADE (default for all FKs).
}
FieldExt extends model.Field with database-specific metadata (foreign keys). Used internally by adapters that support FK constraints.
type Handler ¶ added in v0.0.2
type Handler struct {
// contains filtered or unexported fields
}
Handler implements the TUI HandlerExecution and Loggable interfaces structurally.
func (*Handler) Execute ¶ added in v0.0.2
func (h *Handler) Execute()
Execute triggers the DDL export. Implements devtui.HandlerExecution structurally.
func (*Handler) ExecuteErr ¶ added in v0.0.2
ExecuteErr executes the export and returns the error for test assertion.
func (*Handler) SetExport ¶ added in v0.0.2
func (h *Handler) SetExport(fn ExportFunc)
SetExport injects the DDL export logic.