#query #graph #transactional #datalog #storage-engine #algorithm #cozo

cozo-ce

A general-purpose, transactional, relational database that uses Datalog and focuses on graph data and algorithms

7 releases

0.7.13-alpha.3 Dec 8, 2024
0.7.13-alpha.1 Dec 7, 2024

#1868 in Database interfaces


Used in cozo-ce-bin

MPL-2.0 license

2MB
61K SLoC

Cozo-core

Crates.io

This crate contains the implementation proper of CozoDB.


lib.rs:

This crate provides the core functionalities of CozoDB. It may be used to embed CozoDB in your application.

This doc describes the Rust API. To learn how to use CozoDB to query (CozoScript), see:

Rust API usage:

use cozo_ce::*;

let db = DbInstance::new("mem", "", Default::default()).unwrap();
let script = "?[a] := a in [1, 2, 3]";
let result = db.run_script(script, Default::default(), ScriptMutability::Immutable).unwrap();
println!("{:?}", result);

We created an in-memory database above. There are other persistent options: see DbInstance::new. It is perfectly fine to run multiple storage engines in the same process.

Dependencies

~32–56MB
~796K SLoC