Class: Scenic::Adapters::Mysql::Views Private

Inherits:
Object
  • Object
show all
Defined in:
lib/scenic/adapters/mysql/views.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Fetches defined views from the mysql connection.

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ Views

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Views.



7
8
9
# File 'lib/scenic/adapters/mysql/views.rb', line 7

def initialize(connection)
  @connection = connection
end

Instance Method Details

#allArray<Scenic::View>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

All of the views that this connection has defined. Mysql will return these views ordered by name. Difference from the original Postgres adapter:

Mysql2 gem only watches one schema at a time.

This will not include materialized views as these are not supported by mysql.

Returns:

  • (Array<Scenic::View>)


20
21
22
# File 'lib/scenic/adapters/mysql/views.rb', line 20

def all
  views_from_mysql.map(&method(:to_scenic_view))
end