|
@@ -1,4 +1,4 @@
|
|
|
-Bolt [](https://coveralls.io/r/boltdb/bolt?branch=master) [](https://godoc.org/github.com/boltdb/bolt) 
|
|
|
+Bolt [](https://coveralls.io/r/boltdb/bolt?branch=master) [](https://godoc.org/github.com/boltdb/bolt) 
|
|
|
====
|
|
|
|
|
|
Bolt is a pure Go key/value store inspired by [Howard Chu's][hyc_symas]
|
|
@@ -15,11 +15,11 @@ and setting values. That's it.
|
|
|
|
|
|
## Project Status
|
|
|
|
|
|
-Bolt is stable and the API is fixed. Full unit test coverage and randomized
|
|
|
-black box testing are used to ensure database consistency and thread safety.
|
|
|
-Bolt is currently in high-load production environments serving databases as
|
|
|
-large as 1TB. Many companies such as Shopify and Heroku use Bolt-backed
|
|
|
-services every day.
|
|
|
+Bolt is stable, the API is fixed, and the file format is fixed. Full unit
|
|
|
+test coverage and randomized black box testing are used to ensure database
|
|
|
+consistency and thread safety. Bolt is currently in high-load production
|
|
|
+environments serving databases as large as 1TB. Many companies such as
|
|
|
+Shopify and Heroku use Bolt-backed services every day.
|
|
|
|
|
|
## Table of Contents
|
|
|
|
|
@@ -209,7 +209,7 @@ and then safely close your transaction if an error is returned. This is the
|
|
|
recommended way to use Bolt transactions.
|
|
|
|
|
|
However, sometimes you may want to manually start and end your transactions.
|
|
|
-You can use the `Tx.Begin()` function directly but **please** be sure to close
|
|
|
+You can use the `DB.Begin()` function directly but **please** be sure to close
|
|
|
the transaction.
|
|
|
|
|
|
```go
|
|
@@ -313,7 +313,7 @@ func (s *Store) CreateUser(u *User) error {
|
|
|
// Generate ID for the user.
|
|
|
// This returns an error only if the Tx is closed or not writeable.
|
|
|
// That can't happen in an Update() call so I ignore the error check.
|
|
|
- id, _ = b.NextSequence()
|
|
|
+ id, _ := b.NextSequence()
|
|
|
u.ID = int(id)
|
|
|
|
|
|
// Marshal user data into bytes.
|
|
@@ -448,6 +448,10 @@ db.View(func(tx *bolt.Tx) error {
|
|
|
})
|
|
|
```
|
|
|
|
|
|
+Please note that keys and values in `ForEach()` are only valid while
|
|
|
+the transaction is open. If you need to use a key or value outside of
|
|
|
+the transaction, you must use `copy()` to copy it to another byte
|
|
|
+slice.
|
|
|
|
|
|
### Nested buckets
|
|
|
|
|
@@ -557,7 +561,7 @@ if err != nil {
|
|
|
Bolt is able to run on mobile devices by leveraging the binding feature of the
|
|
|
[gomobile](https://github.com/golang/mobile) tool. Create a struct that will
|
|
|
contain your database logic and a reference to a `*bolt.DB` with a initializing
|
|
|
-contstructor that takes in a filepath where the database file will be stored.
|
|
|
+constructor that takes in a filepath where the database file will be stored.
|
|
|
Neither Android nor iOS require extra permissions or cleanup from using this method.
|
|
|
|
|
|
```go
|
|
@@ -807,6 +811,7 @@ them via pull request.
|
|
|
|
|
|
Below is a list of public, open source projects that use Bolt:
|
|
|
|
|
|
+* [BoltDbWeb](https://github.com/evnix/boltdbweb) - A web based GUI for BoltDB files.
|
|
|
* [Operation Go: A Routine Mission](http://gocode.io) - An online programming game for Golang using Bolt for user accounts and a leaderboard.
|
|
|
* [Bazil](https://bazil.org/) - A file system that lets your data reside where it is most convenient for it to reside.
|
|
|
* [DVID](https://github.com/janelia-flyem/dvid) - Added Bolt as optional storage engine and testing it against Basho-tuned leveldb.
|
|
@@ -825,7 +830,6 @@ Below is a list of public, open source projects that use Bolt:
|
|
|
* [cayley](https://github.com/google/cayley) - Cayley is an open-source graph database using Bolt as optional backend.
|
|
|
* [bleve](http://www.blevesearch.com/) - A pure Go search engine similar to ElasticSearch that uses Bolt as the default storage backend.
|
|
|
* [tentacool](https://github.com/optiflows/tentacool) - REST api server to manage system stuff (IP, DNS, Gateway...) on a linux server.
|
|
|
-* [SkyDB](https://github.com/skydb/sky) - Behavioral analytics database.
|
|
|
* [Seaweed File System](https://github.com/chrislusf/seaweedfs) - Highly scalable distributed key~file system with O(1) disk read.
|
|
|
* [InfluxDB](https://influxdata.com) - Scalable datastore for metrics, events, and real-time analytics.
|
|
|
* [Freehold](http://tshannon.bitbucket.org/freehold/) - An open, secure, and lightweight platform for your files and data.
|
|
@@ -842,9 +846,12 @@ Below is a list of public, open source projects that use Bolt:
|
|
|
* [Go Report Card](https://goreportcard.com/) - Go code quality report cards as a (free and open source) service.
|
|
|
* [Boltdb Boilerplate](https://github.com/bobintornado/boltdb-boilerplate) - Boilerplate wrapper around bolt aiming to make simple calls one-liners.
|
|
|
* [lru](https://github.com/crowdriff/lru) - Easy to use Bolt-backed Least-Recently-Used (LRU) read-through cache with chainable remote stores.
|
|
|
-* [Storm](https://github.com/asdine/storm) - A simple ORM around BoltDB.
|
|
|
+* [Storm](https://github.com/asdine/storm) - Simple and powerful ORM for BoltDB.
|
|
|
* [GoWebApp](https://github.com/josephspurrier/gowebapp) - A basic MVC web application in Go using BoltDB.
|
|
|
* [SimpleBolt](https://github.com/xyproto/simplebolt) - A simple way to use BoltDB. Deals mainly with strings.
|
|
|
* [Algernon](https://github.com/xyproto/algernon) - A HTTP/2 web server with built-in support for Lua. Uses BoltDB as the default database backend.
|
|
|
+* [MuLiFS](https://github.com/dankomiocevic/mulifs) - Music Library Filesystem creates a filesystem to organise your music files.
|
|
|
+* [GoShort](https://github.com/pankajkhairnar/goShort) - GoShort is a URL shortener written in Golang and BoltDB for persistent key/value storage and for routing it's using high performent HTTPRouter.
|
|
|
+* [torrent](https://github.com/anacrolix/torrent) - Full-featured BitTorrent client package and utilities in Go. BoltDB is a storage backend in development.
|
|
|
|
|
|
If you are using Bolt in a project please send a pull request to add it to the list.
|