Function spacetimedb::delete_by_col_eq

source ·
pub fn delete_by_col_eq(
    table_id: TableId,
    col_id: u8,
    value: &impl Serialize
) -> Result<u32>
Expand description

Deletes all rows in the table identified by table_id where the column identified by col_id matches a value that can be serialized.

Matching is defined by decoding of value to an AlgebraicValue according to the column’s schema and then Ord for AlgebraicValue.

Returns the number of rows deleted.

Returns an error if

  • a table with the provided table_id doesn’t exist
  • no columns were deleted
  • col_id does not identify a column of the table,
  • value doesn’t decode from BSATN to an AlgebraicValue according to the AlgebraicType that the table’s schema specifies for col_id.

Panics when serialization fails.