Add some missing doc

This commit is contained in:
gwenn 2016-02-11 21:47:47 +01:00
parent 1dd5c49937
commit 8b5f871386
2 changed files with 9 additions and 0 deletions

View File

@ -11,6 +11,7 @@ use ffi;
use types::Null;
use vtab::{declare_vtab, escape_double_quote, VTab, VTabCursor};
/// Register the "csv" module.
pub fn load_module(conn: &Connection) -> Result<()> {
let aux: Option<()> = None;
conn.create_module("csv", &CSV_MODULE, aux)

View File

@ -9,6 +9,11 @@ use {Connection, Error, Result};
use ffi;
use vtab::{declare_vtab, escape_double_quote, VTab, VTabCursor};
/// Create a specific instance of an intarray object.
/// The new intarray object is returned.
///
/// Each intarray object corresponds to a virtual table in the TEMP table
/// with the specified `name`.
pub fn create_int_array(conn: &Connection, name: &str) -> Result<Rc<RefCell<Vec<i64>>>> {
let array = Rc::new(RefCell::new(Vec::new()));
try!(conn.create_module(name, &INT_ARRAY_MODULE, Some(array.clone())));
@ -17,6 +22,9 @@ pub fn create_int_array(conn: &Connection, name: &str) -> Result<Rc<RefCell<Vec<
Ok(array)
}
/// Destroy the intarray object by dropping the virtual table.
/// If not done explicitly by the application, the virtual table will be dropped implicitly
/// by the system when the database connection is closed.
pub fn drop_int_array(conn: &Connection, name: &str) -> Result<()> {
conn.execute_batch(&format!("DROP TABLE temp.\"{0}\"",
escape_double_quote(name)))