def refresh_materialized_view(name, concurrently: false, cascade: false)
        raise_unless_materialized_views_supported

        if concurrently
          raise_unless_concurrent_refresh_supported
        end

        if cascade
          refresh_dependencies_for(name, concurrently: concurrently)
        end

        if concurrently && populated?(name)
          execute "REFRESH MATERIALIZED VIEW CONCURRENTLY #{quote_table_name(name)};"
        else
          execute "REFRESH MATERIALIZED VIEW #{quote_table_name(name)};"
        end
      end
Refreshes a materialized view from its SQL schema.

This is typically called from application code via {Scenic.database}.

@param name The name of the materialized view to refresh.
@param concurrently [Boolean] Whether the refreshs hould happen
concurrently or not. A concurrent refresh allows the view to be
refreshed without locking the view for select but requires that the
table have at least one unique index that covers all rows. Attempts to
refresh concurrently without a unique index will raise a descriptive
error. This option is ignored if the view is not populated, as it
would cause an error to be raised by Postgres. Default: false.
@param cascade [Boolean] Whether to refresh dependent materialized
views. Default: false.

@raise [MaterializedViewsNotSupportedError] if the version of Postgres
in use does not support materialized views.
@raise [ConcurrentRefreshesNotSupportedError] when attempting a
concurrent refresh on version of Postgres that does not support
concurrent materialized view refreshes.

@example Non-concurrent refresh
Scenic.database.refresh_materialized_view(:search_results)
@example Concurrent refresh
Scenic.database.refresh_materialized_view(:posts, concurrently: true)
@example Cascade refresh
Scenic.database.refresh_materialized_view(:posts, cascade: true)

@return [void]