Skip to content

Implement database seeding #11

@quinnjr

Description

@quinnjr

Description

Database seeding support for development and testing.

Tasks

  • Create prax seed CLI command
  • Support seed files in Rust or JSON
  • Add factory/faker integration
  • Support seed dependencies (order)
  • Add prax seed:reset command

Example

// seeds/users.rs
use prax::seeder::*;

pub async fn run(db: &PraxClient) {
    db.user().create_many(vec![
        data! { email: "admin@example.com", role: "admin" },
        data! { email: "user@example.com", role: "user" },
    ]).exec().await?;
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions