(
&self,
row_id: &RowId,
data: Option<DatabaseRowDataVariant>,
sender: Option<RowChangeSender>,
)
| 242 | } |
| 243 | |
| 244 | async fn build_arc_database_row( |
| 245 | &self, |
| 246 | row_id: &RowId, |
| 247 | data: Option<DatabaseRowDataVariant>, |
| 248 | sender: Option<RowChangeSender>, |
| 249 | ) -> Result<Arc<RwLock<DatabaseRow>>, CollabError> { |
| 250 | if let Some(cache) = self.database_row_cache() { |
| 251 | if let Some(cached_row) = cache.get(row_id) { |
| 252 | return Ok(cached_row.clone()); |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | let client_id = self.reader_client_id().await; |
| 257 | let collab_type = CollabType::DatabaseRow; |
| 258 | let data = match data { |
| 259 | None => self.reader_get_collab(row_id, collab_type).await?, |
| 260 | Some(data) => data.into_encode_collab(client_id), |
| 261 | }; |
| 262 | let collab = build_collab(client_id, row_id, collab_type, data).await?; |
| 263 | let database_row = DatabaseRow::open(*row_id, collab, sender)?; |
| 264 | let arc_row = Arc::new(RwLock::new(database_row)); |
| 265 | |
| 266 | if let Some(cache) = self.database_row_cache() { |
| 267 | cache.insert(*row_id, arc_row.clone()); |
| 268 | } |
| 269 | Ok(arc_row) |
| 270 | } |
| 271 | |
| 272 | async fn batch_build_arc_database_row( |
| 273 | &self, |
no test coverage detected