Module: DbSchema::Reader

Defined in:
lib/db_schema/reader.rb

Class Method Summary collapse

Class Method Details

.reader_for(connection) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/db_schema/reader.rb', line 4

def reader_for(connection)
  case connection.adapter_scheme
  when :postgres
    unless defined?(Reader::Postgres)
      raise 'You need the \'db_schema-reader-postgres\' gem in order to work with PostgreSQL database structure.'
    end

    Reader::Postgres.new(connection)
  else
    raise NotImplementedError, "DbSchema::Reader does not support #{connection.adapter_scheme}."
  end
end