╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Fork.zig ─────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
94 95 fn removeFromParentSet( 96 comptime DB: type, 97 comptime hash_kind: hash.HashKind, 98 index: DB.HashMap(.read_write), 99 parent_id: *const [evt.event_id_size]u8, 100 order_key: *const [@sizeOf(u64) + evt.event_id_size]u8, 101 ) !void { 102 const cursor = try index.putCursor(hash.hashInt(hash_kind, parent_id)); 103 const ids = try DB.SortedSet(.read_write).init(cursor); 104 _ = try ids.remove(order_key); 105 } 106 107 pub fn readById( 108 comptime DB: type, 109 comptime hash_kind: hash.HashKind, 110 haxy_moment: DB.HashMap(.read_only), 111 arena: *std.heap.ArenaAllocator, 112 fork_id: []const u8, 113 ) !?Record { 114 const records_cursor = try haxy_moment.getCursor(hash.hashInt(hash_kind, record_map_key)) orelse return null; 115 const records = try DB.HashMap(.read_only).init(records_cursor); 116 const fork_cursor = try records.getCursor(hash.hashInt(hash_kind, fork_id)) orelse return null; 117 return try evt.read(Record, DB, hash_kind, arena, try DB.HashMap(.read_only).init(fork_cursor)); 118 } 119