Class: Arc::DataStores::ObjectDefinitions::PostgresSchema

Inherits:
Schema
  • Object
show all
Defined in:
lib/arc/data_stores/postgres/object_definitions.rb

Instance Method Summary collapse

Methods inherited from Schema

#execute_ddl, #initialize

Constructor Details

This class inherits a constructor from Arc::DataStores::ObjectDefinitions::Schema

Instance Method Details

#fetch_item(name) ⇒ Object



12
13
14
# File 'lib/arc/data_stores/postgres/object_definitions.rb', line 12

def fetch_item name
  PostgresTable.new name, @data_store
end

#fetch_keysObject



8
9
10
11
# File 'lib/arc/data_stores/postgres/object_definitions.rb', line 8

def fetch_keys
  names = @data_store.read("select tablename from pg_tables where schemaname = ANY(current_schemas(false))")
  names = names.to_a.map { |n| n[:tablename].to_sym }
end