Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
brson committed Oct 26, 2020
1 parent 43d20c1 commit d3728cf
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/main.rs
Expand Up @@ -30,11 +30,39 @@ enum ColumnData {
}

struct JoinCriteria {

}

struct SelectCriteria {
}

impl Column {
fn len(&self) -> usize { panic!() }
}

impl Table {
fn from_columns(columns: Vec<Column>) -> Table {
let mut rows = None;
let mut name_to_idx = BTreeMap::new();
for (idx, column) in columns.iter().enumerate() {
let new_rows = column.len();
if let Some(rows) = rows {
assert_eq!(rows, new_rows);
}
rows = Some(new_rows);
name_to_idx.insert(column.name.clone(), idx);
}

let rows = rows.unwrap_or(0);

Table {
rows,
columns,
name_to_idx,
}
}
}

impl Table {
fn join(&self, other: &Table, crit: JoinCriteria) -> Table { panic!() }
fn select(&self, crit: SelectCriteria) -> Table { panic!() }
Expand Down

0 comments on commit d3728cf

Please sign in to comment.