Skip to main content

FK Strategies

Seedling provides multiple strategies for distributing FK values, handling real-world patterns like Pareto distributions, many-to-many joins, and self-referencing hierarchies.

Strategies

Uniform (Default)

Parent rows are selected uniformly at random. Each child row gets a random parent FK.

Sequential

Parent rows are assigned sequentially. Useful for ordered data like time-series.

Weighted

Some parent rows receive more children than others. Follows a configurable distribution.

Exclusive

Each child row gets a dedicated parent row (1:1 relationship).

Self-Referencing FKs

For tables with self-referencing foreign keys (e.g., employees.manager_id → employees.id), Seedling uses a multi-pass generation strategy:
  1. Pass 1: Generate a batch of rows with NULL in the self-FK column
  2. Pass 2: Assign FK values from pass 1 rows (or earlier pass rows) to fill in references