pub fn register_bsdiffraw_functions(conn: &Connection) -> Result<()>Expand description
Register the bsdiffraw and bspatchraw SQL functions with the given SQLite connection.
The bsdiffraw function takes two arguments, and returns the BSDiff delta (blob) of the binary difference.
The arguments can be either a string or a blob.
If any of the arguments are NULL, the result is NULL.
ยงExample
let db = Connection::open_in_memory()?;
register_bsdiffraw_functions(&db)?;
let result: String = db.query_row("SELECT hex(bsdiffraw('abc013479zz', 'abc23456789zzf'))", [], |r| r.get(0))?;
assert_eq!(result.as_str(), "03000000000000000B00000000000000070000000000000000000032333435363738397A7A66");
let result: String = db.query_row("SELECT hex(bspatchraw('abc013479zz', bsdiffraw('abc013479zz', 'abc23456789zzf')))", [], |r| r.get(0))?;
assert_eq!(result.as_str(), "61626332333435363738397A7A66");
let result: Vec<u8> = db.query_row("SELECT bspatchraw('013479', bsdiffraw('013479', '23456789'))", [], |r| r.get(0))?;
let expected = b"23456789";
assert_eq!(result, expected);