Description
The gRPC client RemoteGrpcDatabase ignores the language parameter for query operations. Only command() correctly propagates the language to the server. This prevents using Cypher, Gremlin, OpenCypher, or any non-SQL language through the gRPC query() and queryStream() paths.
Root Cause
The bug spans three layers:
- Proto:
ExecuteQueryRequest is missing a language field entirely, while ExecuteCommandRequest and StreamQueryRequest both have one.
- Client (
RemoteGrpcDatabase.java): query() cannot pass language since the proto lacks the field. queryStream() never calls .setLanguage() on StreamQueryRequest despite the proto supporting it (field 7).
- Server (
ArcadeDbGrpcService.java): executeQuery() hardcodes db.query("sql", ...). All three streamQuery modes (streamCursor, streamMaterialized, streamPaged) also hardcode "sql".
Steps to Reproduce
RemoteGrpcDatabase db = ...;
// This silently runs as SQL, ignoring "opencypher"
ResultSet rs = db.query("opencypher", "MATCH (n) RETURN n LIMIT 10");
Expected Behavior
The query should be executed using the specified language (OpenCypher in this example).
Actual Behavior
The language parameter is silently ignored and the query is always executed as SQL, which either fails or produces wrong results.
Fix
- Add
string language = 9; to ExecuteQueryRequest in the proto (additive, backward-compatible)
- Wire the language parameter through on the client side for
query(), queryStream(), and streamQuery()
- Use the language field on the server side in
executeQuery() and all streamQuery modes, defaulting to "sql" when empty
Description
The gRPC client
RemoteGrpcDatabaseignores thelanguageparameter for query operations. Onlycommand()correctly propagates the language to the server. This prevents using Cypher, Gremlin, OpenCypher, or any non-SQL language through the gRPCquery()andqueryStream()paths.Root Cause
The bug spans three layers:
ExecuteQueryRequestis missing alanguagefield entirely, whileExecuteCommandRequestandStreamQueryRequestboth have one.RemoteGrpcDatabase.java):query()cannot pass language since the proto lacks the field.queryStream()never calls.setLanguage()onStreamQueryRequestdespite the proto supporting it (field 7).ArcadeDbGrpcService.java):executeQuery()hardcodesdb.query("sql", ...). All threestreamQuerymodes (streamCursor,streamMaterialized,streamPaged) also hardcode"sql".Steps to Reproduce
Expected Behavior
The query should be executed using the specified language (OpenCypher in this example).
Actual Behavior
The
languageparameter is silently ignored and the query is always executed as SQL, which either fails or produces wrong results.Fix
string language = 9;toExecuteQueryRequestin the proto (additive, backward-compatible)query(),queryStream(), andstreamQuery()executeQuery()and allstreamQuerymodes, defaulting to"sql"when empty