Skip to content

jiacai2050/zig-rocksdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zig-rocksdb

https://img.shields.io/badge/zig%20version-0.13.0-blue.svg https://github.com/jiacai2050/zig-rocksdb/actions/workflows/CI.yml/badge.svg

RocksDB binding for Zig.

Usage

See examples/basic.zig, examples/cf.zig for details.

Installation

zig fetch --save=rocksdb https://github.com/jiacai2050/zig-rocksdb/archive/${COMMIT}.tar.gz

Replace ${COMMIT} with a real one, then in your build.zig, import the module like this:

const dep_rocksdb = b.dependency("rocksdb", .{});
exe.root_module.addImport("rocksdb", dep_rocksdb.module("rocksdb"));
exe.linkLibC();

This library will link to a vendored librocksdb(v9.0.0) by default, you can disable it and link to system-wide with this

const dep_rocksdb = b.dependency("rocksdb", .{ .link_vendor = false });
exe.linkSystemLibrary("rocksdb");
exe.linkLibC();

Acknowledge

Thanks to rust-rocksdb, I benefit a lot from it when build this building library.

License

MIT