Async ORM for TypeDB built on type-bridge-core-lib.
This crate provides:
- [
TypeBridgeEntity] trait for mapping Rust structs to TypeDB entity types - [
TypeBridgeRelation] trait for mapping Rust structs to TypeDB relation types - [
TypeBridgeAttribute] trait and [define_attribute!] macro for attribute types - [
EntityManager] / [RelationManager] for typed CRUD operations - [
Database] + [Transaction] + [TransactionContext] session layer - [
Filter] for equality-based queries
Quick start
use type_bridge_orm::{
define_attribute, Database, EntityManager, Filter,
TypeBridgeEntity, OwnedAttributeInfo, AttributeValue,
};
// Define attribute types
define_attribute!(Name, "name", "string");
define_attribute!(Age, "age", "long");
// Define entity (manual impl; derive macros in a later phase)
struct Person { iid: Option<String>, name: Name, age: Age }
// impl TypeBridgeEntity for Person { ... }
// CRUD operations
let db = Database::connect("localhost:1729", "mydb", "admin", "password").await?;
let manager = EntityManager::<Person>::new(&db);
manager.insert(&mut person).await?;
let people = manager.all().await?;