MCPcopy Create free account
hub / github.com/AppFlowy-IO/AppFlowy-Collab / create_arc_database_row

Method create_arc_database_row

collab/src/database/database_trait.rs:222–242  ·  view source on GitHub ↗
(
    &self,
    row_id: &RowId,
    data: DatabaseRowDataVariant,
    sender: Option<RowChangeSender>,
  )

Source from the content-addressed store, hash-verified

220 }
221
222 async fn create_arc_database_row(
223 &self,
224 row_id: &RowId,
225 data: DatabaseRowDataVariant,
226 sender: Option<RowChangeSender>,
227 ) -> Result<Arc<RwLock<DatabaseRow>>, CollabError> {
228 let client_id = self.reader_client_id().await;
229 let collab_type = CollabType::DatabaseRow;
230 let data = data.into_encode_collab(client_id);
231 if let Some(persistence) = self.reader_persistence() {
232 persistence.upsert_collab(row_id, data.clone())?;
233 }
234
235 let collab = build_collab(client_id, row_id, collab_type, data).await?;
236 let database_row = DatabaseRow::open(*row_id, collab, sender)?;
237 let arc_row = Arc::new(RwLock::new(database_row));
238 if let Some(cache) = self.database_row_cache() {
239 cache.insert(*row_id, arc_row.clone());
240 }
241 Ok(arc_row)
242 }
243
244 async fn build_arc_database_row(
245 &self,

Callers 1

create_new_rowMethod · 0.80

Calls 7

build_collabFunction · 0.85
into_encode_collabMethod · 0.80
upsert_collabMethod · 0.80
reader_client_idMethod · 0.45
reader_persistenceMethod · 0.45
database_row_cacheMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected