appscot / sails-orientdb

OrientDB adapter for Waterline / Sails.js ORM
MIT License
25 stars 23 forks source link

Improve .destroy() by using `RETURN <returning>` #39

Open dmarcelino opened 9 years ago

dmarcelino commented 9 years ago

Currently .destroy() is doing a SELECT query to provide the results of the DELETE EDGE/VERTEX query, which is not ideal. Once orientechnologies/orientdb#3595 is complete and released (OrientDB v2.1) change this behaviour to use the RETURN <returning> and perform only 1 operation instead of 2.

p1lare commented 8 years ago

I'm also having issues with destroy when trying REST API, when running http://localhost:1337/user/destoy/12:7 SQL statement runs:

DELETE VERTEX WHERE @rid in [#12:7] Encountered " "WHERE "" at line 1, column 15.

which is not accepted by OrientDB 2.1, it would accept: DELETE VERTEX #12:7

dmarcelino commented 8 years ago

Hi @p1lare, a couple of things: Oriento/OrientJS do not fully support the REST API, check orientechnologies/orientjs#28 and sails-orientdb does not support OrientDB v2.1, check #52.