2

Is there any "dummy" query in Gremlin language in order to test the connection to the server?

E.g. in Sql Alchemy case I would use the following https://docs.sqlalchemy.org/en/13/core/pooling.html#custom-legacy-pessimistic-ping

which basically runs a SELECT 1 to check the connection health.

Sanandrea
  • 2,112
  • 1
  • 27
  • 45

1 Answers1

3

For a script based request you could simply send 0 which will return "0". If your graph doesn't support arbitrary scripts or you're using bytecode based requests and need to send a Gremlin oriented request you could do g.inject(0) which would also return "0".

stephen mallette
  • 45,298
  • 5
  • 67
  • 135
  • 2
    Just a callout, if you are specifically using Amazon Neptune (appears so, from the tags on the question), then g.inject(0) is the option for you. Arbitrary math like "0" is not supported against Neptune, but it is a valid request as per TP/Gremlin spec. – The-Big-K Dec 18 '19 at 20:16
  • If you are using Neptune you can just use a ā€˜g’ to see if the connection is working from the Gremlin console. You can also test the Neptune endpoint using a curl command to the /status endpoint. – Kelvin Lawrence Dec 19 '19 at 03:47