Skip to content

mistifyio/kvite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KVite GoDoc Build Status

Overview

KVite is a simple embedded key/value store for Go that uses SQLite for storage.

It is also horribly named. K/V + SQLite => KVite.

Design

The API was influenced heavily by bolt. kvite is safe to use with multiple processes.

Data is stored in a single table per kvite "instance" using a bucket/key/value. Keys are stored as TEXT in the database and referenced as string in Go. Values are stores as BLOB in the database and referenced as []byte in Go.

Interactions with the datastore are done through transactions.

Usage

Typically, one uses the Transaction wrapper. (Error handling omitted for clarity)

import "github.com/mistifyio/kvite"

db, err := kvite.Open("/path/to/my/database.db")

err := db.Transaction(func(tx *Tx) error {
            b, err := tx.CreateBucket("test")

            err = b.Put("foo", []byte("bar"))

            val, err := b.Get("foo")

            err = b.Delete("foo")

            return nil
        })

For full documentation see the godoc

Status

kvite is currently being used in a larger production quality project. The API is not yet stabilized, however.

About

Simple embedded K/V store for Go backed by SQLite

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages