pub struct SeedManager { /* private fields */ }Expand description
Seed manager for handling database seeding operations
Implementations§
Source§impl SeedManager
impl SeedManager
pub fn new(pool: PgPool) -> Self
Sourcepub async fn seed_by_name(&self, seed_name: &str) -> Result<()>
pub async fn seed_by_name(&self, seed_name: &str) -> Result<()>
Run a specific seed by name
Sourcepub async fn revert_seeds(&self) -> Result<()>
pub async fn revert_seeds(&self) -> Result<()>
Revert all applied seeds (in reverse order)
Sourcepub async fn create_seed(&self, name: &str, seed_type: SeedType) -> Result<()>
pub async fn create_seed(&self, name: &str, seed_type: SeedType) -> Result<()>
Create a new seed file
Sourcepub async fn history(&self) -> Result<Vec<SeedRecord>>
pub async fn history(&self) -> Result<Vec<SeedRecord>>
Get seed execution history
Sourcepub async fn status(&self) -> Result<SeedStatus>
pub async fn status(&self) -> Result<SeedStatus>
Check seed status
Sourcepub async fn load_seed_data<T>(&self, file_path: &str) -> Result<Vec<T>>where
T: for<'de> Deserialize<'de> + Send,
pub async fn load_seed_data<T>(&self, file_path: &str) -> Result<Vec<T>>where
T: for<'de> Deserialize<'de> + Send,
Load seed data from JSON file
Auto Trait Implementations§
impl !RefUnwindSafe for SeedManager
impl !UnwindSafe for SeedManager
impl Freeze for SeedManager
impl Send for SeedManager
impl Sync for SeedManager
impl Unpin for SeedManager
impl UnsafeUnpin for SeedManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more