[
https://issues.apache.org/jira/browse/TINKERPOP-3095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18128892#comment-18128892
]
ASF GitHub Bot commented on TINKERPOP-3095:
-------------------------------------------
Iryna-Kahamlyk opened a new pull request, #3727:
URL: https://github.com/apache/tinkerpop/pull/3727
JIRA: https://issues.apache.org/jira/browse/TINKERPOP-3095
**Summary**
Traversal-based remote requests can now choose the server script engine, as
string queries already could via `RequestOptions`. This works in Java, Python,
.NET, Go and JavaScript, in two ways:
- **Per traversal source:** `g.with("language", "gremlin-lang")`
- **Per connection:** a default for every traversal on a
`DriverRemoteConnection`
- Java: `DriverRemoteConnection.using(cluster, "g", "gremlin-lang")`
- Python: `language='gremlin-lang'`
- .NET: `language: "gremlin-lang"`
- Go: `settings.RequestLanguage`
- JavaScript: `{ language: 'gremlin-lang' }`
A value set with `with()` overrides the connection default. If neither is
set, nothing changes: .NET, Go and JavaScript still send `gremlin-lang`, and
Java and Python let the server choose.
**Bug fix:** `gremlin-go` and `gremlin-javascript` silently dropped
`with("language", ...)` from remote traversals because their option allow-lists
omitted it. It is now sent.
> Provide a path for selecting script engine for traversals in TP4
> ----------------------------------------------------------------
>
> Key: TINKERPOP-3095
> URL: https://issues.apache.org/jira/browse/TINKERPOP-3095
> Project: TinkerPop
> Issue Type: Improvement
> Components: driver
> Affects Versions: 4.0.0
> Reporter: Valentyn Kahamlyk
> Priority: Critical
>
> For string queries there is now a simple way to select script engine which
> the query will be executed
> {code:java}
> final RequestOptions ro =
> RequestOptions.build().language("gremlin-lang").create();
> final List result = client.submit("g.inject(1)", ro).toList();{code}
> We need to do the same thing for traversal based requests, Something like
> {code:java}
> final GraphTraversalSource g =
> traversal().with(DriverRemoteConnection.using(cluster)).with("language",
> "gremlin-lang");
> final List result = g.inject(1).toList());{code}
> *or*
> {code:java}
> final GraphTraversalSource g =
> traversal().with(DriverRemoteConnection.using(cluster, "g", "gremlin-lang));
> final List result = g.inject(1).toList());{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)