VevDB

An embedded Datalog database for immutable database values.

VevDB stores attributed facts and produces immutable database snapshots through append-only transactions. Applications can query those snapshots declaratively and pass them around as ordinary values.

The database runs in-process, either in memory or durably with bundled SQLite. It does not require a separate transactor process, a Clojure runtime, or a database server.

VevDB follows Datomic’s data model and supports Datalog queries, pull expressions, entities, indexes, history, and hypothetical databases.

Clojure
(require '[vev.core :as d])

(def conn (d/create-conn))

(d/transact conn
  [{:db/id 1 :person/name "Ada"}
   {:db/id 2 :person/name "Grace"}])

(d/q '[:find ?name
       :where [?e :person/name ?name]]
     (d/db conn))

Database model

Datoms

Each fact consists of an entity, attribute, value, transaction, and an indication of whether the fact was added or retracted.

Immutable database values

Transactions produce new database values. Existing snapshots remain valid and can be queried at any time.

Datalog queries

Queries support inputs, predicates, aggregates, rules, negation, disjunction, pull expressions, and historical views.

In-memory and durable storage

Use an in-memory connection for transient data or a durable store backed internally by bundled SQLite.

Indexes and history

EAVT, AEVT, AVET, and VAET indexes support entity access, reverse references, range scans, and historical queries.

Embedded operation

The query engine and storage layer run inside the application as a native library, without a separate server process.

Using VevDB

The command-line interface reads and writes durable stores without a server. EDN transactions and queries can be supplied inline or in files.

For embedded use, start with the C API or one of the language packages.

Read the getting started guide

$ vevdb transact example.db transactions.edn
$ vevdb query example.db query.edn

APIs

LanguageStatusPackage or documentation
CBuilt inC ABI guide
KvistBuilt inKvist API
ClojureAvailablevevdb/vev-clj
JavaAvailablevevdb/vev-java
OdinAvailablevevdb/vev-odin

Documentation