Skip to content

Latest commit

 

History

History
54 lines (31 loc) · 1.48 KB

README.md

File metadata and controls

54 lines (31 loc) · 1.48 KB

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.