Class: Timescaledb::Scenic::Views

Inherits:
Scenic::Adapters::Postgres::Views
  • Object
show all
Defined in:
lib/timescaledb/scenic/adapter.rb

Instance Method Summary collapse

Instance Method Details

#allArray<Scenic::View>

All of the views that this connection has defined, excluding any Timescale continuous aggregates. Those should be defined using create_continuous_aggregate rather than create_view.

Returns:

  • (Array<Scenic::View>)


12
13
14
15
16
17
18
19
# File 'lib/timescaledb/scenic/adapter.rb', line 12

def all
  ts_views = views_from_timescale.map { |v| to_scenic_view(v) }
  pg_views = views_from_postgres.map { |v| to_scenic_view(v) }
  ts_view_names = ts_views.map(&:name)
  # Skip records with matching names (includes the schema name
  # for records not in the public schema)
  pg_views.reject { |v| v.name.in?(ts_view_names) }
end