Breathe life back into this project. #1
1 changed files with 4 additions and 4 deletions
|
@ -143,17 +143,17 @@ impl SyncMetadata {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_tx_empty(db_tx: &rusqlite::Transaction, tx_id: Entid) -> Result<bool> {
|
pub fn is_tx_empty(db_tx: &rusqlite::Transaction, tx_id: Entid) -> Result<bool> {
|
||||||
let count = db_tx.query_row("SELECT count(rowid) FROM timelined_transactions WHERE timeline = 0 AND tx = ? AND e != ?", &[&tx_id, &tx_id], |row| -> Result<i64> {
|
let count: i64 = db_tx.query_row("SELECT count(rowid) FROM timelined_transactions WHERE timeline = 0 AND tx = ? AND e != ?", &[&tx_id, &tx_id], |row| {
|
||||||
Ok(row.get(0)?)
|
Ok(row.get(0)?)
|
||||||
})?;
|
})?;
|
||||||
Ok(count? == 0)
|
Ok(count == 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn has_entity_assertions_in_tx(db_tx: &rusqlite::Transaction, e: Entid, tx_id: Entid) -> Result<bool> {
|
pub fn has_entity_assertions_in_tx(db_tx: &rusqlite::Transaction, e: Entid, tx_id: Entid) -> Result<bool> {
|
||||||
let count = db_tx.query_row("SELECT count(rowid) FROM timelined_transactions WHERE timeline = 0 AND tx = ? AND e = ?", &[&tx_id, &e], |row| -> Result<i64> {
|
let count: i64 = db_tx.query_row("SELECT count(rowid) FROM timelined_transactions WHERE timeline = 0 AND tx = ? AND e = ?", &[&tx_id, &e], |row| {
|
||||||
Ok(row.get(0)?)
|
Ok(row.get(0)?)
|
||||||
})?;
|
})?;
|
||||||
Ok(count? > 0)
|
Ok(count > 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue