Hi Adam, I think this is very interesting, especially for our JS Functions. Would you like to contribute with a PR?
By the way, have you found a way to protect the user to call things like System.exit()? Best Regards, Luca Garulli Founder & CEO OrientDB LTD <http://orientdb.com/> On 12 September 2017 at 03:12, <[email protected]> wrote: > Hi, > > My day job is mostly server-side JS using Nashorn. > > I noticed that there are native wrappers for groovy/scala but there does > not seem to be a native wrapper for Nashorn, So, I started working on one > for my own purposes. Do you think this is something the larger community > would be interested in? > > The goal is a light JS/Nashorn wrapper with a streamlined API suitable for > scripting environments and server-side script. No extra jars are > necessary, just include a single JS script the top of your nashorn file. > Here is an example script: > > load("OrientDB_Doc.js"); > odb = new ODB(); > > // opens a DB pool > odb.openDB("plocal:/orientDB/databases/myTest", "admin", "admin"); > odb.execute("insert into Person (name, age) VALUES ('George Washington', > 67)"); > > // returns native JS code > r = odb.select("select * from Person"); > r.forEach(function (obj) { > println(obj.name + " " + obj.age); > }); > odb.closePool(); > > > The benefit of using a script like this is the user does not need to worry > themselves with the complicated Types that OrientDB has (IMHO). And the > functions (by default, but optionally) return native JS objects instead of > ODocuments, which is eaiser to deal with in Nashorn. > > The Doc API is almost done, and later I can make the graph API. Let me > know if this is something that the community might want... or perhaps it is > already done I just did not see it. > > Best, > > -Adam > > -- > > --- > You received this message because you are subscribed to the Google Groups > "OrientDB" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- --- You received this message because you are subscribed to the Google Groups "OrientDB" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
