MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / new_index

Method new_index

crates/table/src/table.rs:1423–1430  ·  view source on GitHub ↗

Returns a new [`TableIndex`] for `table`.

(&self, algo: &IndexAlgorithm, is_unique: bool)

Source from the content-addressed store, hash-verified

1421
1422 /// Returns a new [`TableIndex`] for `table`.
1423 pub fn new_index(&self, algo: &IndexAlgorithm, is_unique: bool) -> Result<TableIndex, InvalidFieldError> {
1424 TableIndex::new(
1425 self.get_schema().get_row_type(),
1426 algo.columns().to_owned(),
1427 IndexKind::from_algo(algo),
1428 is_unique,
1429 )
1430 }
1431
1432 /// Inserts a new `index` into the table.
1433 ///

Callers 4

build_indexesMethod · 0.80
create_indexMethod · 0.80
make_table_with_indexFunction · 0.80
unique_violation_errorFunction · 0.80

Calls 5

newFunction · 0.50
get_row_typeMethod · 0.45
get_schemaMethod · 0.45
to_ownedMethod · 0.45
columnsMethod · 0.45

Tested by 1

unique_violation_errorFunction · 0.64