• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

getdozer / dozer / 4382580286

pending completion
4382580286

push

github

GitHub
feat: Separate cache operation log environment and index environments (#1199)

1370 of 1370 new or added lines in 33 files covered. (100.0%)

28671 of 41023 relevant lines covered (69.89%)

51121.29 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/dozer-admin/src/cli/utils.rs
1
use crate::db::pool::establish_connection;
2
use diesel_migrations::{EmbeddedMigrations, MigrationHarness};
3
use std::{error::Error, path::Path};
4

5
type DB = diesel::sqlite::Sqlite;
6
const MIGRATIONS: EmbeddedMigrations = embed_migrations!("migrations");
7
fn run_migrations(
8
    connection: &mut impl MigrationHarness<DB>,
9
) -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
10
    connection.revert_all_migrations(MIGRATIONS)?;
×
11
    connection.run_pending_migrations(MIGRATIONS)?;
×
12
    Ok(())
×
13
}
×
14

15
pub fn get_db_path() -> String {
×
16
    "dozer.db".to_string()
×
17
}
×
18

19
pub fn init_db() {
×
20
    let db_path = get_db_path();
×
21
    if !Path::new(&db_path).exists() {
×
22
        let db_pool = establish_connection(db_path);
×
23
        let mut db_connection = db_pool.get().unwrap();
×
24
        // run migration
×
25
        run_migrations(&mut db_connection).unwrap();
×
26
    }
×
27
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc