Skip to content

Commit

Permalink
badgerdb: add build tag (#119)
Browse files Browse the repository at this point in the history
BadgerDB is pretty heavy, let's not include it by default. Related to #113.
  • Loading branch information
erikgrinaker authored Aug 12, 2020
1 parent 59fd181 commit 96b79b9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@v2
- name: test & coverage report creation
run: |
go test ./... -mod=readonly -timeout 8m -race -coverprofile=coverage.txt -covermode=atomic -tags cleveldb,boltdb,rocksdb -v
go test ./... -mod=readonly -timeout 8m -race -coverprofile=coverage.txt -covermode=atomic -tags cleveldb,boltdb,rocksdb,badgerdb -v
- uses: codecov/codecov-action@v1
with:
file: ./coverage.txt
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Unreleased

- [\#115](https://github.com/tendermint/tm-db/pull/115) Add a `BadgerDB` backend (@mvdan)
- [\#115](https://github.com/tendermint/tm-db/pull/115) Add a `BadgerDB` backend with build tag `badgerdb` (@mvdan)

## 0.6.0

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Go 1.13+

- **[RocksDB](https://github.com/tecbot/gorocksdb) [experimental]:** A [Go wrapper](https://github.com/tecbot/gorocksdb) around [RocksDB](https://rocksdb.org). Similarly to LevelDB (above) it uses LSM-trees for on-disk storage, but is optimized for fast storage media such as SSDs and memory. Supports atomic transactions, but not full ACID transactions.

- **[BadgerDB](https://github.com/dgraph-io/badger) [experimental]:** A key-value database written as a pure-Go alternative to others like LevelDB and RocksDB. Makes use of multiple goroutines for performance, and includes advanced features such as transactions, write batches, compression, and more.
- **[BadgerDB](https://github.com/dgraph-io/badger) [experimental]:** A key-value database written as a pure-Go alternative to e.g. LevelDB and RocksDB, with LSM-tree storage. Makes use of multiple goroutines for performance, and includes advanced features such as serializable ACID transactions, write batches, compression, and more.

## Meta-databases

Expand Down
2 changes: 2 additions & 0 deletions badger_db.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build badgerdb

package db

import (
Expand Down
6 changes: 5 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ test-boltdb:
@echo "--> Running go test"
@go test $(PACKAGES) -tags boltdb -v

test-badgerdb:
@echo "--> Running go test"
@go test $(PACKAGES) -tags badgerdb -v

test-all:
@echo "--> Running go test"
@go test $(PACKAGES) -tags cleveldb,boltdb,rocksdb -v
@go test $(PACKAGES) -tags cleveldb,boltdb,rocksdb,badgerdb -v

lint:
@echo "--> Running linter"
Expand Down

0 comments on commit 96b79b9

Please sign in to comment.