RSS Amplifier

Prasanth Janardhanan · Aug 22, 2020

A Simple Wrapper to BadgerDB Key-Value store in Go

0
Sign in to vote or save

This page cannot be shown here. You can still read it on the original site — the toolbar below keeps your place in the directory.

BadgerDB is an embeddable key-value store written in Go. It is a persistent store. 
 In this article, we build a wrapper around badgerDB. The purpose of this wrapper is to make it simple to save simple values to the DB in “virtual tables”. The concept is an adaptation from the Sett project. Much of the code -especially the unit tests - are changed though. 
 Usage 
 import (…

BadgerDB is an embeddable key-value store written in Go. It is a persistent store.

In this article, we build a wrapper around badgerDB. The purpose of this wrapper is to make it simple to save simple values to the DB in “virtual tables”. The concept is an adaptation from the Sett project. Much of the code -especially the unit tests - are changed though.

Usage

import(
    "github.com/prasanthmj/sett"
)

s := sett.Open(sett.DefaultOptions("./data/mydb"))

To set a string key-value pair, call s.SetStr(k, v) and to get it back, call s.GetStr(k).

Read on /go/badgerdb-wrapper/

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.