loco-rs / loco

🚂 🦀 The one-person framework for Rust for side-projects and startups
https://loco.rs
Apache License 2.0
5.45k stars 235 forks source link

Allow fixtures to execute rust code #972

Open DenuxPlays opened 2 weeks ago

DenuxPlays commented 2 weeks ago

Feature Request

Is your feature request related to a problem? Please describe.

Currently I need to parse a CSV file and generate IDs on the go which I cannot do in yaml files because their are static.

Describe the solution you'd like

Would be great if we have a new method named like seed_by_function that takes a function instead of a path.

Describe alternatives you've considered

This can sometimes be moved into the migrations crate but as the migration crate has no access to generator, factories etc. it isn't a viable option for everything.