patrickowor/DizeDB
a Dice DB Sdk for the zig programming language.
master
master
DizeDB is a Zig SDK for Dicedb, providing a fast, type-safe, and idiomatic interface for interacting with Dicedb from Zig projects.
Fetch the library using Zig's package manager:
zig fetch --save git+https://github.com/patrickowor/DizeDB.git#main
build.zig
Add the following to your build.zig
to include DizeDB as a dependency:
const diceDb = b.dependency("dizeDB", .{
.target = target,
.optimize = optimize,
});
exe.root_module.addImport("dizeDB", diceDb.module("dizeDB"));
Example:
const exe = b.addExecutable(.{
.name = "your_app",
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
});
const diceDb = b.dependency("dizeDB", .{
.target = target,
.optimize = optimize,
});
exe.root_module.addImport("dizeDB", diceDb.module("dizeDB"));
In your Zig source file:
const dizeDB = @import("dizeDB");
// ... use dizeDB API
zig build run
See examples/src/main.zig
for a working example.
This project is licensed under the terms of the LICENSE file.