Class: TableSaw::Queries::NoIdTables

Inherits:
Object
  • Object
show all
Defined in:
lib/table_saw/queries/no_id_tables.rb

Constant Summary collapse

QUERY =
"select t.table_name\nfrom information_schema.tables t left outer join information_schema.table_constraints tc\n    on t.table_name = tc.table_name and tc.constraint_type = 'PRIMARY KEY'\nwhere t.table_schema = 'public' and table_type = 'BASE TABLE' and tc.table_name IS NULL\n"

Instance Method Summary collapse

Instance Method Details

#callObject



13
14
15
16
17
# File 'lib/table_saw/queries/no_id_tables.rb', line 13

def call
  TableSaw::Connection.with do |conn|
    conn.exec(QUERY)
  end
end