register_bsdiff4_functions

Function register_bsdiff4_functions 

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

Register the bsdiff4 and bspatch4 SQL functions with the given SQLite connection. The bsdiff4 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_bsdiff4_functions(&db)?;
let result: Vec<u8> = db.query_row("SELECT bspatch4('013479', bsdiff4('013479', '23456789'))", [], |r| r.get(0))?;
let expected = b"23456789";
assert_eq!(result, expected);