Documentation
¶
Overview ¶
Package tui provides the DevTUI execution handler for DDL export.
This package is intentionally separate from the ddlc root package: the root stays a WASM-safe leaf contract (Exporter, FieldExt, TopologicalSort) consumed by sqlt/postgres/ormc/sqlmcp, while this package pulls in os/file I/O and the DevTUI execution contract and is only meant to be imported by tinywasm/app's dev console.
Index ¶
Constants ¶
const ( LogOpen = "[..." LogClose = "...]" MsgPrefix = "ddlc handler: " MsgExporting = "Exporting DDL schema..." MsgExportFailed = "Export failed: " MsgExportSuccess = "Export successful. Written to: " MsgWriteFailed = "Write failed: " ErrNotConfigured = "ddlc handler: export function not configured" )
Log message prefix and message constants to avoid repeating string literals.
const DefaultOutputPath = "config/db.sql"
DefaultOutputPath is used when SetOutputPath is never called.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExportFunc ¶
ExportFunc produces the DDL SQL for the current project.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler implements the TUI HandlerExecution and Loggable interfaces structurally.
func (*Handler) Execute ¶
func (h *Handler) Execute()
Execute triggers the DDL export. Implements devtui.HandlerExecution structurally.
func (*Handler) ExecuteErr ¶
ExecuteErr executes the export, writes the result to outputPath, and returns the error for test assertion.
func (*Handler) SetExport ¶
func (h *Handler) SetExport(fn ExportFunc)
SetExport injects the DDL export logic.
func (*Handler) SetOutputPath ¶
SetOutputPath overrides the file the generated DDL is written to. Empty path resets to DefaultOutputPath.