╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ event.zig ────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭ find file ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ ╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ │ │ │http│ ssh │ │ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯
1055 id: *const [evt.event_id_size]u8, 1056 comptime field_name: []const u8, 1057 ) ![hash.byteLen(hash_kind)]u8 { 1058 const id_to_field_to_oid_cursor = try haxy_moment.getCursor(hash.hashInt(hash_kind, evt.Issue.id_to_field_to_oid_key)) orelse return error.NotFound; 1059 const id_to_field_to_oid = try DB.HashMap(.read_only).init(id_to_field_to_oid_cursor); 1060 const field_oids_cursor = try id_to_field_to_oid.getCursor(hash.hashInt(hash_kind, id)) orelse return error.NotFound; 1061 const field_oids = try DB.SortedMap(.read_only).init(field_oids_cursor); 1062 const cursor = try field_oids.getCursor(field_name) orelse return error.NotFound; 1063 var oid: [hash.byteLen(hash_kind)]u8 = undefined; 1064 _ = try cursor.readBytes(&oid); 1065 return oid; 1066 } 1067 1068 // the issue `id` names, read out of `event-id->issue` 1069 fn readIssue( 1070 comptime DB: type, 1071 comptime hash_kind: hash.HashKind, 1072 haxy_moment: DB.HashMap(.read_only), 1073 arena: *std.heap.ArenaAllocator, 1074 id: *const [evt.event_id_size]u8, 1075 ) !evt.Issue.Record { 1076 const event_id_to_issue_cursor = try haxy_moment.getCursor(hash.hashInt(hash_kind, "event-id->issue")) orelse return error.NotFound; 1077 const event_id_to_issue = try DB.HashMap(.read_only).init(event_id_to_issue_cursor); 1078 const issue_cursor = try event_id_to_issue.getCursor(hash.hashInt(hash_kind, id)) orelse return error.NotFound; 1079 const issue_map = try DB.HashMap(.read_only).init(issue_cursor); 1080 return try evt.read(evt.Issue.Record, DB, hash_kind, arena, issue_map); 1081 } 1082