doctrine / orientdb-odm

A set of PHP libraries in order to use OrientDB from PHP
http://odino.org/blog/categories/orientdb/
MIT License
155 stars 54 forks source link

Add export command to the binding and the query builder #110

Open odino opened 12 years ago

odino commented 12 years ago

http://code.google.com/p/orient/wiki/OrientDB_REST?ts=1321037050&updated=OrientDB_REST#Export

nrk commented 11 years ago

I know this is part of the OrientDB's REST interface, but isn't dumping a database out of the scope of this library? A big-enough database would end up exhausting PHP's max allowed memory anyway, so dumps should be performed using more appropriate tools or a client that allows streaming HTTP responses instead of keeping them in memory.

odino commented 11 years ago

this would actually also be great in testing environments, and also, I think it should be straightforward, we just need to check that OrientDB returns the exported JSON, we dont even need to parse it or whatever

for sure its not a priority

nrk commented 11 years ago

The documentation says that OrientDB actually exports a gzip file as an iniline attachment that contains the JSON dump of the database and not the JSON payload itself, which adds a great deal of complexity for something of dubious usefulness in the vast majority of times, at least in the context of our library.

Probably a good compromise would be adding a method that returns only the URL string for dumping a database (e.g. $httpbinding->getExportURL($database)) so that users can perform the actual export and treat the resulting file however they like.

odino commented 11 years ago

Is it possible? I dont think it supports it

nrk commented 11 years ago

Uh? It'd be just an utility method. We build the URL (http://<username>:<password>@<server>:[<port>]/export/<database>) and return it from the method. Or were you referring to something else?

odino commented 11 years ago

Oh yes actually we can embed the credentials directly there... +20 for this! On Dec 30, 2012 2:38 PM, "Daniele Alessandri" notifications@github.com wrote:

Uh? It'd be just an utility method. We build the URL (http://

:@:[]/export/) and return it from the method. Or were you referring to something else? — Reply to this email directly or view it on GitHubhttps://github.com/doctrine/orientdb-odm/issues/110#issuecomment-11763330.