Breathe life back into this project. #1
1 changed files with 9 additions and 7 deletions
|
@ -64,13 +64,15 @@ impl SyncMetadata {
|
|||
}
|
||||
|
||||
pub fn remote_head(tx: &rusqlite::Transaction) -> Result<Uuid> {
|
||||
tx.query_row(
|
||||
"SELECT value FROM tolstoy_metadata WHERE key = ?",
|
||||
&[&schema::REMOTE_HEAD_KEY], |r| {
|
||||
let bytes: Vec<u8> = r.get(0).unwrap();
|
||||
Uuid::from_bytes(bytes.as_slice())
|
||||
}
|
||||
)?.map_err(|e| e.into())
|
||||
Uuid::from_bytes(
|
||||
tx.query_row(
|
||||
"SELECT value FROM tolstoy_metadata WHERE key = ?",
|
||||
rusqlite::params![&schema::REMOTE_HEAD_KEY], |r| {
|
||||
let bytes: Vec<u8> = r.get(0).unwrap();
|
||||
Ok(bytes)
|
||||
}
|
||||
)?.as_slice()
|
||||
).map_err(|e| e.into())
|
||||
}
|
||||
|
||||
pub fn set_remote_head(tx: &rusqlite::Transaction, uuid: &Uuid) -> Result<()> {
|
||||
|
|
Loading…
Reference in a new issue