Class: Roebe::SqlParadise::CreateDatabase

Inherits:
SQL_Command show all
Defined in:
lib/roebe/sql_paradise/create_database.rb

Overview

Roebe::SqlParadise::CreateDatabase

Constant Summary collapse

REMOVE_NEWLINES =
#

REMOVE_NEWLINES

#
true

Class Method Summary collapse

Methods inherited from SQL_Command

#sanitize

Class Method Details

.[](name_of_database = :nodes) ⇒ Object

#

CreateDatabase[]

Use this class method to generate a proper CREATE DATABASE statement.

#


27
28
29
30
31
32
33
34
35
36
37
# File 'lib/roebe/sql_paradise/create_database.rb', line 27

def self.[](
    name_of_database = :nodes
  )
  name_of_database = SQL_Command.new.sanitize(name_of_database.to_s)
  values = SQL_Command.new.sanitize(values.to_s)
  _ = <<EOF
CREATE DATABASE #{name_of_database};
EOF
  _.delete!("\n") if REMOVE_NEWLINES
  return _.chomp
end