Class: PGExaminer::Result::Schema
- Inherits:
-
Item
- Object
- Base
- Item
- PGExaminer::Result::Schema
show all
- Defined in:
- lib/pg_examiner/result/schema.rb
Instance Attribute Summary
Attributes inherited from Item
#parent, #result, #row
Instance Method Summary
collapse
Methods inherited from Item
#initialize, #inspect, #name, #oid
Methods inherited from Base
#==, #diff, #diffable_attrs, #diffable_methods
Instance Method Details
#diffable_lists ⇒ Object
6
7
8
9
10
11
12
|
# File 'lib/pg_examiner/result/schema.rb', line 6
def diffable_lists
{
"tables" => "tables",
"sequences" => "sequences",
"functions" => "functions",
}
end
|
#functions ⇒ Object
26
27
28
29
30
|
# File 'lib/pg_examiner/result/schema.rb', line 26
def functions
@functions ||= result.pg_proc.select do |c|
c['pronamespace'] == oid
end.map{|row| Function.new(result, row, self)}.sort_by(&:name)
end
|
#sequences ⇒ Object
20
21
22
23
24
|
# File 'lib/pg_examiner/result/schema.rb', line 20
def sequences
@sequences ||= result.pg_class.select do |c|
c['relnamespace'] == oid && c['relkind'] == 'S'
end.map{|row| Sequence.new(result, row, self)}.sort_by(&:name)
end
|
#tables ⇒ Object
14
15
16
17
18
|
# File 'lib/pg_examiner/result/schema.rb', line 14
def tables
@tables ||= result.pg_class.select do |c|
c['relnamespace'] == oid && c['relkind'] == 'r'
end.map{|row| Table.new(result, row, self)}.sort_by(&:name)
end
|