╭ changed ────╮ │src/event.zig│ ╰─────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │130 const old_moment_cursor = try haxy_moments.getCursor(hash.bytesToInt(hash_kind, parent_oid)) orelse return error.CursorNotFound; │ │131 const old_moment = try DB.HashMap(.read_only).init(old_moment_cursor); │ │132 │ │133 - const old_moment_index_cursor = try old_moment.getCursor(hash.hashInt(hash_kind, "index")) orelse return error.CursorNotFound; │ │133 + const old_moment_index_cursor = try old_moment.getCursor(hash.hashInt(hash_kind, "moment-index")) orelse return error.CursorNotFound;│ │134 const old_moment_index = try old_moment_index_cursor.readUint(); │ │135 │ │136 // resize the haxy list so we truncate all the moments that were │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │183 // associate this moment with the index it will first appear at in the haxy list. │ │184 // this will be important later so we can truncate that list if the user ever │ │185 // rebases starting at this object id. │ │186 - try haxy_moment.put(hash.hashInt(hash_kind, "index"), .{ .uint = try haxy.count() - 1 }); │ │186 + try haxy_moment.put(hash.hashInt(hash_kind, "moment-index"), .{ .uint = try haxy.count() - 1 });│ │187 │ │188 // consume the event into the views map │ │189 { │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │192 // get the id of the current event as bytes │ │193 var current_event_id: [event_id_size]u8 = undefined; │ │194 _ = try std.fmt.hexToBytes(&current_event_id, &event.id); │ │195 - │ │196 - // create a new views map for the current event we are consuming │ │197 - const views_cursor = try haxy_moment.putCursor(hash.hashInt(hash_kind, "views"));│ │198 - const views = try DB.HashMap(.read_write).init(views_cursor); │ │195 │ │196 switch (event.data) { │ │197 .issue => |data| { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │202 - const event_id_to_issue_cursor = try views.putCursor(hash.hashInt(hash_kind, "event-id->issue")); │ │198 + const event_id_to_issue_cursor = try haxy_moment.putCursor(hash.hashInt(hash_kind, "event-id->issue"));│ │199 const event_id_to_issue = try DB.HashMap(.read_write).init(event_id_to_issue_cursor); │ │200 │ │201 const issue_cursor = try event_id_to_issue.putCursor(hash.hashInt(hash_kind, &current_event_id)); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────╮ │src/test/event.zig│ ╰──────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │202 const haxy_moment_cursor = try haxy_moments.getCursor(hash.bytesToInt(repo_opts.hash, &last_object_id)) orelse return error.NotFound; │ │203 const haxy_moment = try Repo.DB.HashMap(.read_only).init(haxy_moment_cursor); │ │204 │ │205 - // get the views │ │206 - const views_cursor = try haxy_moment.getCursor(hash.hashInt(repo_opts.hash, "views")) orelse return error.NotFound; │ │207 - const views = try Repo.DB.HashMap(.read_only).init(views_cursor); │ │208 - │ │205 // get the map of issues │ │210 - const event_id_to_issue_cursor = try views.getCursor(hash.hashInt(repo_opts.hash, "event-id->issue")) orelse return error.NotFound; │ │206 + const event_id_to_issue_cursor = try haxy_moment.getCursor(hash.hashInt(repo_opts.hash, "event-id->issue")) orelse return error.NotFound;│ │207 const event_id_to_issue = try Repo.DB.HashMap(.read_only).init(event_id_to_issue_cursor); │ │208 │ │209 // get the issue out of the map that was edited │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │304 │ │305 const haxy_moment_cursor = try haxy_moments.getCursor(hash.bytesToInt(repo_opts.hash, &last_object_id)) orelse return error.NotFound; │ │306 const haxy_moment = try Repo.DB.HashMap(.read_only).init(haxy_moment_cursor); │ │311 - │ │312 - // get the views │ │313 - const views_cursor = try haxy_moment.getCursor(hash.hashInt(repo_opts.hash, "views")) orelse return error.NotFound; │ │314 - const views = try Repo.DB.HashMap(.read_only).init(views_cursor); │ │307 │ │308 // get the map of issues │ │317 - const event_id_to_issue_cursor = try views.getCursor(hash.hashInt(repo_opts.hash, "event-id->issue")) orelse return error.NotFound; │ │309 + const event_id_to_issue_cursor = try haxy_moment.getCursor(hash.hashInt(repo_opts.hash, "event-id->issue")) orelse return error.NotFound;│ │310 const event_id_to_issue = try Repo.DB.HashMap(.read_only).init(event_id_to_issue_cursor); │ │311 │ │312 // get the issue out of the map that was edited │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │403 const haxy_moment_cursor = try haxy_moments.getCursor(hash.bytesToInt(repo_opts.hash, &last_object_id)) orelse return error.NotFound; │ │404 const haxy_moment = try Repo.DB.HashMap(.read_only).init(haxy_moment_cursor); │ │405 │ │414 - // get the views │ │415 - const views_cursor = try haxy_moment.getCursor(hash.hashInt(repo_opts.hash, "views")) orelse return error.NotFound; │ │416 - const views = try Repo.DB.HashMap(.read_only).init(views_cursor); │ │417 - │ │406 // get the map of issues │ │419 - const event_id_to_issue_cursor = try views.getCursor(hash.hashInt(repo_opts.hash, "event-id->issue")) orelse return error.NotFound; │ │407 + const event_id_to_issue_cursor = try haxy_moment.getCursor(hash.hashInt(repo_opts.hash, "event-id->issue")) orelse return error.NotFound;│ │408 const event_id_to_issue = try Repo.DB.HashMap(.read_only).init(event_id_to_issue_cursor); │ │409 │ │410 // the first issue no longer exists │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯