Made dev tools not break everything about the db

Also improved multi statements to allow out of order parameter binding in statements
Ensured that all statements are run for maybe_row and single, and that of all statements only 1 of them returns only 1 row
Made bind and column calls add useful context to errors

Co-authored-by: kay@zed.dev
This commit is contained in:
Mikayla Maki 2022-11-21 13:42:26 -08:00
parent 2dc1130902
commit 3e0f9d27a7
13 changed files with 219 additions and 110 deletions

View file

@ -3,7 +3,7 @@ use std::{
sync::Arc,
};
use anyhow::Result;
use anyhow::{Context, Result};
use async_recursion::async_recursion;
use gpui::{AsyncAppContext, Axis, ModelHandle, Task, ViewHandle};
@ -52,7 +52,7 @@ impl Column for WorkspaceLocation {
fn column(statement: &mut Statement, start_index: i32) -> Result<(Self, i32)> {
let blob = statement.column_blob(start_index)?;
Ok((
WorkspaceLocation(bincode::deserialize(blob)?),
WorkspaceLocation(bincode::deserialize(blob).context("Bincode failed")?),
start_index + 1,
))
}