diff --git a/Cargo.lock b/Cargo.lock index 38658d6eb29..8fb139ea9a8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -408,15 +408,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bitmaps" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2" -dependencies = [ - "typenum", -] - [[package]] name = "bitvec" version = "1.0.1" @@ -2481,20 +2472,6 @@ dependencies = [ "icu_properties", ] -[[package]] -name = "im" -version = "15.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0acd33ff0285af998aaf9b57342af478078f53492322fafc47450e09397e0e9" -dependencies = [ - "bitmaps", - "rand_core 0.6.4", - "rand_xoshiro", - "sized-chunks", - "typenum", - "version_check", -] - [[package]] name = "imara-diff" version = "0.1.7" @@ -3797,15 +3774,6 @@ dependencies = [ "rand_core 0.6.4", ] -[[package]] -name = "rand_xoshiro" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" -dependencies = [ - "rand_core 0.6.4", -] - [[package]] name = "rayon" version = "1.10.0" @@ -4588,16 +4556,6 @@ version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" -[[package]] -name = "sized-chunks" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e" -dependencies = [ - "bitmaps", - "typenum", -] - [[package]] name = "slab" version = "0.4.9" @@ -5229,7 +5187,6 @@ dependencies = [ "hex", "home", "http 1.1.0", - "im", "log", "rand 0.8.5", "spacetimedb-client-api-messages", diff --git a/Cargo.toml b/Cargo.toml index 44bca02f266..7f700269cf2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -168,7 +168,6 @@ http = "1.0" humantime = "2.1.0" hyper = "1.0" hyper-util = { version = "0.1", features = ["tokio"] } -im = "15.1" imara-diff = "0.1.3" indexmap = "2.0.0" indicatif = "0.16" diff --git a/crates/cli/src/subcommands/generate/rust.rs b/crates/cli/src/subcommands/generate/rust.rs index b44c9dd47b8..ba776844be8 100644 --- a/crates/cli/src/subcommands/generate/rust.rs +++ b/crates/cli/src/subcommands/generate/rust.rs @@ -145,7 +145,7 @@ Requested namespace: {namespace}", /// but to directly chain method calls, /// like `ctx.db.{accessor_method}().on_insert(...)`. pub struct {table_handle}<'ctx> {{ - imp: __sdk::db_connection::TableHandle<{row_type}>, + imp: __sdk::client_cache::TableHandle<{row_type}>, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, }} @@ -282,7 +282,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.{accessor_method}().{unique_field_name}().find(...)`. pub struct {unique_constraint}<'ctx> {{ - imp: __sdk::client_cache::UniqueConstraint<{row_type}, {unique_field_type}>, + imp: __sdk::client_cache::UniqueConstraintHandle<{row_type}, {unique_field_type}>, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, }} diff --git a/crates/cli/tests/snapshots/codegen__codegen_rust.snap b/crates/cli/tests/snapshots/codegen__codegen_rust.snap index b5f102258b4..7bf5a8aeae3 100644 --- a/crates/cli/tests/snapshots/codegen__codegen_rust.snap +++ b/crates/cli/tests/snapshots/codegen__codegen_rust.snap @@ -457,7 +457,7 @@ use super::has_special_stuff_type::HasSpecialStuff; /// but to directly chain method calls, /// like `ctx.db.has_special_stuff().on_insert(...)`. pub struct HasSpecialStuffTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -1353,7 +1353,7 @@ use super::pk_multi_identity_type::PkMultiIdentity; /// but to directly chain method calls, /// like `ctx.db.pk_multi_identity().on_insert(...)`. pub struct PkMultiIdentityTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -1448,7 +1448,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.pk_multi_identity().id().find(...)`. pub struct PkMultiIdentityIdUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -1478,7 +1478,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.pk_multi_identity().other().find(...)`. pub struct PkMultiIdentityOtherUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -1574,7 +1574,7 @@ use super::point_type::Point; /// but to directly chain method calls, /// like `ctx.db.points().on_insert(...)`. pub struct PointsTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -1664,7 +1664,7 @@ use super::private_type::Private; /// but to directly chain method calls, /// like `ctx.db.private().on_insert(...)`. pub struct PrivateTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -1870,7 +1870,7 @@ use super::repeating_test_arg_type::RepeatingTestArg; /// but to directly chain method calls, /// like `ctx.db.repeating_test_arg().on_insert(...)`. pub struct RepeatingTestArgTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -1965,7 +1965,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.repeating_test_arg().scheduled_id().find(...)`. pub struct RepeatingTestArgScheduledIdUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -2131,7 +2131,7 @@ use super::test_a_type::TestA; /// but to directly chain method calls, /// like `ctx.db.test_a().on_insert(...)`. pub struct TestATableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -2365,7 +2365,7 @@ use super::namespace_test_c_type::NamespaceTestC; /// but to directly chain method calls, /// like `ctx.db.test_d().on_insert(...)`. pub struct TestDTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -2481,7 +2481,7 @@ use super::test_e_type::TestE; /// but to directly chain method calls, /// like `ctx.db.test_e().on_insert(...)`. pub struct TestETableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -2576,7 +2576,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.test_e().id().find(...)`. pub struct TestEIdUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -2647,7 +2647,7 @@ use super::foobar_type::Foobar; /// but to directly chain method calls, /// like `ctx.db.test_f().on_insert(...)`. pub struct TestFTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/Cargo.toml b/crates/sdk/Cargo.toml index 59745b4caa7..02fa16b882f 100644 --- a/crates/sdk/Cargo.toml +++ b/crates/sdk/Cargo.toml @@ -22,7 +22,6 @@ futures.workspace = true futures-channel.workspace = true home.workspace = true http.workspace = true -im.workspace = true log.workspace = true rand.workspace = true tokio.workspace = true diff --git a/crates/sdk/examples/quickstart-chat/module_bindings/message_table.rs b/crates/sdk/examples/quickstart-chat/module_bindings/message_table.rs index 8ecce648cc9..a7f59844b11 100644 --- a/crates/sdk/examples/quickstart-chat/module_bindings/message_table.rs +++ b/crates/sdk/examples/quickstart-chat/module_bindings/message_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.message().on_insert(...)`. pub struct MessageTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/examples/quickstart-chat/module_bindings/user_table.rs b/crates/sdk/examples/quickstart-chat/module_bindings/user_table.rs index 5809e27a6af..dda9509e58d 100644 --- a/crates/sdk/examples/quickstart-chat/module_bindings/user_table.rs +++ b/crates/sdk/examples/quickstart-chat/module_bindings/user_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.user().on_insert(...)`. pub struct UserTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -118,7 +118,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.user().identity().find(...)`. pub struct UserIdentityUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/src/client_cache.rs b/crates/sdk/src/client_cache.rs index ab4228f345e..26eab39f7b3 100644 --- a/crates/sdk/src/client_cache.rs +++ b/crates/sdk/src/client_cache.rs @@ -7,15 +7,17 @@ //! //! This module is internal, and may incompatibly change without warning. +use crate::callbacks::CallbackId; +use crate::db_connection::{PendingMutation, SharedCell}; use crate::spacetime_module::{InModule, SpacetimeModule, TableUpdate}; -use anymap::{any::CloneAny, Map}; +use anymap::{any::Any, Map}; use bytes::Bytes; -use im::HashMap; +use futures_channel::mpsc; +use std::collections::HashMap; use std::marker::PhantomData; use std::sync::Arc; /// A local mirror of the subscribed rows of one table in the database. -#[derive(Clone)] pub struct TableCache { /// A map of row-bytes to rows. /// @@ -64,23 +66,14 @@ impl TableCache { /// A local mirror of the subscribed subset of the database. pub struct ClientCache { - /// "keyed" on the type `HashMap<&'static str, Arc>`. + /// "keyed" on the type `HashMap<&'static str, TableCache`. /// /// The strings are table names, since we may have multiple tables with the same row type. - tables: Map, + tables: Map, _module: PhantomData, } -impl Clone for ClientCache { - fn clone(&self) -> Self { - Self { - tables: self.tables.clone(), - _module: PhantomData, - } - } -} - impl Default for ClientCache { fn default() -> Self { Self { @@ -95,12 +88,23 @@ impl ClientCache { pub(crate) fn get_table + Send + Sync + 'static>( &self, table_name: &'static str, - ) -> Option<&Arc>> { + ) -> Option<&TableCache> { self.tables - .get::>>>() + .get::>>() .and_then(|tables_of_row_type| tables_of_row_type.get(table_name)) } + fn get_or_make_table + Send + Sync + 'static>( + &mut self, + table_name: &'static str, + ) -> &mut TableCache { + self.tables + .entry::>>() + .or_insert_with(Default::default) + .entry(table_name) + .or_default() + } + /// Apply all the mutations in `diff` /// to the [`TableCache`] which stores rows of type `Row` for the table `table_name`. pub fn apply_diff_to_table + Clone + Send + Sync + 'static>( @@ -112,41 +116,186 @@ impl ClientCache { return; } - // Clippy is incorrect here: `.cloned` will do `Arc::clone`, not `TableCache::clone`. - // TODO: Do we need to be `Arc`ing these? `im::HashMap` should be doing sharing internally anyway. - #[allow(clippy::map_clone)] - let mut table = self - .get_table::(table_name) - .map(|tbl| TableCache::clone(tbl)) - .unwrap_or_default(); + let table = self.get_or_make_table::(table_name); table.apply_diff(diff); - self.tables - .entry::>>>() - .or_insert(HashMap::default()) - .insert(table_name, Arc::new(table)); } } -/// A shared view into a particular state of the `ClientCache`. -pub(crate) type ClientCacheView = Arc>; +/// Internal implementation of a generated `TableHandle` struct, +/// which mediates access to a table in the client cache. +/// +/// `TableHandle`s don't actually hold a direct reference to the table they access, +/// as that would require both gnarly lifetimes and also a `MutexGuard` on the client cache. +/// Instead, they hold an `Arc` on the whole [`ClientCache`], +/// with every operation through the table handle +/// acquiring the lock only for the duration of the operation, +/// calling [`ClientCache::get_table`] and then discarding its reference before returning. +pub struct TableHandle { + pub(crate) client_cache: SharedCell>, + /// Handle on the connection's `pending_mutations_send` channel, + /// so we can send callback-related [`PendingMutation`] messages. + pub(crate) pending_mutations: mpsc::UnboundedSender>, + + /// The name of the table. + pub(crate) table_name: &'static str, +} + +impl Clone for TableHandle { + fn clone(&self) -> Self { + Self { + client_cache: Arc::clone(&self.client_cache), + pending_mutations: self.pending_mutations.clone(), + table_name: self.table_name, + } + } +} + +impl TableHandle { + /// Read something out of the [`TableCache`] which this `TableHandle` accesses. + /// + /// If the table has never had any rows resident, the [`TableCache`] may not exist. + /// In this case, `get` is never invoked, and `None` is returned. + fn get(&self, get: impl FnOnce(&TableCache) -> Res) -> Option { + let client_cache = self.client_cache.lock().unwrap(); + client_cache.get_table::(self.table_name).map(get) + } + + /// Read something out of the [`TableCache`] which this `TableHandle` accesses, + /// returning a default value if the table has not been constructed + /// because no rows are resident. + fn get_or_default(&self, get: impl FnOnce(&TableCache) -> Res) -> Res { + self.get(get).unwrap_or_default() + } + + /// Called by the autogenerated implementation of the [`crate::Table`] method of the same name. + pub fn count(&self) -> u64 { + self.get_or_default(|table| table.entries.len() as u64) + } + + /// Called by the autogenerated implementation of the [`crate::Table`] method of the same name. + pub fn iter(&self) -> impl Iterator { + self.get_or_default(|table| table.entries.values().cloned().collect::>()) + .into_iter() + } + + /// See [`DbContextImpl::queue_mutation`]. + fn queue_mutation(&self, mutation: PendingMutation) { + self.pending_mutations.unbounded_send(mutation).unwrap(); + } + + /// Called by the autogenerated implementation of the [`crate::Table`] method of the same name. + pub fn on_insert( + &self, + mut callback: impl FnMut(&::EventContext, &Row) + Send + 'static, + ) -> CallbackId { + let callback_id = CallbackId::get_next(); + self.queue_mutation(PendingMutation::AddInsertCallback { + table: self.table_name, + callback: Box::new(move |ctx, row| { + let row = row.downcast_ref::().unwrap(); + callback(ctx, row); + }), + callback_id, + }); + callback_id + } + + /// Called by the autogenerated implementation of the [`crate::Table`] method of the same name. + pub fn remove_on_insert(&self, callback: CallbackId) { + self.queue_mutation(PendingMutation::RemoveInsertCallback { + table: self.table_name, + callback_id: callback, + }); + } + + /// Called by the autogenerated implementation of the [`crate::Table`] method of the same name. + pub fn on_delete( + &self, + mut callback: impl FnMut(&::EventContext, &Row) + Send + 'static, + ) -> CallbackId { + let callback_id = CallbackId::get_next(); + self.queue_mutation(PendingMutation::AddDeleteCallback { + table: self.table_name, + callback: Box::new(move |ctx, row| { + let row = row.downcast_ref::().unwrap(); + callback(ctx, row); + }), + callback_id, + }); + callback_id + } + + /// Called by the autogenerated implementation of the [`crate::Table`] method of the same name. + pub fn remove_on_delete(&self, callback: CallbackId) { + self.queue_mutation(PendingMutation::RemoveDeleteCallback { + table: self.table_name, + callback_id: callback, + }); + } + + /// Called by the autogenerated implementation of the [`crate::TableWithPrimaryKey`] method of the same name. + pub fn on_update( + &self, + mut callback: impl FnMut(&::EventContext, &Row, &Row) + Send + 'static, + ) -> CallbackId { + let callback_id = CallbackId::get_next(); + self.queue_mutation(PendingMutation::AddUpdateCallback { + table: self.table_name, + callback: Box::new(move |ctx, old, new| { + let old = old.downcast_ref::().unwrap(); + let new = new.downcast_ref::().unwrap(); + callback(ctx, old, new); + }), + callback_id, + }); + callback_id + } + + /// Called by the autogenerated implementation of the [`crate::TableWithPrimaryKey`] method of the same name. + pub fn remove_on_update(&self, callback: CallbackId) { + self.queue_mutation(PendingMutation::RemoveUpdateCallback { + table: self.table_name, + callback_id: callback, + }); + } + + /// Called by autogenerated unique index access methods. + pub fn get_unique_constraint( + &self, + _constraint_name: &'static str, + get_unique_field: fn(&Row) -> &Col, + ) -> UniqueConstraintHandle { + UniqueConstraintHandle { + table_handle: self.clone(), + get_unique_field, + } + } +} /// A fake implementation of a unique index. /// /// This struct should allow efficient point queries of a particular field in the table, /// but our current implementation just does a full scan. +/// +/// Like [`TableHandle`], unique constraint handles don't hold a direct reference to their table +/// or an index within it. (No such index currently exists, anyways.) +/// Instead, they hold a handle on the whole [`ClientCache`], +/// and acquire short-lived exclusive access to it during operations. // TODO: Actual client-side indices. -pub struct UniqueConstraint { +pub struct UniqueConstraintHandle { + table_handle: TableHandle, pub(crate) get_unique_field: fn(&Row) -> &Col, - pub(crate) table: Arc>, } -impl UniqueConstraint { +impl UniqueConstraintHandle { pub fn find(&self, col_val: &Col) -> Option { - self.table - .entries - .values() - .find(|row| (self.get_unique_field)(row) == col_val) - .cloned() + self.table_handle.get_or_default(|table| { + table + .entries + .values() + .find(|row| (self.get_unique_field)(row) == col_val) + .cloned() + }) } } diff --git a/crates/sdk/src/db_connection.rs b/crates/sdk/src/db_connection.rs index 4739226d32c..b3a0a6a4414 100644 --- a/crates/sdk/src/db_connection.rs +++ b/crates/sdk/src/db_connection.rs @@ -20,7 +20,7 @@ use crate::{ callbacks::{CallbackId, DbCallbacks, ReducerCallback, ReducerCallbacks, RowCallback, UpdateCallback}, - client_cache::{ClientCache, ClientCacheView, TableCache, UniqueConstraint}, + client_cache::{ClientCache, TableHandle}, spacetime_module::{DbConnection, DbUpdate, EventContext, InModule, SpacetimeModule}, subscription::{OnAppliedCallback, OnErrorCallback, SubscriptionManager}, websocket::{WsConnection, WsParams}, @@ -56,8 +56,8 @@ pub struct DbContextImpl { /// All the state which is safe to hold a lock on while running callbacks. pub(crate) inner: SharedCell>, - /// The most recent client cache state. - cache: SharedCell>, + /// The client cache, which stores subscribed rows. + cache: SharedCell>, /// Receiver channel for WebSocket messages, /// which are pre-parsed in the background by [`parse_loop`]. @@ -136,12 +136,13 @@ impl DbContextImpl { // set the received state to store all the rows, // then invoke the on-applied and row callbacks. ParsedMessage::InitialSubscription { db_update, sub_id } => { - let prev_cache_view = Arc::clone(&*self.cache.lock().unwrap()); - let mut new_cache = ClientCache::clone(&*prev_cache_view); - // FIXME: delete no-longer-subscribed rows. - db_update.apply_to_client_cache(&mut new_cache); - let new_cache_view = Arc::new(new_cache); - *self.cache.lock().unwrap() = new_cache_view; + // Lock the client cache in a restricted scope, + // so that it will be unlocked when callbacks run. + { + let mut cache = self.cache.lock().unwrap(); + // FIXME: delete no-longer-subscribed rows. + db_update.apply_to_client_cache(&mut *cache); + } let event_ctx = self.make_event_ctx(Event::SubscribeApplied); let mut inner = self.inner.lock().unwrap(); inner.subscriptions.subscription_applied(&event_ctx, sub_id); @@ -154,11 +155,12 @@ impl DbContextImpl { // apply the received diff to the client cache, // then invoke on-reducer and row callbacks. ParsedMessage::TransactionUpdate(event, Some(update)) => { - let prev_cache_view = Arc::clone(&*self.cache.lock().unwrap()); - let mut new_cache = ClientCache::clone(&*prev_cache_view); - update.apply_to_client_cache(&mut new_cache); - let new_cache_view = Arc::new(new_cache); - *self.cache.lock().unwrap() = new_cache_view; + // Lock the client cache in a restricted scope, + // so that it will be unlocked when callbacks run. + { + let mut cache = self.cache.lock().unwrap(); + update.apply_to_client_cache(&mut *cache); + } let event_ctx = self.make_event_ctx(event); let mut inner = self.inner.lock().unwrap(); if let Event::Reducer(reducer_event) = event_ctx.event() { @@ -203,7 +205,7 @@ impl DbContextImpl { inner.on_disconnect.take() }; if let Some(disconnect_callback) = disconnected_callback { - let ctx = M::DbConnection::new(self.clone()); + let ctx = ::new(self.clone()); disconnect_callback(&ctx, err); } } @@ -511,18 +513,12 @@ impl DbContextImpl { &self, table_name: &'static str, ) -> TableHandle { - let table_view = self - .cache - .lock() - .unwrap() - .get_table::(table_name) - .cloned() - .unwrap_or_else(|| Arc::new(TableCache::default())); + let client_cache = Arc::clone(&self.cache); let pending_mutations = self.pending_mutations_send.clone(); TableHandle { - table_view, + client_cache, pending_mutations, - table: table_name, + table_name, } } @@ -639,124 +635,6 @@ impl CallReducerFlagsMap { } } -/// Internal implementation of a generated `TableHandle` struct, -/// which mediates access to a table in the client cache. -pub struct TableHandle { - /// May be `None` if there are no rows in the table cache. - table_view: Arc>, - /// Handle on the connection's `pending_mutations_send` channel, - /// so we can send callback-related [`PendingMutation`] messages. - pending_mutations: mpsc::UnboundedSender>, - - /// The name of the table. - table: &'static str, -} - -impl TableHandle { - /// Called by the autogenerated implementation of the [`crate::Table`] method of the same name. - pub fn count(&self) -> u64 { - self.table_view.entries.len() as u64 - } - - /// Called by the autogenerated implementation of the [`crate::Table`] method of the same name. - pub fn iter(&self) -> impl Iterator + '_ { - self.table_view.entries.values().cloned() - } - - /// See [`DbContextImpl::queue_mutation`]. - fn queue_mutation(&self, mutation: PendingMutation) { - self.pending_mutations.unbounded_send(mutation).unwrap(); - } - - /// Called by the autogenerated implementation of the [`crate::Table`] method of the same name. - pub fn on_insert( - &self, - mut callback: impl FnMut(&::EventContext, &Row) + Send + 'static, - ) -> CallbackId { - let callback_id = CallbackId::get_next(); - self.queue_mutation(PendingMutation::AddInsertCallback { - table: self.table, - callback: Box::new(move |ctx, row| { - let row = row.downcast_ref::().unwrap(); - callback(ctx, row); - }), - callback_id, - }); - callback_id - } - - /// Called by the autogenerated implementation of the [`crate::Table`] method of the same name. - pub fn remove_on_insert(&self, callback: CallbackId) { - self.queue_mutation(PendingMutation::RemoveInsertCallback { - table: self.table, - callback_id: callback, - }); - } - - /// Called by the autogenerated implementation of the [`crate::Table`] method of the same name. - pub fn on_delete( - &self, - mut callback: impl FnMut(&::EventContext, &Row) + Send + 'static, - ) -> CallbackId { - let callback_id = CallbackId::get_next(); - self.queue_mutation(PendingMutation::AddDeleteCallback { - table: self.table, - callback: Box::new(move |ctx, row| { - let row = row.downcast_ref::().unwrap(); - callback(ctx, row); - }), - callback_id, - }); - callback_id - } - - /// Called by the autogenerated implementation of the [`crate::Table`] method of the same name. - pub fn remove_on_delete(&self, callback: CallbackId) { - self.queue_mutation(PendingMutation::RemoveDeleteCallback { - table: self.table, - callback_id: callback, - }); - } - - /// Called by the autogenerated implementation of the [`crate::TableWithPrimaryKey`] method of the same name. - pub fn on_update( - &self, - mut callback: impl FnMut(&::EventContext, &Row, &Row) + Send + 'static, - ) -> CallbackId { - let callback_id = CallbackId::get_next(); - self.queue_mutation(PendingMutation::AddUpdateCallback { - table: self.table, - callback: Box::new(move |ctx, old, new| { - let old = old.downcast_ref::().unwrap(); - let new = new.downcast_ref::().unwrap(); - callback(ctx, old, new); - }), - callback_id, - }); - callback_id - } - - /// Called by the autogenerated implementation of the [`crate::TableWithPrimaryKey`] method of the same name. - pub fn remove_on_update(&self, callback: CallbackId) { - self.queue_mutation(PendingMutation::RemoveUpdateCallback { - table: self.table, - callback_id: callback, - }); - } - - /// Called by autogenerated unique index access methods. - pub fn get_unique_constraint( - &self, - _constraint_name: &'static str, - get_unique_field: fn(&Row) -> &Col, - ) -> UniqueConstraint { - UniqueConstraint { - table: Arc::clone(&self.table_view), - get_unique_field, - } - } -} - /// A builder-pattern constructor for a `DbConnection` connection to the module `M`. /// /// `M` will be the autogenerated opaque module type. diff --git a/crates/sdk/tests/connect_disconnect_client/src/module_bindings/connected_table.rs b/crates/sdk/tests/connect_disconnect_client/src/module_bindings/connected_table.rs index 5099d2f598a..d68f536c8fc 100644 --- a/crates/sdk/tests/connect_disconnect_client/src/module_bindings/connected_table.rs +++ b/crates/sdk/tests/connect_disconnect_client/src/module_bindings/connected_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.connected().on_insert(...)`. pub struct ConnectedTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/connect_disconnect_client/src/module_bindings/disconnected_table.rs b/crates/sdk/tests/connect_disconnect_client/src/module_bindings/disconnected_table.rs index 8905a117917..66029b3d85f 100644 --- a/crates/sdk/tests/connect_disconnect_client/src/module_bindings/disconnected_table.rs +++ b/crates/sdk/tests/connect_disconnect_client/src/module_bindings/disconnected_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.disconnected().on_insert(...)`. pub struct DisconnectedTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/large_table_table.rs b/crates/sdk/tests/test-client/src/module_bindings/large_table_table.rs index c93d404ac04..365b2a28c9b 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/large_table_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/large_table_table.rs @@ -24,7 +24,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.large_table().on_insert(...)`. pub struct LargeTableTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_address_table.rs b/crates/sdk/tests/test-client/src/module_bindings/one_address_table.rs index 8ffe10b8b7f..2810d38b014 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/one_address_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/one_address_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.one_address().on_insert(...)`. pub struct OneAddressTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_bool_table.rs b/crates/sdk/tests/test-client/src/module_bindings/one_bool_table.rs index 96b0df62268..23bf1d09045 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/one_bool_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/one_bool_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.one_bool().on_insert(...)`. pub struct OneBoolTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_byte_struct_table.rs b/crates/sdk/tests/test-client/src/module_bindings/one_byte_struct_table.rs index 0207fbb9226..3b36b3a16c8 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/one_byte_struct_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/one_byte_struct_table.rs @@ -19,7 +19,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.one_byte_struct().on_insert(...)`. pub struct OneByteStructTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_enum_with_payload_table.rs b/crates/sdk/tests/test-client/src/module_bindings/one_enum_with_payload_table.rs index a2e394dd423..509b176c04f 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/one_enum_with_payload_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/one_enum_with_payload_table.rs @@ -19,7 +19,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.one_enum_with_payload().on_insert(...)`. pub struct OneEnumWithPayloadTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_every_primitive_struct_table.rs b/crates/sdk/tests/test-client/src/module_bindings/one_every_primitive_struct_table.rs index 5a3ad06666f..f52c3d4de93 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/one_every_primitive_struct_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/one_every_primitive_struct_table.rs @@ -19,7 +19,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.one_every_primitive_struct().on_insert(...)`. pub struct OneEveryPrimitiveStructTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_every_vec_struct_table.rs b/crates/sdk/tests/test-client/src/module_bindings/one_every_vec_struct_table.rs index 8d81e12c580..fa77c0b6616 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/one_every_vec_struct_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/one_every_vec_struct_table.rs @@ -19,7 +19,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.one_every_vec_struct().on_insert(...)`. pub struct OneEveryVecStructTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_f_32_table.rs b/crates/sdk/tests/test-client/src/module_bindings/one_f_32_table.rs index 26fde871750..273df0e9593 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/one_f_32_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/one_f_32_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.one_f_32().on_insert(...)`. pub struct OneF32TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_f_64_table.rs b/crates/sdk/tests/test-client/src/module_bindings/one_f_64_table.rs index 0faedf0e2e1..5ce45bddf7f 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/one_f_64_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/one_f_64_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.one_f_64().on_insert(...)`. pub struct OneF64TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_i_128_table.rs b/crates/sdk/tests/test-client/src/module_bindings/one_i_128_table.rs index c2df488aab7..da21a03a719 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/one_i_128_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/one_i_128_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.one_i_128().on_insert(...)`. pub struct OneI128TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_i_16_table.rs b/crates/sdk/tests/test-client/src/module_bindings/one_i_16_table.rs index 97bcc8b8718..f4b74ceaf97 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/one_i_16_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/one_i_16_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.one_i_16().on_insert(...)`. pub struct OneI16TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_i_256_table.rs b/crates/sdk/tests/test-client/src/module_bindings/one_i_256_table.rs index d6324fa9925..fa66a0bd272 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/one_i_256_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/one_i_256_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.one_i_256().on_insert(...)`. pub struct OneI256TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_i_32_table.rs b/crates/sdk/tests/test-client/src/module_bindings/one_i_32_table.rs index fd9faa963b6..4df42fbaf3b 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/one_i_32_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/one_i_32_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.one_i_32().on_insert(...)`. pub struct OneI32TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_i_64_table.rs b/crates/sdk/tests/test-client/src/module_bindings/one_i_64_table.rs index 48848e16067..dc2901e5e08 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/one_i_64_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/one_i_64_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.one_i_64().on_insert(...)`. pub struct OneI64TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_i_8_table.rs b/crates/sdk/tests/test-client/src/module_bindings/one_i_8_table.rs index 5cf171ebeee..446556d9ac1 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/one_i_8_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/one_i_8_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.one_i_8().on_insert(...)`. pub struct OneI8TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_identity_table.rs b/crates/sdk/tests/test-client/src/module_bindings/one_identity_table.rs index ebc48489897..657d2a9b979 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/one_identity_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/one_identity_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.one_identity().on_insert(...)`. pub struct OneIdentityTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_simple_enum_table.rs b/crates/sdk/tests/test-client/src/module_bindings/one_simple_enum_table.rs index 0bd9641621f..7ca498405cf 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/one_simple_enum_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/one_simple_enum_table.rs @@ -19,7 +19,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.one_simple_enum().on_insert(...)`. pub struct OneSimpleEnumTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_string_table.rs b/crates/sdk/tests/test-client/src/module_bindings/one_string_table.rs index 2e814b11fb0..69c49a9f296 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/one_string_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/one_string_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.one_string().on_insert(...)`. pub struct OneStringTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_u_128_table.rs b/crates/sdk/tests/test-client/src/module_bindings/one_u_128_table.rs index fa297175ef3..6c627eb2a07 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/one_u_128_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/one_u_128_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.one_u_128().on_insert(...)`. pub struct OneU128TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_u_16_table.rs b/crates/sdk/tests/test-client/src/module_bindings/one_u_16_table.rs index 0837ef2464b..293db364455 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/one_u_16_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/one_u_16_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.one_u_16().on_insert(...)`. pub struct OneU16TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_u_256_table.rs b/crates/sdk/tests/test-client/src/module_bindings/one_u_256_table.rs index 6e52f5391c3..23e7512c4b4 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/one_u_256_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/one_u_256_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.one_u_256().on_insert(...)`. pub struct OneU256TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_u_32_table.rs b/crates/sdk/tests/test-client/src/module_bindings/one_u_32_table.rs index 9f52581069e..e1ccf309a9b 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/one_u_32_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/one_u_32_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.one_u_32().on_insert(...)`. pub struct OneU32TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_u_64_table.rs b/crates/sdk/tests/test-client/src/module_bindings/one_u_64_table.rs index 6e6af7251f9..525fe727621 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/one_u_64_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/one_u_64_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.one_u_64().on_insert(...)`. pub struct OneU64TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_u_8_table.rs b/crates/sdk/tests/test-client/src/module_bindings/one_u_8_table.rs index ef4b642c361..120abdcdf35 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/one_u_8_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/one_u_8_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.one_u_8().on_insert(...)`. pub struct OneU8TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_unit_struct_table.rs b/crates/sdk/tests/test-client/src/module_bindings/one_unit_struct_table.rs index 8fb41e77296..be1b0e345a2 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/one_unit_struct_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/one_unit_struct_table.rs @@ -19,7 +19,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.one_unit_struct().on_insert(...)`. pub struct OneUnitStructTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/option_every_primitive_struct_table.rs b/crates/sdk/tests/test-client/src/module_bindings/option_every_primitive_struct_table.rs index 5c84712ea82..9d24a836a55 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/option_every_primitive_struct_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/option_every_primitive_struct_table.rs @@ -19,7 +19,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.option_every_primitive_struct().on_insert(...)`. pub struct OptionEveryPrimitiveStructTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/option_i_32_table.rs b/crates/sdk/tests/test-client/src/module_bindings/option_i_32_table.rs index 12124867e24..0dc8afee859 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/option_i_32_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/option_i_32_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.option_i_32().on_insert(...)`. pub struct OptionI32TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/option_identity_table.rs b/crates/sdk/tests/test-client/src/module_bindings/option_identity_table.rs index 2647083952a..992b7f5b32f 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/option_identity_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/option_identity_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.option_identity().on_insert(...)`. pub struct OptionIdentityTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/option_simple_enum_table.rs b/crates/sdk/tests/test-client/src/module_bindings/option_simple_enum_table.rs index 73a78ff2826..f0e8ad6aeb1 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/option_simple_enum_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/option_simple_enum_table.rs @@ -19,7 +19,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.option_simple_enum().on_insert(...)`. pub struct OptionSimpleEnumTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/option_string_table.rs b/crates/sdk/tests/test-client/src/module_bindings/option_string_table.rs index 836b50224df..f8554272aa5 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/option_string_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/option_string_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.option_string().on_insert(...)`. pub struct OptionStringTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/option_vec_option_i_32_table.rs b/crates/sdk/tests/test-client/src/module_bindings/option_vec_option_i_32_table.rs index 9dd2783ebab..de496e73c21 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/option_vec_option_i_32_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/option_vec_option_i_32_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.option_vec_option_i_32().on_insert(...)`. pub struct OptionVecOptionI32TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/pk_address_table.rs b/crates/sdk/tests/test-client/src/module_bindings/pk_address_table.rs index 7fb6c2fa765..49dac990289 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/pk_address_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/pk_address_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.pk_address().on_insert(...)`. pub struct PkAddressTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -118,7 +118,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.pk_address().a().find(...)`. pub struct PkAddressAUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/pk_bool_table.rs b/crates/sdk/tests/test-client/src/module_bindings/pk_bool_table.rs index dcc9e768682..ad6b072b1c2 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/pk_bool_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/pk_bool_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.pk_bool().on_insert(...)`. pub struct PkBoolTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -117,7 +117,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.pk_bool().b().find(...)`. pub struct PkBoolBUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/pk_i_128_table.rs b/crates/sdk/tests/test-client/src/module_bindings/pk_i_128_table.rs index 8671f277b40..612229cb38c 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/pk_i_128_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/pk_i_128_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.pk_i_128().on_insert(...)`. pub struct PkI128TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -117,7 +117,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.pk_i_128().n().find(...)`. pub struct PkI128NUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/pk_i_16_table.rs b/crates/sdk/tests/test-client/src/module_bindings/pk_i_16_table.rs index 2ceadb322bd..07983031106 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/pk_i_16_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/pk_i_16_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.pk_i_16().on_insert(...)`. pub struct PkI16TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -115,7 +115,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.pk_i_16().n().find(...)`. pub struct PkI16NUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/pk_i_256_table.rs b/crates/sdk/tests/test-client/src/module_bindings/pk_i_256_table.rs index ea6dbdf16b4..a5b406a9645 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/pk_i_256_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/pk_i_256_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.pk_i_256().on_insert(...)`. pub struct PkI256TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -118,7 +118,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.pk_i_256().n().find(...)`. pub struct PkI256NUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/pk_i_32_table.rs b/crates/sdk/tests/test-client/src/module_bindings/pk_i_32_table.rs index 51895754ca8..4bb88aa8f92 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/pk_i_32_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/pk_i_32_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.pk_i_32().on_insert(...)`. pub struct PkI32TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -115,7 +115,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.pk_i_32().n().find(...)`. pub struct PkI32NUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/pk_i_64_table.rs b/crates/sdk/tests/test-client/src/module_bindings/pk_i_64_table.rs index f7ab21b7098..737d94bcf0d 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/pk_i_64_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/pk_i_64_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.pk_i_64().on_insert(...)`. pub struct PkI64TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -115,7 +115,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.pk_i_64().n().find(...)`. pub struct PkI64NUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/pk_i_8_table.rs b/crates/sdk/tests/test-client/src/module_bindings/pk_i_8_table.rs index 691e56d7d1d..54649eb363f 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/pk_i_8_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/pk_i_8_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.pk_i_8().on_insert(...)`. pub struct PkI8TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -115,7 +115,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.pk_i_8().n().find(...)`. pub struct PkI8NUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/pk_identity_table.rs b/crates/sdk/tests/test-client/src/module_bindings/pk_identity_table.rs index a25fe782ad6..e81274fd468 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/pk_identity_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/pk_identity_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.pk_identity().on_insert(...)`. pub struct PkIdentityTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -118,7 +118,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.pk_identity().i().find(...)`. pub struct PkIdentityIUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/pk_string_table.rs b/crates/sdk/tests/test-client/src/module_bindings/pk_string_table.rs index 91f9cc7f2d7..c9d147de4e6 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/pk_string_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/pk_string_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.pk_string().on_insert(...)`. pub struct PkStringTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -118,7 +118,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.pk_string().s().find(...)`. pub struct PkStringSUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/pk_u_128_table.rs b/crates/sdk/tests/test-client/src/module_bindings/pk_u_128_table.rs index b8425759a75..aff0c9c6200 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/pk_u_128_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/pk_u_128_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.pk_u_128().on_insert(...)`. pub struct PkU128TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -117,7 +117,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.pk_u_128().n().find(...)`. pub struct PkU128NUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/pk_u_16_table.rs b/crates/sdk/tests/test-client/src/module_bindings/pk_u_16_table.rs index 1efb9d500be..5e6d564d377 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/pk_u_16_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/pk_u_16_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.pk_u_16().on_insert(...)`. pub struct PkU16TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -115,7 +115,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.pk_u_16().n().find(...)`. pub struct PkU16NUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/pk_u_256_table.rs b/crates/sdk/tests/test-client/src/module_bindings/pk_u_256_table.rs index e07c92156c4..c65c65c9f25 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/pk_u_256_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/pk_u_256_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.pk_u_256().on_insert(...)`. pub struct PkU256TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -118,7 +118,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.pk_u_256().n().find(...)`. pub struct PkU256NUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/pk_u_32_table.rs b/crates/sdk/tests/test-client/src/module_bindings/pk_u_32_table.rs index 1f995680e8e..de10a72adeb 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/pk_u_32_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/pk_u_32_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.pk_u_32().on_insert(...)`. pub struct PkU32TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -115,7 +115,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.pk_u_32().n().find(...)`. pub struct PkU32NUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/pk_u_64_table.rs b/crates/sdk/tests/test-client/src/module_bindings/pk_u_64_table.rs index edafc0348ce..7139297e6a2 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/pk_u_64_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/pk_u_64_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.pk_u_64().on_insert(...)`. pub struct PkU64TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -115,7 +115,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.pk_u_64().n().find(...)`. pub struct PkU64NUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/pk_u_8_table.rs b/crates/sdk/tests/test-client/src/module_bindings/pk_u_8_table.rs index ad9341838ce..f263e463395 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/pk_u_8_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/pk_u_8_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.pk_u_8().on_insert(...)`. pub struct PkU8TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -115,7 +115,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.pk_u_8().n().find(...)`. pub struct PkU8NUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/table_holds_table_table.rs b/crates/sdk/tests/test-client/src/module_bindings/table_holds_table_table.rs index 5338a65e5ba..56f3a8b66a8 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/table_holds_table_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/table_holds_table_table.rs @@ -20,7 +20,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.table_holds_table().on_insert(...)`. pub struct TableHoldsTableTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/unique_address_table.rs b/crates/sdk/tests/test-client/src/module_bindings/unique_address_table.rs index 01c586a33aa..f7d81fc201a 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/unique_address_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/unique_address_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.unique_address().on_insert(...)`. pub struct UniqueAddressTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -98,7 +98,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.unique_address().a().find(...)`. pub struct UniqueAddressAUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/unique_bool_table.rs b/crates/sdk/tests/test-client/src/module_bindings/unique_bool_table.rs index 9da44544da4..55abaab424b 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/unique_bool_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/unique_bool_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.unique_bool().on_insert(...)`. pub struct UniqueBoolTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -98,7 +98,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.unique_bool().b().find(...)`. pub struct UniqueBoolBUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/unique_i_128_table.rs b/crates/sdk/tests/test-client/src/module_bindings/unique_i_128_table.rs index 1952c45b080..51da5ee5205 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/unique_i_128_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/unique_i_128_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.unique_i_128().on_insert(...)`. pub struct UniqueI128TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -98,7 +98,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.unique_i_128().n().find(...)`. pub struct UniqueI128NUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/unique_i_16_table.rs b/crates/sdk/tests/test-client/src/module_bindings/unique_i_16_table.rs index 2ae85224ab5..662a9f08881 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/unique_i_16_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/unique_i_16_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.unique_i_16().on_insert(...)`. pub struct UniqueI16TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -98,7 +98,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.unique_i_16().n().find(...)`. pub struct UniqueI16NUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/unique_i_256_table.rs b/crates/sdk/tests/test-client/src/module_bindings/unique_i_256_table.rs index 9b4b070dfd7..31c6c72eb93 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/unique_i_256_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/unique_i_256_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.unique_i_256().on_insert(...)`. pub struct UniqueI256TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -98,7 +98,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.unique_i_256().n().find(...)`. pub struct UniqueI256NUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/unique_i_32_table.rs b/crates/sdk/tests/test-client/src/module_bindings/unique_i_32_table.rs index 14d5427a75b..9828f306492 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/unique_i_32_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/unique_i_32_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.unique_i_32().on_insert(...)`. pub struct UniqueI32TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -98,7 +98,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.unique_i_32().n().find(...)`. pub struct UniqueI32NUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/unique_i_64_table.rs b/crates/sdk/tests/test-client/src/module_bindings/unique_i_64_table.rs index 6eb8b35855b..856521117ea 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/unique_i_64_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/unique_i_64_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.unique_i_64().on_insert(...)`. pub struct UniqueI64TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -98,7 +98,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.unique_i_64().n().find(...)`. pub struct UniqueI64NUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/unique_i_8_table.rs b/crates/sdk/tests/test-client/src/module_bindings/unique_i_8_table.rs index 7a26c27d7fa..7f925ee9977 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/unique_i_8_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/unique_i_8_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.unique_i_8().on_insert(...)`. pub struct UniqueI8TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -98,7 +98,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.unique_i_8().n().find(...)`. pub struct UniqueI8NUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/unique_identity_table.rs b/crates/sdk/tests/test-client/src/module_bindings/unique_identity_table.rs index 54988ef2790..7683e861daf 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/unique_identity_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/unique_identity_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.unique_identity().on_insert(...)`. pub struct UniqueIdentityTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -98,7 +98,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.unique_identity().i().find(...)`. pub struct UniqueIdentityIUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/unique_string_table.rs b/crates/sdk/tests/test-client/src/module_bindings/unique_string_table.rs index 4b47857172c..22dacdd78f1 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/unique_string_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/unique_string_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.unique_string().on_insert(...)`. pub struct UniqueStringTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -98,7 +98,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.unique_string().s().find(...)`. pub struct UniqueStringSUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/unique_u_128_table.rs b/crates/sdk/tests/test-client/src/module_bindings/unique_u_128_table.rs index 63b568ee3ef..9f502df7d38 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/unique_u_128_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/unique_u_128_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.unique_u_128().on_insert(...)`. pub struct UniqueU128TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -98,7 +98,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.unique_u_128().n().find(...)`. pub struct UniqueU128NUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/unique_u_16_table.rs b/crates/sdk/tests/test-client/src/module_bindings/unique_u_16_table.rs index fb545de33b2..b7d59b16924 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/unique_u_16_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/unique_u_16_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.unique_u_16().on_insert(...)`. pub struct UniqueU16TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -98,7 +98,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.unique_u_16().n().find(...)`. pub struct UniqueU16NUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/unique_u_256_table.rs b/crates/sdk/tests/test-client/src/module_bindings/unique_u_256_table.rs index 0bf15128245..9965dec4f2b 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/unique_u_256_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/unique_u_256_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.unique_u_256().on_insert(...)`. pub struct UniqueU256TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -98,7 +98,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.unique_u_256().n().find(...)`. pub struct UniqueU256NUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/unique_u_32_table.rs b/crates/sdk/tests/test-client/src/module_bindings/unique_u_32_table.rs index ad2b997b57e..4645fcdcee8 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/unique_u_32_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/unique_u_32_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.unique_u_32().on_insert(...)`. pub struct UniqueU32TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -98,7 +98,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.unique_u_32().n().find(...)`. pub struct UniqueU32NUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/unique_u_64_table.rs b/crates/sdk/tests/test-client/src/module_bindings/unique_u_64_table.rs index 10b3a652a5f..072c2e16511 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/unique_u_64_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/unique_u_64_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.unique_u_64().on_insert(...)`. pub struct UniqueU64TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -98,7 +98,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.unique_u_64().n().find(...)`. pub struct UniqueU64NUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/unique_u_8_table.rs b/crates/sdk/tests/test-client/src/module_bindings/unique_u_8_table.rs index 18f9d78c2a8..77c59b7dc7b 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/unique_u_8_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/unique_u_8_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.unique_u_8().on_insert(...)`. pub struct UniqueU8TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } @@ -98,7 +98,7 @@ pub(super) fn parse_table_update( /// but to directly chain method calls, /// like `ctx.db.unique_u_8().n().find(...)`. pub struct UniqueU8NUnique<'ctx> { - imp: __sdk::client_cache::UniqueConstraint, + imp: __sdk::client_cache::UniqueConstraintHandle, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_address_table.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_address_table.rs index da1bceb6827..5a48b340aab 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/vec_address_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_address_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.vec_address().on_insert(...)`. pub struct VecAddressTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_bool_table.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_bool_table.rs index 8f659d02195..7cf67ab0cc3 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/vec_bool_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_bool_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.vec_bool().on_insert(...)`. pub struct VecBoolTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_byte_struct_table.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_byte_struct_table.rs index fe6369b9d91..4a2177c45ce 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/vec_byte_struct_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_byte_struct_table.rs @@ -19,7 +19,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.vec_byte_struct().on_insert(...)`. pub struct VecByteStructTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_enum_with_payload_table.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_enum_with_payload_table.rs index c656c228bbd..160bc91118d 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/vec_enum_with_payload_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_enum_with_payload_table.rs @@ -19,7 +19,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.vec_enum_with_payload().on_insert(...)`. pub struct VecEnumWithPayloadTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_every_primitive_struct_table.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_every_primitive_struct_table.rs index 1f9bcae583d..a7758e4ce39 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/vec_every_primitive_struct_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_every_primitive_struct_table.rs @@ -19,7 +19,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.vec_every_primitive_struct().on_insert(...)`. pub struct VecEveryPrimitiveStructTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_every_vec_struct_table.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_every_vec_struct_table.rs index f30c45bff34..769b4d337ab 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/vec_every_vec_struct_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_every_vec_struct_table.rs @@ -19,7 +19,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.vec_every_vec_struct().on_insert(...)`. pub struct VecEveryVecStructTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_f_32_table.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_f_32_table.rs index 4eb4fe87054..d9f970c94a7 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/vec_f_32_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_f_32_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.vec_f_32().on_insert(...)`. pub struct VecF32TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_f_64_table.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_f_64_table.rs index 838573c5018..00977db5265 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/vec_f_64_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_f_64_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.vec_f_64().on_insert(...)`. pub struct VecF64TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_i_128_table.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_i_128_table.rs index dc16bc1b95e..a4b3d97cf2a 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/vec_i_128_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_i_128_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.vec_i_128().on_insert(...)`. pub struct VecI128TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_i_16_table.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_i_16_table.rs index b152c36eec3..624276b50f9 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/vec_i_16_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_i_16_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.vec_i_16().on_insert(...)`. pub struct VecI16TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_i_256_table.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_i_256_table.rs index 30e32027363..e313fe8b764 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/vec_i_256_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_i_256_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.vec_i_256().on_insert(...)`. pub struct VecI256TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_i_32_table.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_i_32_table.rs index 0f091dbc77e..74b12d78168 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/vec_i_32_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_i_32_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.vec_i_32().on_insert(...)`. pub struct VecI32TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_i_64_table.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_i_64_table.rs index b165fa68c8a..108d9dc580b 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/vec_i_64_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_i_64_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.vec_i_64().on_insert(...)`. pub struct VecI64TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_i_8_table.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_i_8_table.rs index 15e8abf384b..b61ef9602c3 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/vec_i_8_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_i_8_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.vec_i_8().on_insert(...)`. pub struct VecI8TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_identity_table.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_identity_table.rs index 5e1828b30f1..5df7a1db813 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/vec_identity_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_identity_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.vec_identity().on_insert(...)`. pub struct VecIdentityTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_simple_enum_table.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_simple_enum_table.rs index 8c35332e50e..8896d13d2f5 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/vec_simple_enum_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_simple_enum_table.rs @@ -19,7 +19,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.vec_simple_enum().on_insert(...)`. pub struct VecSimpleEnumTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_string_table.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_string_table.rs index 42842147191..f566ce99b9e 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/vec_string_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_string_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.vec_string().on_insert(...)`. pub struct VecStringTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_u_128_table.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_u_128_table.rs index 867532ef356..b7c3d664469 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/vec_u_128_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_u_128_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.vec_u_128().on_insert(...)`. pub struct VecU128TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_u_16_table.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_u_16_table.rs index 7c4ace51e70..bbe8c06de68 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/vec_u_16_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_u_16_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.vec_u_16().on_insert(...)`. pub struct VecU16TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_u_256_table.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_u_256_table.rs index 368682740be..702b713e771 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/vec_u_256_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_u_256_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.vec_u_256().on_insert(...)`. pub struct VecU256TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_u_32_table.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_u_32_table.rs index 4777a2271b2..072f9c50cdb 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/vec_u_32_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_u_32_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.vec_u_32().on_insert(...)`. pub struct VecU32TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_u_64_table.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_u_64_table.rs index f8f9dd26a84..753bb99f03b 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/vec_u_64_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_u_64_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.vec_u_64().on_insert(...)`. pub struct VecU64TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_u_8_table.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_u_8_table.rs index 75b7c377c68..d46a93ef61c 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/vec_u_8_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_u_8_table.rs @@ -18,7 +18,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.vec_u_8().on_insert(...)`. pub struct VecU8TableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_unit_struct_table.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_unit_struct_table.rs index 35c9fd01242..a406eff659c 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/vec_unit_struct_table.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_unit_struct_table.rs @@ -19,7 +19,7 @@ use spacetimedb_sdk::{ /// but to directly chain method calls, /// like `ctx.db.vec_unit_struct().on_insert(...)`. pub struct VecUnitStructTableHandle<'ctx> { - imp: __sdk::db_connection::TableHandle, + imp: __sdk::client_cache::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, }