diff --git a/crates/prose-store/src/driver/indexed_db.rs b/crates/prose-store/src/driver/indexed_db.rs index a9639dcf..463415ba 100644 --- a/crates/prose-store/src/driver/indexed_db.rs +++ b/crates/prose-store/src/driver/indexed_db.rs @@ -106,8 +106,14 @@ pub struct IndexedDB { impl Database for IndexedDB { type Error = Error; - type ReadTransaction<'db> = IndexedDBTransaction<'db, ReadOnly> where Self: 'db; - type ReadWriteTransaction<'db> = IndexedDBTransaction<'db, ReadWrite> where Self: 'db; + type ReadTransaction<'db> + = IndexedDBTransaction<'db, ReadOnly> + where + Self: 'db; + type ReadWriteTransaction<'db> + = IndexedDBTransaction<'db, ReadWrite> + where + Self: 'db; async fn collection_names(&self) -> Result, Self::Error> { Ok(self.db.object_store_names().collect()) @@ -134,7 +140,10 @@ pub struct IndexedDBUpgradeTransaction<'db> { impl<'db> UpgradeTransaction<'db> for IndexedDBUpgradeTransaction<'db> { type Error = Error; - type ReadWriteTransaction<'tx> = IndexedDBTransaction<'tx, ReadWrite> where Self: 'tx; + type ReadWriteTransaction<'tx> + = IndexedDBTransaction<'tx, ReadWrite> + where + Self: 'tx; fn collection_names(&self) -> Result, Self::Error> { Ok(self.db.object_store_names().collect()) @@ -179,7 +188,10 @@ impl<'db, Mode> ReadTransaction<'db> for IndexedDBTransaction<'db, Mode> where Mode: ReadMode, { - type ReadableCollection<'tx> = IndexedDBCollection<'tx, IdbObjectStore<'tx>, ReadOnly> where Self: 'tx; + type ReadableCollection<'tx> + = IndexedDBCollection<'tx, IdbObjectStore<'tx>, ReadOnly> + where + Self: 'tx; fn readable_collection(&self, name: &str) -> Result, Self::Error> { Ok(IndexedDBCollection::new(self.tx.object_store(name)?)) @@ -191,7 +203,10 @@ impl<'db, Mode> WriteTransaction<'db> for IndexedDBTransaction<'db, Mode> where Mode: WriteMode, { - type WritableCollection<'tx> = IndexedDBCollection<'tx, IdbObjectStore<'tx>, ReadWrite> where Self: 'tx; + type WritableCollection<'tx> + = IndexedDBCollection<'tx, IdbObjectStore<'tx>, ReadWrite> + where + Self: 'tx; fn writeable_collection( &self, @@ -236,7 +251,10 @@ impl<'tx, Mode> IndexedCollection<'tx> for IndexedDBCollection<'tx, IdbObjectSto where Mode: ReadMode, { - type Index<'coll> = IndexedDBCollection<'coll, IdbIndex<'coll>, Mode> where Self: 'coll; + type Index<'coll> + = IndexedDBCollection<'coll, IdbIndex<'coll>, Mode> + where + Self: 'coll; fn index(&self, columns: &[&str]) -> Result, Self::Error> { let index_name = columns.join("_"); diff --git a/crates/prose-store/src/driver/sqlite.rs b/crates/prose-store/src/driver/sqlite.rs index 0e9b269b..9c24a168 100644 --- a/crates/prose-store/src/driver/sqlite.rs +++ b/crates/prose-store/src/driver/sqlite.rs @@ -280,7 +280,8 @@ pub struct SqliteTransaction<'db, Mode> { impl<'db> UpgradeTransaction<'db> for SqliteTransaction<'db, Upgrade> { type Error = Error; - type ReadWriteTransaction<'tx> = SqliteTransaction<'tx, ReadWrite> + type ReadWriteTransaction<'tx> + = SqliteTransaction<'tx, ReadWrite> where Self: 'tx; @@ -394,7 +395,8 @@ impl<'db, Mode: Send + Sync> ReadTransaction<'db> for SqliteTransaction<'db, Mod where Mode: ReadMode, { - type ReadableCollection<'tx> = SqliteCollection<'tx, ReadOnly> + type ReadableCollection<'tx> + = SqliteCollection<'tx, ReadOnly> where Self: 'tx; @@ -417,7 +419,8 @@ impl<'db, Mode: Send + Sync> WriteTransaction<'db> for SqliteTransaction<'db, Mo where Mode: WriteMode + Sync, { - type WritableCollection<'tx> = SqliteCollection<'tx, ReadWrite> + type WritableCollection<'tx> + = SqliteCollection<'tx, ReadWrite> where Self: 'tx; @@ -521,7 +524,8 @@ impl<'tx, Mode: Send> IndexedCollection<'tx> for SqliteCollection<'tx, Mode> where Mode: ReadMode + Sync, { - type Index<'coll> = SqliteCollection<'coll, Mode> + type Index<'coll> + = SqliteCollection<'coll, Mode> where Self: 'coll;