pub struct RefreshMaterializedViewOperation<E: QueryEngine, V: MaterializedView> { /* private fields */ }Expand description
A refresh operation for materialized views.
This operation refreshes the data in a materialized view.
For PostgreSQL, this executes REFRESH MATERIALIZED VIEW.
§Example
ⓘ
// Refresh a materialized view
client
.user_stats()
.refresh()
.exec()
.await?;
// Refresh concurrently (allows reads during refresh)
client
.user_stats()
.refresh()
.concurrently()
.exec()
.await?;Implementations§
Source§impl<E: QueryEngine, V: MaterializedView> RefreshMaterializedViewOperation<E, V>
impl<E: QueryEngine, V: MaterializedView> RefreshMaterializedViewOperation<E, V>
Sourcepub fn concurrently(self) -> Self
pub fn concurrently(self) -> Self
Refresh concurrently (allows reads during refresh).
Note: Concurrent refresh requires a unique index on the view. Not all databases support concurrent refresh.
Sourcepub async fn exec(self) -> QueryResult<()>
pub async fn exec(self) -> QueryResult<()>
Execute the refresh operation.
Auto Trait Implementations§
impl<E, V> Freeze for RefreshMaterializedViewOperation<E, V>where
E: Freeze,
impl<E, V> RefUnwindSafe for RefreshMaterializedViewOperation<E, V>where
E: RefUnwindSafe,
V: RefUnwindSafe,
impl<E, V> Send for RefreshMaterializedViewOperation<E, V>
impl<E, V> Sync for RefreshMaterializedViewOperation<E, V>
impl<E, V> Unpin for RefreshMaterializedViewOperation<E, V>
impl<E, V> UnwindSafe for RefreshMaterializedViewOperation<E, V>where
E: UnwindSafe,
V: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more