╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Discussion.zig ───────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
211 const DB = evt.EventDB(repo_opts.hash); 212 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; 213 defer if (event_db_maybe) |*event_db| event_db.deinit(io, allocator); 214 const moment = (if (event_db_maybe) |*event_db| 215 evt.currentMomentFromDb(repo_opts.hash, event_db.db) 216 else if (repo_kind == .git) 217 return null 218 else 219 evt.currentMoment(repo_opts, repo)) catch return null; 220 const records_cursor = try moment.getCursor(hash.hashInt(repo_opts.hash, record_map_key)) orelse return null; 221 const records = try DB.HashMap(.read_only).init(records_cursor); 222 const record_cursor = try records.getCursor(hash.hashInt(repo_opts.hash, id)) orelse return null; 223 return try evt.read(Record, DB, repo_opts.hash, arena, try DB.HashMap(.read_only).init(record_cursor)); 224 } 225