Skip to content

Commit 419e591

Browse files
committed
feat: patch-bolt support in Bolt version 4.4
To solve the protocol violation issue. The neo4j-omni always serializes `DateTime` to the modern structure defined in Bolt 5.0. The Bolt 4.x version cannot unpack it. However, the Bolt 4.4 version may unpack the Bolt 5.0 `DateTime` with a "utc" `patch-bolt`. I just try to use this to solve the problem at least in Bolt 4.4.
1 parent 0528031 commit 419e591

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

lib/src/connection.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,6 +1232,19 @@ int initialize(neo4j_connection_t *connection)
12321232
req->argv = req->_argv;
12331233
req->argc = 2;
12341234
}
1235+
else if (connection->version == 4 && connection->minor_version == 4)
1236+
{
1237+
neo4j_value_t patch_bolt[1] = {neo4j_string("utc")};
1238+
neo4j_map_entry_t auth_token[5] =
1239+
{ neo4j_map_entry("user_agent", neo4j_string(config->client_id)),
1240+
neo4j_map_entry("scheme", neo4j_string("basic")),
1241+
neo4j_map_entry("principal", neo4j_string(config->username)),
1242+
neo4j_map_entry("credentials", neo4j_string(config->password)),
1243+
neo4j_map_entry("patch_bolt", neo4j_list(patch_bolt, 1)) };
1244+
req->_argv[0] = neo4j_map(auth_token, 5);
1245+
req->argv = req->_argv;
1246+
req->argc = 1;
1247+
}
12351248
else
12361249
{
12371250
neo4j_map_entry_t auth_token[4] =

0 commit comments

Comments
 (0)