class Scenic::Adapters::Postgres::RefreshDependencies

Constants

DEPENDENCY_SQL

Attributes

adapter[R]
concurrently[R]
connection[R]
name[R]

Public Class Methods

call(name, adapter, connection, concurrently: false) click to toggle source
# File lib/scenic/adapters/postgres/refresh_dependencies.rb, line 5
def self.call(name, adapter, connection, concurrently: false)
  new(name, adapter, connection, concurrently: concurrently).call
end
new(name, adapter, connection, concurrently:) click to toggle source
# File lib/scenic/adapters/postgres/refresh_dependencies.rb, line 9
def initialize(name, adapter, connection, concurrently:)
  @name = name
  @adapter = adapter
  @connection = connection
  @concurrently = concurrently
end

Public Instance Methods

call() click to toggle source
# File lib/scenic/adapters/postgres/refresh_dependencies.rb, line 16
def call
  dependencies.each do |dependency|
    adapter.refresh_materialized_view(
      dependency,
      concurrently: concurrently
    )
  end
end

Private Instance Methods

dependencies() click to toggle source
# File lib/scenic/adapters/postgres/refresh_dependencies.rb, line 109
def dependencies
  raw_dependency_info = connection.select_rows(DEPENDENCY_SQL)
  DependencyParser.new(raw_dependency_info, name).to_sorted_array
end