Class: RDBr::Catalog::Reader

Inherits:
Object
  • Object
show all
Defined in:
lib/rdbr/catalog/reader.rb

Direct Known Subclasses

Mysql, Postgresql, Sqlite

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connection, include_system: false) ⇒ Reader

Returns a new instance of Reader.



12
13
14
15
# File 'lib/rdbr/catalog/reader.rb', line 12

def initialize(connection, include_system: false)
  @connection = connection
  @include_system = include_system
end

Class Method Details

.for(adapter_name) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/rdbr/catalog/reader.rb', line 4

def self.for(adapter_name)
  return Postgresql if [ 'postgresql', 'postgis' ].include?(adapter_name)
  return Sqlite if [ 'sqlite', 'sqlite3' ].include?(adapter_name)
  return Mysql if [ 'mysql', 'mysql2', 'trilogy' ].include?(adapter_name)

  raise UnsupportedAdapterError, "Unsupported database adapter: #{adapter_name}"
end

Instance Method Details

#readObject

Raises:

  • (NotImplementedError)


17
18
19
# File 'lib/rdbr/catalog/reader.rb', line 17

def read
  raise NotImplementedError
end