Using LoraDB in Ruby
Overview
lora-ruby is a native extension built with
Magnus on top of
rb-sys. The engine runs
in-process — no separate server, no socket hop. Values follow the
same tagged model as the Node, Python, WASM, and Go bindings
(primitives pass through; nodes, relationships, paths, temporals,
and points come back as Hashes with a "kind" discriminator).
How-to~3 min
Use LoraDB in a Ruby project
Install the lora-ruby gem, require the extension, open an in-memory database handle, run a Cypher query, and persist the graph.
- Install the gemRun gem install lora-ruby (or add gem 'lora-ruby' to your Gemfile and run bundle install). Precompiled platform gems install directly; missing platforms fall through to a cargo + rb-sys source build.Jump to section
- Require the extensionAdd require 'lora_ruby' at the top of your script or initializer.Jump to section
- Open a database handleCall LoraRuby::Database.create (alias for .new) to get a handle over an empty in-memory graph.Jump to section
- Run a Cypher queryCall db.execute("CREATE (:Person {name: 'Ada'})") and db.execute("MATCH (p:Person) RETURN p.name") to confirm the gem loaded and the engine runs in-process.Jump to section
- Persist the graphCall db.save_snapshot('graph.bin') for an atomic point-in-time dump, or open with a WAL directory for continuous durability across process restarts.Jump to section