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