module OrientdbBinary::DatabaseOperations::BaseOperations

Public Instance Methods

close() click to toggle source

Close databse connection No params are accepted Usage: db.close()

Calls superclass method
# File lib/orientdb_binary/database_operations/base_operations.rb, line 44
def close
  OrientdbBinary::Protocols::DbClose.new(params).process(socket)
  super
end
open(args) click to toggle source

Open database connection. Params: db: string -> database name user: username for accessing database password: user’s pasword for database access storage: string -> memory, local, plocal; plocal is used by default Usage: db = OrientdbBinary::Database.open(db: “test”, storage: ‘plocal’, user: ‘admin’, password: ‘admin’)

# File lib/orientdb_binary/database_operations/base_operations.rb, line 20
def open(args)
  @db_params = {
    db: args[:db],
    storage: args[:storage]
  }

  defaults = {
    storage: 'plocal'
  }


  connection = OrientdbBinary::Protocols::DbOpen.new(defaults.merge(args)).process(socket)

  @session = connection[:session]
  @connected = true if @session >= 0
  @clusters = connection[:clusters]
  connection
end
reload() click to toggle source

Reload database. Information about clusters are updated No params are accepted Usage db.reload()

# File lib/orientdb_binary/database_operations/base_operations.rb, line 54
def reload
  answer = OrientdbBinary::Protocols::DbReload.new(params).process(socket)
  @clusters = answer[:clusters]
  answer
end
size() click to toggle source

Return size of the database No params are accepted Usage: db.size()

# File lib/orientdb_binary/database_operations/base_operations.rb, line 65
def size
  OrientdbBinary::Protocols::DbSize.new(params).process(socket)
end