Called internally when updating the client cache in response to WebSocket messages, and by the codegen when initializing the client cache during [`crate::DbConnectionBuilder::build`].
(
&mut self,
table_name: &'static str,
)
| 370 | /// Called internally when updating the client cache in response to WebSocket messages, |
| 371 | /// and by the codegen when initializing the client cache during [`crate::DbConnectionBuilder::build`]. |
| 372 | pub fn get_or_make_table<Row: InModule<Module = M> + Send + Sync + 'static>( |
| 373 | &mut self, |
| 374 | table_name: &'static str, |
| 375 | ) -> &mut TableCache<Row> { |
| 376 | self.tables |
| 377 | .entry::<HashMap<&'static str, TableCache<Row>>>() |
| 378 | .or_default() |
| 379 | .entry(table_name) |
| 380 | .or_insert_with(|| TableCache::new(self.extra_logging.clone())) |
| 381 | } |
| 382 | |
| 383 | /// Apply all the mutations in `diff` |
| 384 | /// to the [`TableCache`] which stores rows of type `Row` for the table `table_name`. |