Method: PgDiff::View#initialize

Defined in:
lib/view.rb

#initialize(conn, sch, relname) ⇒ View

Returns a new instance of View.



5
6
7
8
9
10
11
12
# File 'lib/view.rb', line 5

def initialize(conn, sch, relname)
  @name = "#{sch}.#{relname}"
  view_qery = <<-EOT
    SELECT pg_catalog.pg_get_viewdef('#{@name}'::regclass, true)
  EOT
  tuple = conn.query(view_qery).first
  @def = tuple['pg_get_viewdef']
end