Skip to content

Commit

Permalink
feat(cql) implement [bytes map] unmarshaller
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaultcha committed Oct 1, 2018
1 parent 664422d commit aab0927
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion lib/cassandra/cql.lua
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,19 @@ do
return {fields = fields}
end

local function unmarsh_bytes_map(buffer)
local n = buffer:read_short()

local fields = {}
for _ = 1, n do
local key = buffer:read_string()
local value = buffer:read_bytes()
fields[key] = value
end

return fields
end

do
local marshallers = {
byte = {marsh_byte, unmarsh_byte},
Expand All @@ -500,7 +513,8 @@ do
string_list = {marsh_string_list, unmarsh_string_list},
string_multimap = {marsh_string_multimap, unmarsh_string_multimap},
udt_type = {nil, unmarsh_udt_type},
tuple_type = {nil, unmarsh_tuple_type}
tuple_type = {nil, unmarsh_tuple_type},
bytes_map = {nil, unmarsh_bytes_map}
}

for name, t in pairs(marshallers) do
Expand Down

0 comments on commit aab0927

Please sign in to comment.