Merge branch 'main' into optional_values

This commit is contained in:
Yuriy Dupyn 2024-02-01 15:02:32 +01:00
commit dab4fdd02b
3 changed files with 14 additions and 16 deletions

View file

@ -12,8 +12,7 @@ use crate::type_system::{IndexableValue, Uuid, Value};
#[derive(Debug, Serialize, Deserialize)]
pub struct Table {
schema: TableSchema,
rows: Rows, // TODO: Consider wrapping this in a lock. Also consider if we need to have the
// same lock for both rows and indexes
rows: Rows,
indexes: HashMap<Column, ColumnIndex>,
}

View file

@ -35,10 +35,9 @@ impl std::fmt::Debug for Response<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
use Response::*;
match self {
Selected(_schema, _columns, _rows) =>
// TODO: How can we iterate through the rows without having to take ownership of
// them?
{
Selected(_schema, _columns, _rows) => {
// It seems that Rust requires ownership of rows to format them here.
// This is why we output the string below
f.write_str("Some rows... trust me")
}
Inserted => f.write_str("Inserted"),
@ -89,7 +88,6 @@ impl State {
}
pub fn interpret<'a>(&'a mut self, operation: Operation) -> DbResult<Response<'a>> {
// TODO: lock stuff
use Operation::*;
match operation {