-
Notifications
You must be signed in to change notification settings - Fork 19
Sample Database
veny edited this page Sep 3, 2013
·
10 revisions
client = Orientdb4r.client
client.connect :database => 'temp', :user => 'admin', :password => 'admin'
# use the same user as for 'connect' and DB type 'memory'
client.create_database :database => 'NewDB'
# or define a specific user
client.create_database :database => 'NewDB', :user => 'root', :password => 'root', :storage => :local, :type => :documentclient.list_databases
=> ["perf", "smevente", "temp", ...]
# additional authentication to the server with a user that has rights to 'server.listDatabases' resource
client.list_databases :user => 'root', :password => 'root'
=> ["perf", "smevente", "temp", ...]# use the same user as for 'connect'
client.delete_database :database => 'NewDB'
# or define a specific user
client.delete_database :database => 'NewDB', :user => 'root', :password => 'root'# export connected database:
client.export
# or define a file path
client.export :file => "#{Dir.tmpdir}/myFilename.gz"
# or a non-connected DB
client.export :database => 'temp', :user => 'admin', :password => 'admin'