Breathe life back into this project. #1
2 changed files with 10 additions and 10 deletions
|
@ -322,17 +322,17 @@ impl<'a, 'c> InProgress<'a, 'c> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn savepoint(&self, name: &str) -> Result<()> {
|
pub fn savepoint(&self, name: &str) -> Result<()> {
|
||||||
self.transaction.execute(&format!("SAVEPOINT {}", name), &[])?;
|
self.transaction.execute(&format!("SAVEPOINT {}", name), rusqlite::params![])?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn rollback_savepoint(&self, name: &str) -> Result<()> {
|
pub fn rollback_savepoint(&self, name: &str) -> Result<()> {
|
||||||
self.transaction.execute(&format!("ROLLBACK TO {}", name), &[])?;
|
self.transaction.execute(&format!("ROLLBACK TO {}", name), rusqlite::params![])?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn release_savepoint(&self, name: &str) -> Result<()> {
|
pub fn release_savepoint(&self, name: &str) -> Result<()> {
|
||||||
self.transaction.execute(&format!("RELEASE {}", name), &[])?;
|
self.transaction.execute(&format!("RELEASE {}", name), rusqlite::params![])?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -292,7 +292,7 @@ fn run_statement<'sqlite, 'stmt, 'bound>
|
||||||
bindings: &'bound [(String, Rc<rusqlite::types::Value>)]) -> Result<rusqlite::Rows<'stmt>> {
|
bindings: &'bound [(String, Rc<rusqlite::types::Value>)]) -> Result<rusqlite::Rows<'stmt>> {
|
||||||
|
|
||||||
let rows = if bindings.is_empty() {
|
let rows = if bindings.is_empty() {
|
||||||
statement.query(&[])?
|
statement.query(rusqlite::params![])?
|
||||||
} else {
|
} else {
|
||||||
let refs: Vec<(&str, &ToSql)> =
|
let refs: Vec<(&str, &ToSql)> =
|
||||||
bindings.iter()
|
bindings.iter()
|
||||||
|
@ -313,8 +313,8 @@ fn run_sql_query<'sqlite, 'sql, 'bound, T, F>
|
||||||
let mut statement = sqlite.prepare(sql)?;
|
let mut statement = sqlite.prepare(sql)?;
|
||||||
let mut rows = run_statement(&mut statement, &bindings)?;
|
let mut rows = run_statement(&mut statement, &bindings)?;
|
||||||
let mut result = vec![];
|
let mut result = vec![];
|
||||||
while let Some(row_or_error) = rows.next() {
|
while let Some(row_or_error) = rows.next().unwrap() {
|
||||||
result.push(mapper(&row_or_error?));
|
result.push(mapper(&row_or_error));
|
||||||
}
|
}
|
||||||
Ok(result)
|
Ok(result)
|
||||||
}
|
}
|
||||||
|
@ -453,10 +453,10 @@ pub fn q_explain<'sqlite, 'query, T>
|
||||||
|
|
||||||
let steps = run_sql_query(sqlite, &plan_sql, &query.args, |row| {
|
let steps = run_sql_query(sqlite, &plan_sql, &query.args, |row| {
|
||||||
QueryPlanStep {
|
QueryPlanStep {
|
||||||
select_id: row.get(0),
|
select_id: row.get(0).unwrap(),
|
||||||
order: row.get(1),
|
order: row.get(1).unwrap(),
|
||||||
from: row.get(2),
|
from: row.get(2).unwrap(),
|
||||||
detail: row.get(3)
|
detail: row.get(3).unwrap()
|
||||||
}
|
}
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue