Avoid N+1 query for channels with notes changes
Also, start work on new timing for recording observed notes edits. Co-authored-by: Mikayla <mikayla@zed.dev>
This commit is contained in:
parent
84c4db13fb
commit
d9d997b218
7 changed files with 381 additions and 97 deletions
|
@ -119,7 +119,7 @@ impl Database {
|
|||
Ok(new_migrations)
|
||||
}
|
||||
|
||||
async fn transaction<F, Fut, T>(&self, f: F) -> Result<T>
|
||||
pub async fn transaction<F, Fut, T>(&self, f: F) -> Result<T>
|
||||
where
|
||||
F: Send + Fn(TransactionHandle) -> Fut,
|
||||
Fut: Send + Future<Output = Result<T>>,
|
||||
|
@ -321,7 +321,7 @@ fn is_serialization_error(error: &Error) -> bool {
|
|||
}
|
||||
}
|
||||
|
||||
struct TransactionHandle(Arc<Option<DatabaseTransaction>>);
|
||||
pub struct TransactionHandle(Arc<Option<DatabaseTransaction>>);
|
||||
|
||||
impl Deref for TransactionHandle {
|
||||
type Target = DatabaseTransaction;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue