Is this possible to replace waterline-orientdb adapter with sails-orientdb adapter?

247 Views Asked by At

I am trying to replace waterline-orientdb with sails-orientdb adapter but on the top I want to use waterline still, as there are issues with waterline-orientdb adapter regarding edges of orientdb so is this possible to use sails-orientdb adapter under waterline? I just want to know can i replace waterline-orientdb with sails-orientdb?

1

There are 1 best solutions below

2
On

Zeeshan, I'm the developer of waterline-orientdb and I'm not aware of the issue with edges you mention. Can you please raise an issue in https://github.com/appscot/waterline-orientdb and give a few more details? I'll gladly look into it.

Regarding your specific question, you should be able to switch to sails-orientdb but your configuration, models and schema may need adjustments.

Config

sails-orientdb uses:

database: {
  name: 'dataBaseName'
},

while waterline-orientdb uses:

database: 'dataBaseName'

models / schema

Associations

waterline-orientdb converts Many-to-many through associations (see also balderdashy/waterline#705) into edges but regular Many-to-many associations will use a join table (waterline default behaviour). This will be changed in the future, but not supported yet.

Currently I'm not 100% sure how sails-orientdb handles associations.

id

In waterline-orientdb an id attribute will be automatically created and replaced by @rid. sails-orientdb does not do this so you may need to adjust your models accordingly.

EDIT: regular Many-to-many associations will use a join table (waterline default behaviour) -> This is no longer true, since v0.10.40 waterline-orientdb will use edges for all kinds of many-to-many associations.

UPDATE: former sails-orientdb and waterline-orientdb have converged into sails-orientdb. The new adapter is maintained by the developers of the previous adapters.