class AmazonAthena::Commands::ShowTables

Public Class Methods

new(database_name) click to toggle source
# File lib/amazon_athena/commands/show_tables.rb, line 7
def initialize(database_name)
  @database_name = database_name.strip
end

Public Instance Methods

run(connection) click to toggle source
# File lib/amazon_athena/commands/show_tables.rb, line 15
def run(connection)
  connection.query(statement).map {|row| row.tab_name }
rescue Exception => e
  e.getCause()
end
statement() click to toggle source
# File lib/amazon_athena/commands/show_tables.rb, line 11
def statement
  "SHOW TABLES IN #{@database_name};"
end