Skip to main content

needs_migration

Function needs_migration 

Source
pub fn needs_migration(conn: &Connection) -> Result<bool>
Expand description

Checks if the database requires migration to the latest schema version.

This utility function compares the current database version with the latest available migration version to determine if updates are needed.

§Arguments

  • conn - Database connection to check

§Returns

Returns true if migrations are needed, false if up to date.

§Example

use kasl::db::migrations::needs_migration;
use rusqlite::Connection;

let conn = Connection::open(":memory:")?;
if needs_migration(&conn)? {
    println!("Database needs migration!");
}