You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -320,6 +320,23 @@ check the indexes on the table and delete any extra indexes and create any missi
320
320
is done through the index name, so if you use custom names for your indexes, it might happen that it won't get updated
321
321
on change of the content but not the name.
322
322
323
+
#### Refreshing dependencies / dependants
324
+
325
+
The `refresh` method on `MaterializedView` only refreshes the given view, not dependencies or dependants.
326
+
If you want to refresh all views related to a given view(s), i.e. all dependencies and dependants, you can use the `refresh_specific_views` utility function.
327
+
328
+
```python
329
+
from django_pgviews.refresh import refresh_specific_views
Under the hood that function is implemented usingh three public utility functions from `django_pgviews.dependencies`, which you can use directly if you need more control over the refresh process:
335
+
336
+
-`get_views_dependendants`: Get all dependants of a given view(s).
337
+
-`get_views_dependencies`: Get all dependencies of a given view(s).
338
+
-`reorder_by_dependencies`: Reorder views to ensure that dependencies are refreshed before dependants.
339
+
323
340
### Schemas
324
341
325
342
By default, the views will get created in the schema of the database, this is usually `public`.
0 commit comments