Skip to main content

Documentation Index

Fetch the complete documentation index at: https://tommy-acf5e428.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

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.
orders:
  user_id:
    generator: fk_pool
    params:
      strategy: uniform

Sequential

Parent rows are assigned sequentially. Useful for ordered data like time-series.
logs:
  session_id:
    generator: fk_pool
    params:
      strategy: sequential

Weighted

Some parent rows receive more children than others. Follows a configurable distribution.
comments:
  post_id:
    generator: fk_pool
    params:
      strategy: weighted
      distribution:
        - weight: 80  # top 20% of posts get 80% of comments
        - weight: 20

Exclusive

Each child row gets a dedicated parent row (1:1 relationship).
user_profiles:
  user_id:
    generator: fk_pool
    params:
      strategy: exclusive

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
employees:
  manager_id:
    generator: self_fk
    params:
      max_depth: 3
      null_probability: 0.2
ParameterDescriptionDefault
max_depthMaximum hierarchy depth5
null_probabilityProbability a row has no parent (top-level)0.1