ddl

package
v0.9.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TopologicalSort

func TopologicalSort(models []model.Model) ([]model.Model, error)

TopologicalSort returns models sorted so parents come before children (Kahn's BFS). Models not implementing SchemaExt() are treated as having no FK deps. Returns error on circular FK dependency.

Types

type Exporter

type Exporter interface {
	ExportDDL(models []model.Model) (string, error)
}

Exporter is implemented by SQL adapter compilers (sqlt, postgres). ExportDDL returns CREATE TABLE + index statements for all models, in FK dependency order.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL