Function spacetimedb_bindings_sys::create_index
source · pub fn create_index(
index_name: &str,
table_id: TableId,
index_type: u8,
col_ids: &[u8]
) -> Result<(), Errno>
Expand description
Creates an index with the name index_name
and type index_type
,
on a product of the given columns ids in col_ids
,
identifying columns in the table identified by table_id
.
Currently only single-column-indices are supported and they may only be of the btree index type.
Returns an error if
- a table with the provided
table_id
doesn’t exist index_type > 1
Traps if index_type == 1
or col_ids.len() != 1
.