[package]
name = "retia"
version = "0.1.1"
edition = "2021"
description = "A general-purpose, transactional, relational database that uses Datalog and focuses on graph data and algorithms. Rust-only fork of CozoDB."
authors = ["Ziyang Hu", "Aditya Kresna"]
license = "MPL-2.0"
homepage = "https://flusci.org"
repository = "https://github.com/fluminis-scientiae-oraculum/retia"
documentation = "https://docs.rs/retia"
readme = "README.md"
keywords = ["database", "datalog", "graph", "embedded", "query"]
categories = ["database-implementations", "database"]
exclude = [
    "tests/*",
]

[package.metadata.docs.rs]
features = ["storage-sqlite", "graph-algo", "requests"]
rustdoc-args = ["--cfg", "docsrs"]

[features]
#! # Features

default = ["compact"]
## Enables the `minimal`, `requests` and `graph-algo` features.
compact = ["minimal", "requests", "graph-algo"]
## Enables the `minimal`, `requests` and `graph-algo` features in single threaded mode.
compact-single-threaded = ["minimal", "requests", "graph-algo"]
## Enables the `storage-sqlite` feature.
minimal = ["storage-sqlite", "storage-sqlite-src"]
## Enables the [Sqlite](https://www.sqlite.org/index.html) backend,
## also allows backup and restore with Sqlite data files.
## Sqlite is easy to compile, has very low resource requirements and reasonable performance,
## but does not support much concurrency.
storage-sqlite = ["dep:sqlite"]
storage-sqlite-src = ["dep:sqlite3-src", "sqlite3-src/bundled"]
## Enables the [RocksDB](http://rocksdb.org/) backend.
## RocksDB is hard to compile on some platforms, uses more resources than SQLite,
## but is very performant and supports an extremely high level of concurrency.
storage-rocksdb = ["dep:retia-rocks"]
storage-new-rocksdb = ["dep:rocksdb"]
## Enables the graph algorithms.
graph-algo = ["graph", "rayon"]
## Allows the utilities to make web requests to fetch data.
requests = ["dep:minreq"]
## Uses jemalloc as the global allocator, can make a difference in performance.
jemalloc = ["dep:tikv-jemallocator-global", "retia-rocks?/jemalloc"]
## Enables io-uring option for the RocksDB storage
io-uring = ["retia-rocks?/io-uring"]
## Polyfills for the WASM target
wasm = ["uuid/js", "dep:js-sys"]

#! The following features are highly experimental:


#! # Recommendation for features to enable
#!
#! Generally you will want the `storage-sqlite` and `graph-algo` features enabled,
#! unless your environment makes compiling them difficult. The backup/restore functionalities
#! are only available if `storage-sqlite` is on. Without `graph-algo` you cannot use any graph algorithms
#! (utilities are still available),
#! which could be OK if you only want to deal with pure Datalog.
#!
#! The `requests` feature allows the database to make outgoing HTTP requests to fetch data
#! into queries -- only enable it if you need it.
#!
#! The `wasm` feature simply patches some functions so that they can compile on WASM platform,
#! which lacks some std implementations at the moment. (On WASM you must also enable `nothread`).
#! This feature will not work on any other platform.
#!
#! The `jemalloc` feature only makes sense for desktop and servers. It could improve performance,
#! sometimes substantially, but you need to benchmark for your use case. It also tends to break
#! builds on untested platforms. None of our prebuilt binaries have it enabled.
#!
#! Enable `storage-rocksdb` if you expect high concurrency or want better performance than SQLite,
#! but note that RocksDB is much more resource-hungry and takes long to compile.
#!
#! The other storage options are just for experimentation. We do not recommend using them.

[dependencies]
casey = "0.4.0"
either = "1.11.0"
rand = "0.10"
miette = { version = "7", features = ["fancy"] }
lazy_static = "1.4.0"
log = "0.4.21"
env_logger = "0.11.3"
smallvec = { version = "1.13.2", features = ["serde", "write", "union", "const_generics", "const_new"] }
smartstring = { version = "1.0.1", features = ["serde"] }
serde_json = "1.0.116"
serde = { version = "1.0.199" }
serde_derive = "1.0.199"
serde_bytes = "0.11.14"
rmp = "0.8.14"
rmp-serde = "1.2.0"
rmpv = "1.0.2"
base64 = "0.22.0"
chrono = "0.4.38"
chrono-tz = "0.10"
priority-queue = "2"
ordered-float = "5"
byteorder = "1.5.0"
num-traits = "0.2.18"
itertools = "0.14"
regex = "1.10.4"
pest = "2.7.9"
pest_derive = "2.7.9"
approx = "0.5.1"
unicode-normalization = "0.1.23"
thiserror = "2"
uuid = { version = "1", features = ["v1", "v4", "v7", "serde"] }
csv = "1.3.0"
document-features = "0.2.8"
rayon = { version = "1", optional = true }
minreq = { version = "3.0.0-rc.1", features = ["https-rustls"], optional = true }
tikv-jemallocator-global = { version = "0.7", optional = true }
retia-rocks = { path = "../retia-rocks", version = "0.1.1", optional = true }
rocksdb = { version = "0.24", optional = true }
sqlite = { version = "0.37", optional = true }
sqlite3-src = { version = "0.7", optional = true }
js-sys = { version = "0.3.60", optional = true }
# Community-maintained fso-graph fork on crates.io (Rust-only, rayon
# constraint relaxed, TARmageddon fix). Aliased as `graph` so the rest of
# retia-core can keep its `use graph::prelude::*` imports unchanged.
# fso-graph 0.3.3 pulls fso-graph-builder 0.4.3 transitively.
graph = { package = "fso-graph", version = "0.3.3", optional = true }
crossbeam = "0.8.4"
ndarray = { version = "0.17", features = ["serde"] }
sha2 = "0.10"
rustc-hash = "2"
twox-hash = "2"
quadrature = "0.1.2"
# For the FTS feature
jieba-rs = "0.10"
aho-corasick = "1.1.3"
rust-stemmers = "1.2.0"
fast2s = "0.3.1"
swapvec = "0.4"

[dev-dependencies]
tempfile = "3.14.0"

[lints]
workspace = true
