╭ changed ────╮ │src/event.zig│ ╰─────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────╮ │← previous│ ╰──────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │354 }, │ │408 - .bool => @field(value, field.name) = try readBool(DB, hash_kind, map, field.name),│ │355 + .bool => @field(event, field.name) = try readBool(DB, hash_kind, map, field.name),│ │356 else => @compileError("unsupported read field type: " ++ @typeName(field.type)), │ │357 } │ │358 } │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────╮ │360 else => @compileError("read expects a struct"),│ │361 } │ │362 │ │416 - return value; │ │363 + return event; │ │364 } │ │365 │ │366 fn readBytes( │ ╰────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────╮ │394 // writing to xitdb │ │395 // │ │396 │ │450 -fn upsert( │ │397 +pub fn upsert( │ │398 comptime T: type, │ │399 comptime DB: type, │ │400 comptime hash_kind: hash.HashKind,│ ╰───────────────────────────────────────────╯ ╭──────────────────────────────────────────╮ │401 map: DB.HashMap(.read_write), │ │455 - data: T, │ │402 + event: T, │ │403 ) !void { │ │404 switch (@typeInfo(T)) { │ │405 .@"struct" => |struct_info| {│ ╰──────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │406 inline for (struct_info.fields) |field| { │ │460 - try upsertField(DB, hash_kind, map, field.name, field.type, @field(data, field.name)); │ │407 + try upsertField(DB, hash_kind, map, field.name, field.type, @field(event, field.name));│ │408 } │ │409 }, │ │410 else => @compileError("upsert expects a struct"), │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────╯