register_entrypoint

Function register_entrypoint 

Source
pub fn register_entrypoint<F>(
    db: *mut sqlite3,
    _pz_err_msg: *mut *mut c_char,
    p_api: *mut sqlite3_api_routines,
    callback: F,
) -> c_uint
where F: Fn(*mut sqlite3) -> Result<()>,
Expand description

Low-level wrapper around a typical entrypoint to a SQLite extension. You shouldn’t have to use this directly - the sqlite_entrypoint macro will do this for you.

Examples found in repository?
examples/characters.rs (lines 154-157)
154pub fn sqlite3_characters_init(db: *mut sqlite3) -> Result<()> {
155    define_table_function::<CharactersTable>(db, "characters", None)?;
156    Ok(())
157}
More examples
Hide additional examples
examples/series.rs (lines 168-171)
168pub fn sqlite3_seriesrs_init(db: *mut sqlite3) -> Result<()> {
169    define_table_function::<GenerateSeriesTable>(db, "generate_series_rs", None)?;
170    Ok(())
171}
examples/hello.rs (lines 24-28)
24pub fn sqlite3_hello_init(db: *mut sqlite3) -> Result<()> {
25    let flags = FunctionFlags::UTF8 | FunctionFlags::DETERMINISTIC;
26    define_scalar_function(db, "hello", 1, hello, flags)?;
27    Ok(())
28}
examples/scalar.rs (lines 42-49)
42pub fn sqlite3_scalarrs_init(db: *mut sqlite3) -> Result<()> {
43    let flags = FunctionFlags::UTF8 | FunctionFlags::DETERMINISTIC;
44    define_scalar_function(db, "surround_rs", 1, surround, flags)?;
45    define_scalar_function(db, "connect", -1, connect, flags)?;
46    define_scalar_function(db, "yo_rs", 0, yo, flags)?;
47    define_scalar_function(db, "add_rs", 2, add, flags)?;
48    Ok(())
49}