Function spacetimedb_sdk::subscribe_owned

source ·
pub fn subscribe_owned(queries: Vec<String>) -> Result<()>
Expand description

Subscribe to a set of queries, to be notified when rows which match those queries are altered.

The queries should be a Vec of Strings representing SQL queries.

A new call to subscribe_owned (or subscribe) will remove all previous subscriptions and replace them with the new queries. If any rows matched the previous subscribed queries but do not match the new queries, those rows will be removed from the client cache, and TableType::on_delete callbacks will be invoked for them.

subscribe_owned will return an error if called before establishing a connection with the autogenerated connect function. In that case, the queries are not registered.