use anyhow::Result;
use async_trait::async_trait;
use sqlx::PgPool;
mod integration_connector_seeder;
mod integration_event_seeder;
pub use integration_connector_seeder::SeedIntegrationConnectorSeeder;
pub use integration_event_seeder::SeedIntegrationEventSeeder;
#[async_trait]
pub trait Seeder {
fn name(&self) -> &'static str;
fn order(&self) -> i32;
async fn should_run(&self, pool: &PgPool) -> Result<bool>;
async fn run(&self, pool: &PgPool) -> Result<()>;
async fn rollback(&self, _pool: &PgPool) -> Result<()> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SeederType {
Reference,
Production,
Development,
Test,
}