From bea37e2834a5265035b960277ff27e5f8d74d079 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Fri, 21 Feb 2025 14:16:24 +0200 Subject: Start working in new schema logic to core --- log_db/benches/utils.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'log_db/benches') diff --git a/log_db/benches/utils.rs b/log_db/benches/utils.rs index 3a949ae..d25a5af 100644 --- a/log_db/benches/utils.rs +++ b/log_db/benches/utils.rs @@ -17,6 +17,22 @@ pub struct Inst { pub data: Vec, } +impl AsRef for Field { + fn as_ref(&self) -> &str { + match self { + Field::Id => "id", + Field::Name => "name", + Field::Data => "data", + } + } +} + +impl Into for Field { + fn into(self) -> String { + self.as_ref().to_string() + } +} + impl Inst { pub fn fields() -> Vec { vec![Field::Id, Field::Name, Field::Data] @@ -82,7 +98,7 @@ pub fn random_inst(from_id: i64, to_id: i64) -> Inst { } pub fn prefill_db( - db: &mut DB, + db: &mut DB, insts: &mut Vec, n_records: usize, compact: bool, -- cgit v1.3