Skip to content

phpnode/node-orientdb

Repository files navigation

Introduction

This is a node.js driver for OrientDB using the OrientDB binary protocol.

Installation

npm install orientdb 

As developer you should fork/clone this repo and once you have it on your machine, do the following in your repo directory:

npm install 

Versioning

In order to make it clearer what OrientDB version is supported we will the following versionning scheme: x.y.z, where x.y is the the OrientDB major and minor version.

For example:

  • when OrientDB releases version 1.3.0 we will start publishing versions 1.3.z
  • when OrientDB version 1.4.0 is out, we will start publishing 1.4.z versions

The z part of our version is our internal patch number for that OrientDB release. This will be used using the semantic versioning (semver) rules.

For example:

  • before an OrientDB release (say 1.5.0), we will use versions like 1.5.0-alpha1 or 1.5.0-beta1
  • by the time OrientDB releases version 1.5.1, we are probably further with the patch number z (say 1.5.3) due to bug correction, forgotten features, etc. To test OrientDB 1.5.1 we will start using versions like: 1.5.4-beta1, where our 1.5.4 version will correspond to the OrientDB release 1.5.1.

Is this clear? ;)

Tutorial

To start using OrientDB and nodejs, check out the "Blog Tutorial".

Status

This OrientDB driver is almost mature now, but we are still testing it. While we use it in production already and therefore it implements a sufficient number of features for making a fully featured application, we recommend you make some thorough tests before you do it as well. If you find any problems, let us know such that we can improve things. Until version 1.0 we also don't guarantee any backwards compatibility and API stability since we are trying things out. But 1.0 should not be far from now.

The following commands are not implemented yet (just pick one and send us a pull request):

  • RECORD_CHANGE_IDENTITY
  • RECORD_CLEAN_OUT
  • POSITIONS_FLOOR
  • POSITIONS_CEILING
  • PUSH_RECORD
  • PUSH_DISTRIB_CONFIG
  • DB_COPY
  • REPLICATION
  • CLUSTER

For a more complete list, check out the Driver Compatibility Matrix

Supported database versions

We test each release against the following OrientDB versions: 1.1.0, 1.3.0.

We've had to drop OrientDB 1.2.0 support because of this issue. If you're using 1.2.0, we strongly encourage you to evaluate 1.3.0.

Testing

An OrientDB Graph Edition server instance must be running. Use the test configuration files to provide data to the tests about the running instance (user, port, etc.).

Then run:

npm test

to run all the tests under test, or

node test/db_open_close.js

to run a specific test.

And make sure all run before you make a pull request.

NOTE: The test/z_shutdown.js will shutdown the server. So make sure it's the last one to run. (i.e. Don't add a test that is after this one in Lexicographical order.)

Connecting to a database

varorient=require("orientdb"),Db=orient.Db,Server=orient.Server;vardbConfig={user_name: "admin",user_password: "admin"};varserverConfig={host: "localhost",port: 2424};varserver=newServer(serverConfig);vardb=newDb("temp",server,dbConfig);db.open(function(err){if(err){console.log(err);return;}console.log("Database '"+db.databaseName+"' has "+db.clusters.length+" clusters");// use db.command(...) function to run OrientDB SQL queries});

Changes

See ChangeLog

Driver Compatibility Matrix

The following table list all the commands exposed by OrientDB. It's here to help you helping us: just pick one of the not yet implemented commands and send us a pull request.

Each command has a JS API if it's already supported, or a "not yet implemented" if not.

It also has a Yes/No/Not yet label under each supported OrientDB versions: commands may be implemented but may be available only with recent OrientDB.

CommandJS APIOrientDB 1.1.0OrientDB 1.3.0OrientDB 1.4.0
SHUTDOWNServer.shutdownYesYesYes
CONNECTServer.connectYesYesYes
DB_OPENDb.openYesYesYes
DB_CREATEDb.createYesYesYes
DB_CLOSEDb.closeYesYesYes
DB_EXISTDb.existYesYesYes
DB_DROPDb.dropYesYesYes
DB_SIZEDb.sizeYesYesYes
DB_COUNTRECORDSDb.countRecordsYesYesYes
DATACLUSTER_ADDDb.addDataClusterYesYesYes
DATACLUSTER_DROPDb.dropDataClusterYesYesYes
DATACLUSTER_COUNTDb.countDataClustersYesYesYes
DATACLUSTER_DATARANGEDb.rangeDataClustersYesYesYes
DATACLUSTER_LH_CLUSTER_IS_USEDDb.isLHClustersUsedNoYesYes
DATASEGMENT_ADDDb.addDataSegmentYesYesYes
DATASEGMENT_DROPDb.dropDataSegmentYesYesYes
RECORD_LOADDb.loadRecordYesYesYes
RECORD_CREATEDb.createRecordYesYesYes
RECORD_UPDATEDb.updateRecordYesYesYes
RECORD_DELETEDb.deleteRecordYesYesYes
RECORD_CHANGE_IDENTITYNot yet implementedNoNot yetNot yet
POSITIONS_HIGHERWork in progressNoYesNot yet
POSITIONS_LOWERWork in progressNoYesNot yet
RECORD_CLEAN_OUTNot yet implementedNoNot yetNot yet
POSITIONS_FLOORNot yet implementedNoNot yetNot yet
POSITIONS_CEILINGNot yet implementedNoNot yetNot yet
COUNTDb.countRecordsYesYesYes
COMMANDDb.commandYesYesYes
TX_COMMITDb.commitYesYesYes
CONFIG_GETServer.configGetYesYesYes
CONFIG_SETServer.configSetYesYesYes
CONFIG_LISTServer.configListYesNoYes
DB_RELOADDb.reloadYesYesYes
DB_LISTServer.listDatabasesYesYesYes
PUSH_RECORDNot yet implementedYesYesYes
PUSH_DISTRIB_CONFIGNot yet implementedYesYesYes
DB_COPYNot yet implementedYesYesYes
REPLICATIONNot yet implementedYesYesYes
CLUSTERNot yet implementedYesYesYes
DB_FREEZEWork in ProgressYesYesYes
DB_RELEASEWork in ProgressYesYesYes

About

This is a node.js driver for OrientDB.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript100.0%