Registry / database / hashicorp-go-memdb

hashicorp-go-memdb

JSON →
library1.3.5gogounverified

Provides an in-memory database that supports transactions and MVCC.

go get github.com/hashicorp/go-memdb
INSTALL
IMPORT
SIG · HASHICORP-GO-MEMDB
H
hashicorp-go-memdb
databasegov1.3.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

memdb
github.com/hashicorp/go-memdb

Creates an in-memory database with a schema, inserts a record, and commits.

package main import ( "fmt" "github.com/hashicorp/go-memdb" ) func main() { schema := &memdb.DBSchema{ Tables: map[string]*memdb.TableSchema{ "user": { Name: "user", Indexes: map[string]*memdb.IndexSchema{ "id": { Name: "id", Unique: true, Indexer: &memdb.StringFieldIndex{Field: "ID"}, }, }, }, }, } db, _ := memdb.NewMemDB(schema) txn := db.Txn(true) txn.Insert("user", &User{ID: "1"}) txn.Commit() fmt.Println("done") } type User struct { ID string }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.3.5latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Resources
hashicorp-go-memdb — go get hashicorp-go-memdb · libregistry