Skip to content

安装

系统要求

  • Rust 1.75+(edition 2021)
  • 操作系统 Linux / macOS / Windows
  • 内存 建议 ≥ 512 MB
  • 磁盘 SSD 推荐(LSM-Tree 写入密集型)

从源码构建

bash
git clone https://github.com/darkmice/talon.git
cd talon
cargo build --release

构建产物:

  • target/release/libtalon.rlib — Rust 嵌入式库
  • target/release/talon-server — 独立服务端二进制

作为 Rust 依赖使用

toml
[dependencies]
talon = { git = "https://github.com/darkmice/talon.git" }

功能开关(Feature Flags)

toml
[dependencies]
talon = { git = "https://github.com/darkmice/talon.git", features = ["server"] }
Feature说明
default嵌入式模式,包含所有 9 引擎
server启用 HTTP + TCP + Redis 服务端
cluster启用 Primary-Replica 集群

配置

rust
use talon::{Talon, StorageConfig};

let config = StorageConfig {
    cache_size: 256 * 1024 * 1024,  // 256 MB 块缓存
    ..Default::default()
};
let db = Talon::open_with_config("./data", config)?;

配置参数

参数默认值说明
cache_size64 MBLSM-Tree 块缓存大小
max_write_buffer_size64 MB写入缓冲区上限
compaction_styleLeveled压缩策略

验证安装

rust
use talon::Talon;

let db = Talon::open("./test-data")?;
db.run_sql("SELECT 1 + 1")?;
println!("Talon 安装成功!");

Released under the MIT License.