The server and the client communicate over TCP using a simple framed protocol with JSON responses.
Implementation: src/main/java/ru/open/cu/student/protocol/FramedProtocol.java
Message layout:
┌────────────┬─────────────────────────┐
│ Length (4B)│ Payload (UTF-8 bytes) │
└────────────┴─────────────────────────┘
Length is the payload size in bytes (big-endian). Payload is a UTF-8 string.
Request payload: the SQL string.
Response payload: JSON.
{
"ok": true,
"columns": ["id", "name"],
"rows": [[1, "Alice"], [2, "Bob"]]
}{
"ok": false,
"errorStage": "PARSER",
"errorMessage": "Expected SELECT, CREATE or INSERT"
}errorStage corresponds to the pipeline stage (see PIPELINE.md).
The CLI can render:
- “pretty” tables (human-readable)
- raw JSON responses (useful for protocol debugging)
Run details: DEVELOPMENT.md.