# Deadpool for SQLite [](https://crates.io/crates/deadpool-sqlite)  [](https://blog.rust-lang.org/2021/07/29/Rust-1.54.0.html)
Deadpool is a dead simple async pool for connections and objects
of any type.
This crate implements a [`deadpool`](https://crates.io/crates/deadpool)
manager for [`rusqlite`](https://crates.io/crates/rusqlite)
and provides a wrapper that ensures correct use of the connection
inside a separate thread.
## Features
| `rt_tokio_1` | Enable support for [tokio](https://crates.io/crates/tokio) crate | `deadpool/rt_tokio_1` | yes |
| `rt_async-std_1` | Enable support for [async-std](https://crates.io/crates/config) crate | `deadpool/rt_async-std_1` | no |
| `serde` | Enable support for [serde](https://crates.io/crates/serde) crate | `deadpool/serde`, `serde/derive` | no |
## Example
```rust
use deadpool_sqlite::{Config, Runtime};
#[tokio::main]
async fn main() {
let mut cfg = Config::new("db.sqlite3");
let pool = cfg.create_pool(Runtime::Tokio1).unwrap();
let conn = pool.get().await.unwrap();
let result: i64 = conn
.interact(|conn| {
let mut stmt = conn.prepare("SELECT 1")?;
let mut rows = stmt.query([])?;
let row = rows.next()?.unwrap();
row.get(0)
})
.await
.unwrap();
assert_eq!(result, 1);
}
```
## License
Licensed under either of
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or <http://www.apache.org/licenses/LICENSE-2.0>)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or <http://opensource.org/licenses/MIT>)
at your option.