Schema Sources
Seedforge has two ways to learn about your tables: live database introspection and ORM file parsing. Both code paths build the same internal DatabaseSchema model — a map of tables, columns, enums, and foreign keys — so downstream generation, FK resolution, and output work identically regardless of source.
Pick live introspection when you have a migrated dev database handy. Pick file parsing when you want to generate a .sql file from an ORM schema without spinning up a database (handy for CI artifacts or seeding a fresh container on boot).
Live database introspection
Section titled “Live database introspection”Seedforge reads the system catalog directly — it does not execute migrations or need any prior data. Connect with --db and it walks the schema, resolves FK graph, and generates rows.
PostgreSQL
Section titled “PostgreSQL”Connection format: postgres://[user[:pass]@]host[:port]/database or postgresql://.... Seedforge queries pg_catalog and information_schema to pull tables, columns, types, constraints, FKs, enums, and sequences.
- Version: PostgreSQL 12+
- Direct insert: yes
- COPY fast mode: yes (
--fast) - File export: yes
seedforge --db postgres://user:pass@localhost:5432/mydb --count 100Use --schema to introspect a namespace other than public:
seedforge --db postgres://localhost/mydb --schema appConnection format: mysql://[user[:pass]@]host[:port]/database. Seedforge queries information_schema for tables, columns, and foreign keys.
- Version: MySQL 5.7+ (also works with MariaDB)
- Direct insert: yes
- COPY fast mode: no
- File export: yes
seedforge --db mysql://root:pass@localhost:3306/mydb --count 100SQLite
Section titled “SQLite”Connection format: sqlite:///path/to/file.db or a bare .db / .sqlite path. Seedforge reads sqlite_master and PRAGMA table_info / PRAGMA foreign_key_list for each table.
- Direct insert: yes (single-file, in-process)
- COPY fast mode: no
- File export: yes
seedforge --db sqlite:///./dev.db --count 50seedforge --db ./data.sqlite --output seed.sqlPrisma
Section titled “Prisma”Point --prisma at your schema.prisma file. Seedforge parses the Prisma DSL, including @relation directives, to build the foreign-key graph without connecting to a database. If --prisma is omitted and no other source is given, Seedforge auto-detects ./prisma/schema.prisma.
# File output — no live DB neededseedforge --prisma ./prisma/schema.prisma --output seed.sql
# Parse schema, insert into a live databaseseedforge --prisma ./prisma/schema.prisma --db postgres://localhost/mydbThe parser honors @id, @unique, @default, @relation(fields: [...], references: [...]), and enum blocks when computing the insert plan.
Drizzle
Section titled “Drizzle”Point --drizzle at a single schema file or a directory of schema files. Seedforge parses the TypeScript source to pick up pgTable / mysqlTable / sqliteTable declarations, column types, and references() FK links.
# Single fileseedforge --drizzle ./src/db/schema.ts --output seed.sql
# Directory of schema filesseedforge --drizzle ./src/db/ --output seed.sql
# Parse Drizzle + insert into a live Postgres databaseseedforge --drizzle ./src/db/schema.ts --db postgres://localhost/mydbTypeORM
Section titled “TypeORM”Point --typeorm at a directory of entity classes. Seedforge reads the TypeScript source and resolves standard TypeORM decorators — @Entity, @Column, @PrimaryGeneratedColumn, @ManyToOne, @OneToMany, @JoinColumn — to build the schema model.
seedforge --typeorm ./src/entities/ --output seed.sqlJPA / Hibernate
Section titled “JPA / Hibernate”Point --jpa at a directory of Java entity classes. Seedforge parses @Entity, @Table, @Column, @Id, @GeneratedValue, @ManyToOne, @OneToMany, @JoinColumn, and @Enumerated annotations.
seedforge --jpa ./src/main/java/com/example/entities/ --output seed.sqlPlugins
Section titled “Plugins”If none of the built-in parsers fit, ship a custom one via --plugin. A plugin exports a SchemaParserPlugin with a detect() + parse() pair that returns the same DatabaseSchema model the built-in parsers produce.
seedforge --plugin ./my-parser-plugin.ts --output seed.sqlPlugins can also auto-detect — if you pass --plugin without any other schema source, Seedforge calls each plugin’s detect(cwd) and uses the first one that claims the project. See the plugin section in the project README for the full SchemaParserPlugin interface.
Supported column types
Section titled “Supported column types”All parsers and introspectors normalize to this shared type set. Unknown types fall back to safe defaults (typically TEXT).
| Category | Types |
|---|---|
| Text | TEXT, VARCHAR, CHAR |
| Integer | INTEGER, BIGINT, SMALLINT, SERIAL, BIGSERIAL |
| Floating | REAL, DOUBLE, DECIMAL, NUMERIC |
| Boolean | BOOLEAN |
| Temporal | DATE, TIME, TIMESTAMP, TIMESTAMPTZ, INTERVAL |
| Identifiers | UUID |
| Structured | JSON, JSONB, ARRAY, ENUM |
| Binary | BYTEA |
| Network | INET, CIDR, MACADDR |
| Geometric | POINT |
Each column is additionally matched against 190+ name patterns across 10 domains (person, contact, location, finance, etc.) to pick a realistic Faker.js generator on top of the base type. See the column patterns reference for the full list.