Welcome to Runic¶
Graph ORM and Schema Migrations for FalkorDB
Documentation for version: 0.2.2.
runic ships two tools:
runic.orm — a lightweight, graph-optimized ORM that maps Python classes to FalkorDB nodes and edges.
runic.migrate — an Alembic-style migration engine that tracks index and constraint changes as versioned, replayable scripts.
from runic.orm import Field, Node, Repository, Session
class Person(Node, labels=["Person"]):
id: str = Field()
name: str = Field()
email: str = Field(index=True, unique=True)
with Session(graph) as session:
session.add(Person(id="alice", name="Alice", email="alice@example.com"))
session.commit()
repo = Repository(session, Person)
print(repo.count()) # 1
ORM
Define your first node, open a session, and persist it in under a minute.
Node, Edge, Field, object states, dirty tracking, identity map.
Lazy/eager loading, polymorphic hierarchies, edge properties.
add · delete · get · flush · commit · rollback · expire.
Fluent filter, traversal, aggregation, fulltext and vector KNN API.
IndexManager and SchemaManager — sync indexes to FalkorDB.
Full autodoc reference for every public class and function.
Migration
Install runic, run runic init, write your first migration, and
apply it — all in one page.
Every command, option, and flag documented with examples.
Full list of op.* calls available inside migration scripts.
runic.migrate — programmatic migration engine API.