Creates the table for `table_def` in `stdb`.
(
stdb: &RelationalDB,
tx: &mut MutTxId,
module_def: &ModuleDef,
table_def: &TableDef,
)
| 427 | |
| 428 | /// Creates the table for `table_def` in `stdb`. |
| 429 | pub fn create_table_from_def( |
| 430 | stdb: &RelationalDB, |
| 431 | tx: &mut MutTxId, |
| 432 | module_def: &ModuleDef, |
| 433 | table_def: &TableDef, |
| 434 | ) -> anyhow::Result<()> { |
| 435 | let schema = TableSchema::from_module_def(module_def, table_def, (), TableId::SENTINEL); |
| 436 | stdb.create_table(tx, schema) |
| 437 | .with_context(|| format!("failed to create table {}", &table_def.name))?; |
| 438 | Ok(()) |
| 439 | } |
| 440 | |
| 441 | #[cfg(test)] |
| 442 | mod test { |
searching dependent graphs…