db

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSchema

func GenerateSchema(tables []ddl.Table, cfg Config) (int, int, error)

GenerateSchema produces artifacts/backend/db/schema.sql combining all DDL files in FK-topological order. Returns (tables, totalSeeds, error).

func SortTablesByFK

func SortTablesByFK(tables []ddl.Table) ([]string, error)

SortTablesByFK returns table names in FK dependency order (referenced tables first). Returns error on FK cycle. Output is deterministic: alphabetical tie-breaker within the same depth.

Types

type Config

type Config struct {
	SpecsDDLDir    string // dummys/<>/specs/db/
	ArtifactsDir   string // <>/artifacts
	AutoNobodySeed bool   // opt-in: DEFAULT N FK 에 대해 INSERT seed 자동 주입
}

Config holds schema generation configuration.

Jump to

Keyboard shortcuts

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