Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Positional and named parameters for batch Rest API #6325

Closed
mcaramma opened this issue Jun 20, 2016 · 2 comments
Closed

Positional and named parameters for batch Rest API #6325

mcaramma opened this issue Jun 20, 2016 · 2 comments
Assignees
Milestone

Comments

@mcaramma
Copy link

I think it would be very useful to have positional and named parameters available in batch script REST API.

Something like:

{ "transaction" : true,
  "operations" : [
    {
      "type" : "script",
      "language" : "sql",
      "script" : [ "LET account = CREATE VERTEX Account SET name = ?",
                   "LET city = SELECT FROM City WHERE name = ?",
                   "CREATE EDGE Lives FROM $account TO $city RETRY 100" ],
      "parameters": ["Luke", "London"]
    }
  ]
}

and

{ "transaction" : true,
  "operations" : [
    {
      "type" : "script",
      "language" : "sql",
      "script" : [ "LET account = CREATE VERTEX Account SET name = :account",
                   "LET city = SELECT FROM City WHERE name = :city",
                   "CREATE EDGE Lives FROM $account TO $city RETRY 100" ],
      "parameters": {
         "account": "Luke",
         "city": "London"
      }
    }
  ]
}
@lvca
Copy link
Member

lvca commented Aug 5, 2017

+1

@lvca lvca modified the milestones: 3.1, 2.2.x (next hotfix) Aug 5, 2017
@lpil
Copy link

lpil commented May 1, 2018

This would be super useful. Is the only way to do this currently to use string interpolation on the client side? I'm concerned about SQL injection attacks.

@laa laa closed this as completed Aug 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

5 participants