Class: AmazonAthena::Commands::CreateDatabase
- Inherits:
-
AmazonAthena::Command
- Object
- AmazonAthena::Command
- AmazonAthena::Commands::CreateDatabase
- Defined in:
- lib/amazon_athena/commands/create_database.rb
Instance Method Summary collapse
-
#initialize(name) ⇒ CreateDatabase
constructor
A new instance of CreateDatabase.
- #run(connection) ⇒ Object
- #statement ⇒ Object
Methods inherited from AmazonAthena::Command
Constructor Details
#initialize(name) ⇒ CreateDatabase
Returns a new instance of CreateDatabase.
7 8 9 |
# File 'lib/amazon_athena/commands/create_database.rb', line 7 def initialize(name) @name = name end |
Instance Method Details
#run(connection) ⇒ Object
15 16 17 18 19 |
# File 'lib/amazon_athena/commands/create_database.rb', line 15 def run(connection) connection.query(statement) return end |
#statement ⇒ Object
11 12 13 |
# File 'lib/amazon_athena/commands/create_database.rb', line 11 def statement "CREATE DATABASE IF NOT EXISTS #{@name};" end |