MCPcopy
hub / github.com/lotusdblabs/lotusdb

github.com/lotusdblabs/lotusdb @v2.1.0 sqlite

repository ↗ · DeepWiki ↗ · release v2.1.0 ↗
209 symbols 879 edges 25 files 109 documented · 52%
README

Snipaste_2023-09-15_21-45-26.png

What is LotusDB

LotusDB is the most advanced key-value store written in Go, extremely fast, compatible with LSM tree and B+ tree, and optimization of badger and bbolt.

Key features:

  • Combine the advantages of LSM and B+ tree
  • Fast read/write performance
  • Much lower read and space amplification than typical LSM

Design Overview

Getting Started

package main

import (
    "github.com/lotusdblabs/lotusdb/v2"
)

func main() {
    // specify the options
    options := lotusdb.DefaultOptions
    options.DirPath = "/tmp/lotusdb_basic"

    // open a database
    db, err := lotusdb.Open(options)
    if err != nil {
        panic(err)
    }
    defer func() {
        _ = db.Close()
    }()

    // put a key
    err = db.Put([]byte("name"), []byte("lotusdb"), nil)
    if err != nil {
        panic(err)
    }

    // get a key
    val, err := db.Get([]byte("name"))
    if err != nil {
        panic(err)
    }
    println(string(val))

    // delete a key
    err = db.Delete([]byte("name"), nil)
    if err != nil {
        panic(err)
    }
}

see the examples for more details.

Community

Welcome to join the Slack channel and Discussions to connect with LotusDB team members and other users.

If you are a Chinese user, you are also welcome to join our WeChat group, scan the QR code and you will be invited:

Extension points exported contracts — how you extend this code

Index (Interface)
Index is the interface for index implementations. An index is a key-value store that maps keys to chunk positions. The i [2 …
index.go

Core symbols most depended-on inside this repo

Close
called by 34
index.go
Key
called by 31
iterator.go
Valid
called by 25
iterator.go
close
called by 21
vlog.go
Key
called by 21
iterator.go
openMemtable
called by 20
memtable.go
Get
called by 19
index.go
Next
called by 18
iterator.go

Shape

Function 93
Method 87
Struct 24
TypeAlias 3
Interface 2

Languages

Go100%

Modules by API surface

memtable.go19 symbols
iterator.go18 symbols
db.go17 symbols
bptree_test.go17 symbols
bptree.go16 symbols
db_test.go15 symbols
memtable_test.go13 symbols
batch.go13 symbols
hashtable_test.go12 symbols
vlog_test.go11 symbols
index.go10 symbols
vlog.go8 symbols

Dependencies from manifests, versioned

github.com/cespare/xxhash/v2v2.2.0 · 1×
github.com/gofrs/flockv0.8.1 · 1×
github.com/kr/prettyv0.2.0 · 1×

For agents

$ claude mcp add lotusdb \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact