feat: extend seed with phases, object waiting, schema creation, and MiniJinja templating (#15)#16
Merged
mikkeldamsgaard merged 2 commits intomainfrom Feb 24, 2026
Merged
Conversation
…iniJinja templating. Add seed schema version 2 with phase-based execution supporting ordered phases with create/wait/seed lifecycle, MiniJinja template rendering, embedded database/schema creation via create_if_missing, wait-for logic polling for tables/views/schemas/databases with timeouts, cross-phase @ref: references, and driver-aware error reporting. New Database trait methods: create_database, create_schema, object_exists, driver_name for SQLite, PostgreSQL, MySQL. 32 new tests, all 98 pass. Closes #15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extends the seed subsystem with schema version 2, adding phase-based execution, embedded schema/database creation, object waiting, and MiniJinja template rendering.
New Features
{{ env.VAR }}, conditionals, loopscreate_if_missingcreates databases/schemas (PostgreSQL, MySQL)@ref:references resolve across phasesChanges
src/seed/schema.rs— v2 schema structs (SeedPhase, WaitForObject), dual-version validationsrc/seed/db.rs— New trait methods: create_database, create_schema, object_exists, driver_namesrc/seed/executor.rs— Phase execution with create/wait/seed, timeout polling loopsrc/seed/mod.rs— MiniJinja template rendering before YAML/JSON parsingdocs/seeding.md— v2 schema reference, driver support tables, MiniJinja guide, failure modesdocs/usage.md— Updated seed behavior section for v2README.md— Updated seed descriptionCHANGELOG.md— 8 new Added entriesexamples/seed/phased-seed.yaml— Multi-phase PostgreSQL exampleHow to verify
32 new tests covering v2 schema parsing, phase execution, wait conditions with timeouts, unsupported operations, MiniJinja rendering (env vars, conditionals, loops, invalid templates), and edge cases.
Closes #15