From 5d0982f5dbe7768ae201288d2bce2557e11ebf33 Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Thu, 6 Mar 2025 09:29:19 +0200 Subject: [PATCH] core/mvcc: Add RowID::new() and Row::new() helpers --- core/mvcc/database/mod.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/mvcc/database/mod.rs b/core/mvcc/database/mod.rs index d811794e4..f0d80f8ad 100644 --- a/core/mvcc/database/mod.rs +++ b/core/mvcc/database/mod.rs @@ -17,6 +17,12 @@ pub struct RowID { pub row_id: u64, } +impl RowID { + pub fn new(table_id: u64, row_id: u64) -> Self { + Self { table_id, row_id } + } +} + #[derive(Clone, Debug, PartialEq, PartialOrd)] pub struct Row { @@ -24,6 +30,12 @@ pub struct Row { pub data: Vec, } +impl Row { + pub fn new(id: RowID, data: Vec) -> Self { + Self { id, data } + } +} + /// A row version. #[derive(Clone, Debug, PartialEq)] pub struct RowVersion {