You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We already have the OCommandScript class that execute a script at the server side. Now we could use this feature to specify "SQL" as scripting language with few, simple and powerful features taken from issue #2056.
If you execute a OCommandScript request passing SQL as language, all the SQL is supported and these commands more:
begin -> begins a transaction
rollback -> rollbacks an active transaction
commit -> commits an active transaction
let = -> executes a command and assign it in the context as . That variable can be used in further commands by prefixing it with $
return -> returns the variable result instead of last command result
Example:
database.open("admin", "admin");
Stringcmd = "";
cmd += "begin";
cmd += "\nlet a = create vertex set script = true";
cmd += "\nlet b = select from v limit 1";
cmd += "\ncreate edge from $a to $b retry 100";
cmd += "\ncommit";
cmd += "\nreturn $a";
Objectresult = database.command(newOCommandScript("sql", cmd)).execute();
This is very useful to manipulate the graph at the server side with just one network call.
The text was updated successfully, but these errors were encountered:
We already have the OCommandScript class that execute a script at the server side. Now we could use this feature to specify "SQL" as scripting language with few, simple and powerful features taken from issue #2056.
If you execute a OCommandScript request passing SQL as language, all the SQL is supported and these commands more:
Example:
This is very useful to manipulate the graph at the server side with just one network call.
The text was updated successfully, but these errors were encountered: