Class: OrientDB::DocumentDatabase

Inherits:
Object
  • Object
show all
Includes:
DocumentDatabaseMixin
Defined in:
lib/orientdb/database.rb

Class Method Summary collapse

Methods included from DocumentDatabaseMixin

#all, #all_in_class, #all_in_cluster, #create_class, #drop_class, #find_by_rid, #find_by_rids, #first, #get_class, #get_or_create_class, #migrate_class, #prepare_sql_command, #prepare_sql_query, #quote, #recreate_class, #run_command, #schema

Class Method Details

.close_current_threadObject



129
130
131
# File 'lib/orientdb/database.rb', line 129

def self.close_current_thread
  Thread.current[:orientdb_connection] && Thread.current[:orientdb_connection].close
end

.connect(database_url, username, password) ⇒ Object



117
118
119
# File 'lib/orientdb/database.rb', line 117

def self.connect(database_url, username, password)
  new(database_url).open(username, password)
end

.connect_current_thread(database_url, username, password) ⇒ Object



125
126
127
# File 'lib/orientdb/database.rb', line 125

def self.connect_current_thread(database_url, username, password)
  Thread.current[:orientdb_connection] = connect database_url, username, password
end

.create(database_url) ⇒ Object



113
114
115
# File 'lib/orientdb/database.rb', line 113

def self.create(database_url)
  new(database_url).create
end

.current_thread_connectionObject



121
122
123
# File 'lib/orientdb/database.rb', line 121

def self.current_thread_connection
  Thread.current[:orientdb_connection]
end