╭ changed ────╮ │src/event.zig│ ╰─────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │482 } │ │483 }, │ │484 .bool => @field(event, field.name) = try readBool(DB, hash_kind, map, field.name), │ │485 + .int => |int_info| switch (int_info.signedness) { │ │486 + .unsigned => @field(event, field.name) = @intCast(try readUint(DB, hash_kind, map, field.name)),│ │487 + .signed => @field(event, field.name) = @intCast(try readInt(DB, hash_kind, map, field.name)), │ │488 + }, │ │489 else => @compileError("unsupported read field type: " ++ @typeName(field.type)), │ │490 } │ │491 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │505 ) ![]const u8 { │ │506 const cursor = try map.getCursor(hash.hashInt(hash_kind, field_name)) orelse return error.NotFound;│ │507 return try cursor.readBytesAlloc(allocator, null); │ │508 +} │ │509 + │ │510 +fn readUint( │ │511 + comptime DB: type, │ │512 + comptime hash_kind: hash.HashKind, │ │513 + map: DB.HashMap(.read_only), │ │514 + field_name: []const u8, │ │515 +) !u64 { │ │516 + const cursor = try map.getCursor(hash.hashInt(hash_kind, field_name)) orelse return error.NotFound;│ │517 + return try cursor.readUint(); │ │518 +} │ │519 + │ │520 +fn readInt( │ │521 + comptime DB: type, │ │522 + comptime hash_kind: hash.HashKind, │ │523 + map: DB.HashMap(.read_only), │ │524 + field_name: []const u8, │ │525 +) !i64 { │ │526 + const cursor = try map.getCursor(hash.hashInt(hash_kind, field_name)) orelse return error.NotFound;│ │527 + return try cursor.readInt(); │ │528 } │ │529 │ │530 fn readBool( │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────╯