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
The gRPC client (`RemoteGrpcDatabase`) ignores the `language` parameter for query operations. Only `command()` correctly propagates the language. This prevents using Cypher, Gremlin, or any non-SQL language through the gRPC query and streaming query paths.
6
+
7
+
The bug spans three layers:
8
+
9
+
1.**Proto**: `ExecuteQueryRequest` is missing a `language` field entirely
10
+
2.**Client**: `query()` can't pass language (proto missing it); `queryStream()` and `streamQuery()` never call `.setLanguage()` despite the proto supporting it
11
+
3.**Server**: `executeQuery()` hardcodes `db.query("sql", ...)`; all three `streamQuery` modes (`streamCursor`, `streamMaterialized`, `streamPaged`) hardcode `db.query("sql", ...)`
12
+
13
+
## Design Decisions
14
+
15
+
- Add a `language` field to `ExecuteQueryRequest` (additive, backward-compatible)
16
+
- Keep using `db.query(language, ...)` on the server for the Query RPC (caller chose read-only)
17
+
- Default to `"sql"` when the language field is empty/unset (backward-compatible)
18
+
19
+
## Changes
20
+
21
+
### 1. Proto (`grpc/src/main/proto/arcadedb-server.proto`)
22
+
23
+
Add `string language = 9;` to `ExecuteQueryRequest`:
24
+
25
+
```protobuf
26
+
message ExecuteQueryRequest {
27
+
string database = 1;
28
+
string query = 2;
29
+
map<string, GrpcValue> parameters = 3;
30
+
DatabaseCredentials credentials = 4;
31
+
TransactionContext transaction = 5;
32
+
int32 limit = 6;
33
+
int32 timeout_ms = 7;
34
+
ProjectionSettings projectionSettings = 8;
35
+
string language = 9; // "sql" if empty (default)
36
+
}
37
+
```
38
+
39
+
### 2. Server (`grpcw/.../ArcadeDbGrpcService.java`)
40
+
41
+
**`executeQuery()`**: Replace hardcoded `"sql"` with language from request, defaulting to `"sql"` when empty.
42
+
43
+
**`streamQuery()`**: Extract language from `StreamQueryRequest.getLanguage()` (proto field 7, already exists), resolve default, and pass to `streamCursor`/`streamMaterialized`/`streamPaged`. Each mode method gains a `String language` parameter.
0 commit comments