Generation Flow¶
This page explains what faux-db does after you run a command such as:
End-to-end flow¶
sequenceDiagram
participant U as User
participant C as CLI
participant P as Parsers
participant R as Provider Registry
participant D as DAG Builder
participant X as Resolvers
participant S as Sink
U->>C: faux schema generate <path>
C->>P: load schema, providers, catalogs
P->>R: validate and build providers
P->>D: build table and column dependencies
D->>X: execution order
X->>X: resolve each column for each row
X->>S: write completed rows
S-->>U: csv/json output created
Single-table generation¶
For one schema file, faux-db:
- loads and validates the schema
- loads providers and catalogs
- builds the provider registry
- plans column order from dependencies such as
{{ col("...") }} - constructs resolvers for each column
- generates rows and writes them through the configured sink
Domain generation¶
If the path is a directory, faux-db treats it as a domain:
- every schema file in that directory is loaded
- table names are checked for uniqueness
- a table DAG is built from
relcolumns - tables are generated in dependency order
- generated rows are kept in shared context so downstream tables can reference them
Validation before execution¶
faux config validate runs most of the planning steps without writing output.
That makes it the safest way to verify:
- provider config shape
- duplicate catalog stem errors
- missing column references
- invalid
reltargets - domain dependency problems
Operational advice¶
- Run validation before generation in CI.
- Generate whole domains when tables depend on each other.
- Keep output paths relative to the project root for portability.