/// Register the "vtablog" module. pubfn load_module(conn: &Connection) -> Result<()> { let aux: Option<()> = None;
conn.create_module("vtablog", update_module::<VTabLog>(), aux)
}
/// An instance of the vtablog virtual table #[repr(C)] struct VTabLog { /// Base class. Must be first
base: ffi::sqlite3_vtab, /// Number of rows in the table
n_row: i64, /// Instance number for this vtablog table
i_inst: usize, /// Number of cursors created
n_cursor: usize,
}
/// A cursor for the Series virtual table #[repr(C)] struct VTabLogCursor<'vtab> { /// Base class. Must be first
base: ffi::sqlite3_vtab_cursor, /// Cursor number
i_cursor: usize, /// The rowid
row_id: i64,
phantom: PhantomData<&'vtab VTabLog>,
}
#[cfg(test)] mod test { usecrate::{Connection, Result}; #[test] fn test_module() -> Result<()> { let db = Connection::open_in_memory()?; super::load_module(&db)?;
db.execute_batch( "CREATE VIRTUAL TABLE temp.log USING vtablog(
schema='CREATE TABLE x(a,b,c)',
rows=25
);",
)?; letmut stmt = db.prepare("SELECT * FROM log;")?; letmut rows = stmt.query([])?; while rows.next()?.is_some() {}
db.execute("DELETE FROM log WHERE a = ?1", ["a1"])?;
db.execute( "INSERT INTO log (a, b, c) VALUES (?1, ?2, ?3)",
["a", "b", "c"],
)?;
db.execute( "UPDATE log SET b = ?1, c = ?2 WHERE a = ?3",
["bn", "cn", "a1"],
)?;
Ok(())
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet am 2026-06-19)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.