pub struct MigrationStatus { /* private fields */ }Expand description
Display options for migration status.
Shows a list of migrations with their states, timestamps, and durations.
Implementations§
Source§impl MigrationStatus
impl MigrationStatus
Sourcepub fn new(records: Vec<MigrationRecord>) -> Self
pub fn new(records: Vec<MigrationRecord>) -> Self
Create a new migration status display from a list of records.
§Example
use sqlmodel_console::renderables::{MigrationStatus, MigrationRecord, MigrationState};
let status = MigrationStatus::new(vec![
MigrationRecord::new("001", "create_users").state(MigrationState::Applied),
MigrationRecord::new("002", "add_posts").state(MigrationState::Pending),
]);Sourcepub fn show_checksums(self, show: bool) -> Self
pub fn show_checksums(self, show: bool) -> Self
Set whether to show checksums.
Sourcepub fn show_duration(self, show: bool) -> Self
pub fn show_duration(self, show: bool) -> Self
Set whether to show durations.
Sourcepub fn applied_count(&self) -> usize
pub fn applied_count(&self) -> usize
Get the count of applied migrations.
Sourcepub fn pending_count(&self) -> usize
pub fn pending_count(&self) -> usize
Get the count of pending migrations.
Sourcepub fn failed_count(&self) -> usize
pub fn failed_count(&self) -> usize
Get the count of failed migrations.
Sourcepub fn skipped_count(&self) -> usize
pub fn skipped_count(&self) -> usize
Get the count of skipped migrations.
Sourcepub fn total_count(&self) -> usize
pub fn total_count(&self) -> usize
Get the total count of migrations.
Sourcepub fn is_up_to_date(&self) -> bool
pub fn is_up_to_date(&self) -> bool
Check if all migrations are applied.
Sourcepub fn render_plain(&self) -> String
pub fn render_plain(&self) -> String
Render as plain text for agent consumption.
Returns a structured plain text representation suitable for non-TTY environments or agent parsing.
Sourcepub fn render_styled(&self) -> String
pub fn render_styled(&self) -> String
Render with ANSI colors for terminal display.
Returns a rich panel representation with colored status indicators and formatted content.
Trait Implementations§
Source§impl Clone for MigrationStatus
impl Clone for MigrationStatus
Source§fn clone(&self) -> MigrationStatus
fn clone(&self) -> MigrationStatus
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MigrationStatus
impl Debug for MigrationStatus
Auto Trait Implementations§
impl Freeze for MigrationStatus
impl RefUnwindSafe for MigrationStatus
impl Send for MigrationStatus
impl Sync for MigrationStatus
impl Unpin for MigrationStatus
impl UnwindSafe for MigrationStatus
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