Module: ActiveRecord::ConnectionAdapters::Materialize::Schema::ViewStatements

Included in:
ActiveRecord::ConnectionAdapters::MaterializeAdapter
Defined in:
lib/active_record/connection_adapters/materialize/schema/view_statements.rb

Instance Method Summary collapse

Instance Method Details

#materialized_viewsObject

Returns an array of view names defined in the database.



10
11
12
# File 'lib/active_record/connection_adapters/materialize/schema/view_statements.rb', line 10

def materialized_views
  query_values(data_source_sql(type: "MATERIALIZED"), "SCHEMA")
end

#view_sql(view_name) ⇒ Object



14
15
16
# File 'lib/active_record/connection_adapters/materialize/schema/view_statements.rb', line 14

def view_sql(view_name)
  query("SHOW CREATE VIEW #{quote_table_name(view_name)}", "SCHEMA").first.last
end