mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-29 21:52:12 +08:00
Improve documentation
This commit is contained in:
parent
25de884720
commit
a470499dcb
@ -1,9 +1,11 @@
|
|||||||
|
//! Prepared statements cache for faster execution.
|
||||||
extern crate lru_cache;
|
extern crate lru_cache;
|
||||||
|
|
||||||
use {SqliteResult, SqliteConnection, SqliteStatement};
|
use {SqliteResult, SqliteConnection, SqliteStatement};
|
||||||
use self::lru_cache::LruCache;
|
use self::lru_cache::LruCache;
|
||||||
|
|
||||||
/// Prepared statements are cached for faster execution.
|
/// Prepared statements cache.
|
||||||
|
///
|
||||||
/// FIXME limitation: the same SQL can be cached only once...
|
/// FIXME limitation: the same SQL can be cached only once...
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct StatementCache<'conn> {
|
pub struct StatementCache<'conn> {
|
||||||
@ -12,6 +14,7 @@ pub struct StatementCache<'conn> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<'conn> StatementCache<'conn> {
|
impl<'conn> StatementCache<'conn> {
|
||||||
|
/// Create a statement cache.
|
||||||
pub fn new(conn: &'conn SqliteConnection, capacity: usize) -> StatementCache<'conn> {
|
pub fn new(conn: &'conn SqliteConnection, capacity: usize) -> StatementCache<'conn> {
|
||||||
StatementCache{ conn: conn, cache: LruCache::new(capacity) }
|
StatementCache{ conn: conn, cache: LruCache::new(capacity) }
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user