Skip to main content

Install and Set Up LoraDB

Overview

LoraDB is one Rust engine with bindings for the major application runtimes — Node.js, Python, WebAssembly, Go, and Ruby — plus a standalone HTTP server and direct embedding from Rust. Every binding shares the same parser, planner, executor, and result shape, so switching hosts later is a mechanical translation. This page helps you pick; each binding guide covers install, connect, execute, and error handling end-to-end.

Installation / Setup

Pick a platform

PlatformPackageInstallGuide
Node / TSnpmnpm install @loradb/lora-nodeNode →
PythonPyPIpip install lora-pythonPython →
Browser / WASMnpmnpm install @loradb/lora-wasmWASM →
Gopkg.go.devgo get github.com/lora-db/lora/crates/lora-goGo →
RubyGemgem install lora-rubyRuby →
tip

Click any badge to jump to its package-registry page. Each platform guide also documents repo-local build steps for contributors working from a clone.

Which to pick?

If you…Pick
Ship a Node server / CLINode.js
Build in Python (sync or asyncio)Python
Run in the browser / Web Worker / edgeWASM
Build a Go service or CLI (cgo)Go
Ship a Ruby app, worker, or Rails serviceRuby

All bindings share the same query surface and result shape — the Cypher is identical, only the host-language wrapper differs.

Other runtimes

Two more paths share the same Cypher surface:

  • Rust crate — embed lora-database directly in a Rust binary for the lowest-overhead option. crates.io
  • HTTP server — run lora-server and POST /query from any language.

Creating a Client / Connection

Every binding exposes the same two primitives:

  1. A Database with execute(query, params?).
  2. A result: { columns, rows }, where each row maps column name → typed value.

See each platform guide for the language-specific shape.

Running Your First Query

CREATE (:Person {name: 'Ada'})
MATCH (p:Person) RETURN p.name

In any binding that's two execute calls; the platform guide shows the language-specific syntax.

Examples

Shared value model

Typed values follow one contract (defined in crates/shared-ts/types.ts): primitives, lists/maps, graph entities (tagged {kind: "node" | "relationship" | "path"}), temporals (tagged {kind: "date" | "datetime" | ...}), and points (tagged {kind: "point", srid, crs, ...}).

See Data Types Overview for the full catalogue and each binding's parameters section for how host values map in.

Common Patterns

One process, one graph

Each binding defaults to one process, one in-memory graph. Parallel queries on the same handle serialise on a mutex — spawn multiple Database instances for read parallelism.

If you want persistence, opt into it explicitly:

  • on lora-node, pass a database name and database directory to createDatabase('app', { databaseDir: './data' });
  • on Rust / lora-server, configure a WAL directory;
  • on Python, Go, and Ruby, pass a database name plus their database_dir / DatabaseDir option;

Bulk-load from the host

The idiomatic large-write shape across every binding is UNWIND $rows AS row CREATE …. The $rows parameter comes from a plain list in the host language.

Share a database across modules

Wrap the handle in whatever sharing primitive your language provides — Arc in Rust, a module singleton in Node/Python, a Worker in the browser.

Error Handling

Every binding exposes two error layers:

  • Query-level errors — parse, semantic, or runtime — surface the engine's message. Typical cases live in Troubleshooting.
  • Connection / host-level errors — language-specific (HTTP status, FFI exceptions, spawn failures). Each platform guide covers its own.

Performance / Best Practices

  • Persistence depends on the binding. Point-in-time snapshots via save_snapshot / load_snapshot exist on every binding (byte-based on WASM). Continuous durability via WAL exists on every filesystem-backed binding: Rust, lora-node, Python, Go, Ruby, and lora-server. WASM remains snapshot-only. See Limitations → Storage.
  • No query cancellation. Once dispatched, queries run to completion. Keep queries bounded (LIMIT, *..N caps).
  • Parameters, not string interpolation. The only safe way to mix untrusted input into a query.

See also