Skip to content
This repository has been archived by the owner on Apr 6, 2024. It is now read-only.

LowByteFox/Zeonic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zeonic

ZeonDB SDK for the Bun.js runtime

Usage

Getting libZeonCAPI.so

git clone https://codeberg.org/LowByteFox/ZeonDB.git
cd ZeonDB
cmake -B build -G Ninja # Make sure you have all dependencies installed
ninja -C build ZeonCAPI_Shared # After it is done you can find the lib as build/libZeonCAPI.so
import { initZeonDB, ZeonDB, Key } from "zeonic";
/* It is not ready yet to be on npm
 * I had to be quick with this so for now just get the `index.ts` file
 * and import stuff from that
 */


initZeonDB("libZeonCAPI.so"); // you must run this!

const db = new ZeonDB("127.0.0.1", 6748);

if (await db.login("user", "pass")) {
    await db.set(Key("hello"), "world");

    let res = await db.get(Key("hello"));
    if (res.ok) {
        console.log(res.value);
    } else {
        throw new Error(err.msg);
    }
} else {
    throw new Error(await db.get_error());
}

await db.disconnect();

Documentation

TODO
For now look into test.ts

About

ZeonDB Driver for the Bun.js runtime

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published