GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - gadget-inc/slatedb-node: slatedb bindings for nodejs for KV on object storage

BranchesTags
Open more actions menu

Latest commit

 

History

14 Commits
14 Commits

Folders and files

NameName
Last commit message
Last commit date
.claude/skills/ci
.claude/skills/ci
 
 
.cspell
.cspell
 
 
.github/workflows
.github/workflows
 
 
nix
nix
 
 
spec
spec
 
 
src
src
 
 
.envrc
.envrc
 
 
.gitignore
.gitignore
 
 
.npmrc
.npmrc
 
 
.oxfmtrc.json
.oxfmtrc.json
 
 
.oxlintrc.json
.oxlintrc.json
 
 
Cargo.lock
Cargo.lock
 
 
Cargo.toml
Cargo.toml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.rs
build.rs
 
 
cspell.json
cspell.json
 
 
native.cjs
native.cjs
 
 
package.json
package.json
 
 
pnpm-lock.yaml
pnpm-lock.yaml
 
 
pnpm-workspace.yaml
pnpm-workspace.yaml
 
 
tsconfig.build.json
tsconfig.build.json
 
 
tsconfig.json
tsconfig.json
 
 
vitest.config.js
vitest.config.js
 
 

Repository files navigation

slatedb-node

High-performance Node.js bindings for SlateDB implemented as a native Rust extension using napi-rs.

  • Native extension (no subprocess bridge)
  • Async TypeScript API
  • Supports SlateDB DB/Reader/Snapshot/Transaction/Admin primitives
  • Compiled with slatedb feature all (object store + compression feature set)

Installation

pnpm add slatedb-node

Quick Start

import { WriteBatch, open } from "slatedb-node";

const db = await open({ path: "example-db", url: "memory:///" });

await db.put("user:1", "alice");
console.log((await db.get("user:1"))?.toString());

const batch = new WriteBatch();
batch.put("user:2", "bob");
batch.delete("user:1");
await db.write(batch);

const iter = await db.scanPrefix("user:");
for await (const [key, value] of iter) {
  console.log(key.toString(), value.toString());
}

await db.close();

Opening Databases

import { open } from "slatedb-node";

const db = await open({
  path: "my-db",
  url: "file:///tmp/slatedb-store",
  settingsPath: "./SlateDb.toml", // optional
  settings: {
    flush_interval: "50ms",
    manifest_poll_interval: "1s",
  }, // optional object overrides
});

Reader and Admin APIs

import { open, openAdmin, openReader } from "slatedb-node";

const db = await open({ path: "my-db", url: "file:///tmp/slatedb-store" });
const checkpoint = await db.createCheckpoint("durable");

const reader = await openReader({
  path: "my-db",
  url: "file:///tmp/slatedb-store",
  checkpointId: checkpoint.id,
});

const admin = await openAdmin({ path: "my-db", url: "file:///tmp/slatedb-store" });
console.log(await admin.listCheckpoints());

await reader.close();
await db.close();

Errors

Errors are mapped to typed classes:

  • TransactionError
  • ClosedError
  • UnavailableError
  • InvalidError
  • DataError
  • InternalError

Development

Requirements:

  • Node.js 20+
  • Rust toolchain
  • pnpm

Commands:

pnpm install
pnpm run build
pnpm test

Prebuilt Binaries

The package uses @napi-rs/cli optional dependency packages (like esbuild/swc) so the main package stays small and installs only the binary for the current platform.

Generated optional packages:

  • macOS x64 / arm64
  • Linux x64 / arm64 (gnu + musl)
  • Windows x64 / arm64 (msvc)

The generated package names are:

  • slatedb-node-darwin-x64
  • slatedb-node-darwin-arm64
  • slatedb-node-linux-x64-gnu
  • slatedb-node-linux-x64-musl
  • slatedb-node-linux-arm64-gnu
  • slatedb-node-linux-arm64-musl
  • slatedb-node-win32-x64-msvc
  • slatedb-node-win32-arm64-msvc

Publishing

publish.yml builds all native targets, downloads artifacts, creates per-platform npm package dirs, and runs npm publish.

prepublishOnly runs napi pre-publish -t npm, which updates optionalDependencies and publishes the platform packages alongside the main package.

About

slatedb bindings for nodejs for KV on object storage

Resources

Readme
MIT license
Activity
Custom properties

Stars

5 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.