In many of the previous Waterline databases that I've hacked around with, you could create a Waterline/Sails model using the "generic" syntax specified by Waterline/Sails and things would just work. When I started using OrientDB and Waterline-OrientDB there appears to be an issue whereby I have to define my full schema in OrientDB before I am able to persist anything. Is this a requirement for using Waterline-OrientDB or is there something not configured properly about my OrientDB setup which is forcing the schema to be defined first.
If the creation is necessary, how should one model the edges in the OrientDB database and in SailsJS to ensure that the Sails/Waterline ORM will be able to persist properly. I assumed that it would "just work", but throughout the waterline-orientdb documentation are references to calls for creating edges and such. That seems to be a crucial feature from the documentation - what do you HAVE to define, and what can you get away with not defining for SailsJS model objects.
No waterline model definition or config have been provided, so it's hard to pinpoint what the exact issue is. One possible cause is that
migrate
is set to'safe'
in the config. waterline-orientdb follows the migratable interface and as such it will only create classes whenmigrate: 'drop'
ormigrate: 'alter'
(waterline deems this as experimental) ormigrate: 'create'
(in waterline master branch, not released yet). More about setting the migrate options on Sails.js docs - model settings.Regarding the second paragraph, waterline-orientdb complies 100% to the waterline specification and it passes all API integration tests for Waterline adapters (results). Edges are modelled as normal waterline many-to-many associations. The waterline-orientdb documentation follows the example of other adapters as it mostly documents things that are particular to waterline-orientdb, namely extensions made. In other words waterline-orientdb can be used just like any other adapter and these extensions are just to help with specific OrientDB operations.
Let me know if this doesn't fix your issue and feel free to provide examples, I'll look into them.