lib/rest/create.rb
  Creates a database with the given name and switches to this database as working-database. Types are either 'plocal' or 'memory'

  Returns the name of the working-database
Creates a database with the given name and switches to this database as working-database. Types are either 'plocal' or 'memory'
Returns the name of the working-database
Creates a database with the given name and switches to this database as working - database . Types are either ' plocal ' or ' memory ' Returns the name of the working - database
def create_database type: 'plocal', database: 
    logger.progname = 'RestCreate#CreateDatabase'
    old_d = ActiveOrient.database
    ActiveOrient.database_classes = {} 
    ActiveOrient.database = database 
    begin
      response = @res["database/#{ActiveOrient.database}/#{type}"].post ""
      if response.code == 200
	logger.info{"Database #{ActiveOrient.database} successfully created and stored as working database"}
      else
	logger.error{"Database #{ActiveOrient.database} was NOT created. Working Database is still #{ActiveOrient.database}"}
	ActiveOrient.database = old_d
      end
    rescue RestClient::InternalServerError => e
      logger.error{"Database #{ActiveOrient.database} was NOT created. Working Database is still #{ActiveOrient.database}"}
      ActiveOrient.database = old_d
    end
    ActiveOrient.database  
  end
def create_database type : 'plocal' , database : logger . progname = 'RestCreate#CreateDatabase' old_d = ActiveOrient . database ActiveOrient . database_classes = { } ActiveOrient . database = database begin response = @res [ "database/#{ActiveOrient.database}/#{type}" ] . post "" if response . code == 200 logger . info { "Database #{ActiveOrient.database} successfully created and stored as working database" } else logger . error { "Database #{ActiveOrient.database} was NOT created. Working Database is still #{ActiveOrient.database}" } ActiveOrient . database = old_d end rescue RestClient :: InternalServerError => e logger . error { "Database #{ActiveOrient.database} was NOT created. Working Database is still #{ActiveOrient.database}" } ActiveOrient . database = old_d end ActiveOrient . database end
Creates a database with the given name and switches to this database as working-database.
Creates a database with the given name and switches to this database as working - database .
# return_value
type
<not_specific>
database
<not_specific>