Tweaks from code review
Co-authored-by: Dustin J. Mitchell <dustin@v.igoro.us>
This commit is contained in:
@@ -41,7 +41,7 @@ impl FromSql for Client {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Parsers Operation stored as JSON in string column
|
/// Parses Operation stored as JSON in string column
|
||||||
impl ToSql for Client {
|
impl ToSql for Client {
|
||||||
fn to_sql(&self) -> rusqlite::Result<rusqlite::types::ToSqlOutput<'_>> {
|
fn to_sql(&self) -> rusqlite::Result<rusqlite::types::ToSqlOutput<'_>> {
|
||||||
let s = serde_json::to_string(&self)
|
let s = serde_json::to_string(&self)
|
||||||
@@ -72,7 +72,7 @@ impl SqliteStorage {
|
|||||||
|
|
||||||
let queries = vec![
|
let queries = vec![
|
||||||
"CREATE TABLE IF NOT EXISTS clients (client_key STRING PRIMARY KEY, latest_version_id STRING);",
|
"CREATE TABLE IF NOT EXISTS clients (client_key STRING PRIMARY KEY, latest_version_id STRING);",
|
||||||
"CREATE TABLE IF NOT EXISTS versions (version_id STRING PRIMARY KEY, client_key STRING, parent_version_id STRING, history_segment STRING);",
|
"CREATE TABLE IF NOT EXISTS versions (version_id STRING PRIMARY KEY, client_key STRING, parent_version_id STRING, history_segment BLOB);",
|
||||||
];
|
];
|
||||||
for q in queries {
|
for q in queries {
|
||||||
txn.execute(q, []).context("Creating table")?;
|
txn.execute(q, []).context("Creating table")?;
|
||||||
|
|||||||
@@ -288,7 +288,7 @@ impl<'t> StorageTxn for Txn<'t> {
|
|||||||
|
|
||||||
let rows: Vec<Result<(usize, Uuid), _>> = rows.collect();
|
let rows: Vec<Result<(usize, Uuid), _>> = rows.collect();
|
||||||
let mut res = Vec::with_capacity(rows.len());
|
let mut res = Vec::with_capacity(rows.len());
|
||||||
for _ in 0..self.get_next_working_set_number().context("HUh")? {
|
for _ in 0..self.get_next_working_set_number().context("Getting working set number")? {
|
||||||
res.push(None);
|
res.push(None);
|
||||||
}
|
}
|
||||||
for r in rows {
|
for r in rows {
|
||||||
|
|||||||
Reference in New Issue
Block a user