╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Discussion.zig ───────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭ find file ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ ╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ │ │ │http│ ssh │ │ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯
211 id: *const [evt.event_id_size]u8, 212 ) !?Record { 213 const DB = evt.EventDB(repo_opts.hash); 214 var event_db_maybe: ?evt.LocalEventDB(repo_opts.hash) = if (repo_kind == .git) try evt.LocalEventDB(repo_opts.hash).openReadOnly(io, allocator, repo.core.repo_dir) else null; 215 defer if (event_db_maybe) |*event_db| event_db.deinit(io, allocator); 216 const moment = (if (event_db_maybe) |*event_db| 217 evt.currentMomentFromDb(repo_opts.hash, event_db.db) 218 else if (repo_kind == .git) 219 return null 220 else 221 evt.currentMoment(repo_opts, repo)) catch return null; 222 const records_cursor = try moment.getCursor(hash.hashInt(repo_opts.hash, record_map_key)) orelse return null; 223 const records = try DB.HashMap(.read_only).init(records_cursor); 224 const record_cursor = try records.getCursor(hash.hashInt(repo_opts.hash, id)) orelse return null; 225 return try evt.read(Record, DB, repo_opts.hash, arena, try DB.HashMap(.read_only).init(record_cursor)); 226 } 227