chore: re-map project structure to using multi workspace paradigm

This commit is contained in:
Maulana Sodiqin
2025-04-06 13:25:44 +07:00
parent de9c5a6dc1
commit b4bf78f0d6
87 changed files with 325 additions and 192 deletions
+16
View File
@@ -0,0 +1,16 @@
use anyhow::{bail, Result};
use surrealdb::sql::Thing;
pub fn get_id(thing: &Thing) -> Result<(&str, &str)> {
let table = thing.tb.as_str();
let id = match &thing.id {
surrealdb::sql::Id::String(s) => s.as_str(),
_ => bail!("Unsupported ID type"),
};
Ok((table, id))
}
pub fn extract_id(thing: &Thing) -> String {
let id = thing.id.to_raw();
id
}