Doctest column name reference (#918)

* Doctest column name reference
* Document rusqlite assumption on column name reference
And move doctest as a test.
* Document when columns metadata should be extracted.
* Rustfmt doc (wrap_comments)
This commit is contained in:
gwenn
2021-04-03 11:03:50 +02:00
committed by GitHub
parent ecbc0aa767
commit c4b398f468
15 changed files with 182 additions and 86 deletions

View File

@@ -2,8 +2,8 @@
//!
//! Follow these steps to create your own virtual table:
//! 1. Write implemenation of [`VTab`] and [`VTabCursor`] traits.
//! 2. Create an instance of the [`Module`] structure specialized for [`VTab`] impl.
//! from step 1.
//! 2. Create an instance of the [`Module`] structure specialized for [`VTab`]
//! impl. from step 1.
//! 3. Register your [`Module`] structure using [`Connection::create_module`].
//! 4. Run a `CREATE VIRTUAL TABLE` command that specifies the new module in the
//! `USING` clause.
@@ -430,7 +430,8 @@ impl IndexConstraint<'_> {
pub struct IndexConstraintUsage<'a>(&'a mut ffi::sqlite3_index_constraint_usage);
impl IndexConstraintUsage<'_> {
/// if `argv_index` > 0, constraint is part of argv to [`VTabCursor::filter`]
/// if `argv_index` > 0, constraint is part of argv to
/// [`VTabCursor::filter`]
#[inline]
pub fn set_argv_index(&mut self, argv_index: c_int) {
self.0.argvIndex = argv_index;
@@ -496,8 +497,8 @@ pub unsafe trait VTabCursor: Sized {
/// Begin a search of a virtual table.
/// (See [SQLite doc](https://sqlite.org/vtab.html#the_xfilter_method))
fn filter(&mut self, idx_num: c_int, idx_str: Option<&str>, args: &Values<'_>) -> Result<()>;
/// Advance cursor to the next row of a result set initiated by [`filter`](VTabCursor::filter).
/// (See [SQLite doc](https://sqlite.org/vtab.html#the_xnext_method))
/// Advance cursor to the next row of a result set initiated by
/// [`filter`](VTabCursor::filter). (See [SQLite doc](https://sqlite.org/vtab.html#the_xnext_method))
fn next(&mut self) -> Result<()>;
/// Must return `false` if the cursor currently points to a valid row of
/// data, or `true` otherwise.