liteql 0.1.2

LiteQL is a lightweight wrapper for Rusqlite and Eloquent, designed to make working with SQLite in Rust easier and more intuitive.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use eloquent::{QueryBuilder, ToSql};
use rusqlite::{Connection, Error};

pub trait Execute {
    fn execute(&self, connection: &Connection) -> Result<usize, Error>;
}

impl Execute for &str {
    fn execute(&self, connection: &Connection) -> Result<usize, Error> {
        connection.execute(self, ())
    }
}

impl Execute for QueryBuilder {
    fn execute(&self, connection: &Connection) -> Result<usize, Error> {
        self.to_sql().unwrap().as_str().execute(connection)
    }
}