aboutsummaryrefslogtreecommitdiff
path: root/tx_test.go (follow)
Commit message (Expand)AuthorAgeFilesLines
* Remove testify.Ben Johnson2014-07-261-52/+51
* Move tests to a test package.Ben Johnson2014-07-261-58/+49
* Remove wrapping test closures.Ben Johnson2014-07-261-213/+215
* Add Open() options, flock timeout.•••This commit changes Open() to provide an additional Options argument. The options argument currently only has a Timeout which will cause the Open() to return ErrTimeout if a file lock cannot be obtained in time. Fixes #207. Ben Johnson2014-06-211-4/+4
* Add freelist assertion on every free().•••This commit performs a check on the freelist pages to ensure that a double free can never happen. Ben Johnson2014-05-291-25/+0
* Do not attempt manual transaction rollback in Tx.Copy•••The typical use these days is with a managed transaction, via db.View. The first case (error when re-opening database file) is not tested; it is harder to instrument, and I have other plans for it. Tommi Virtanen2014-05-281-0/+51
* Add streaming check.•••This commit changes Tx.Check() to return a channel through which check errors are returned. This allows errors to be found before checking the entire data file. Ben Johnson2014-05-281-1/+1
* Merge pull request #169 from benbjohnson/allocation•••Fix freelist allocation direction.Ben Johnson2014-05-211-1/+1
|\
| * Fix freelist allocate().Ben Johnson2014-05-191-1/+1
* | move Copy and CopyFile from DB to TxMartin Kobetic2014-05-211-0/+58
|/
* Add strict mode.Ben Johnson2014-05-141-0/+25
* Add inline bucket support.•••This commit adds support for writing small buckets directly inline to their value in their parent's leaf node. Previously, subbuckets would simply have a bucket header stored in their parent bucket which pointed to the root page. This required that every bucket use at least a single page. This has a high overhead for buckets with only one or two small items. Inline buckets checks subbuckets to see if they only have a small amount of data (about 1kb) and no subbuckets. If these conditions are met then the bucket's root node is written to a fake page which is simply a pointer to the end of the bucket's header. Fixes #124. Ben Johnson2014-05-051-1/+1
* Add Tx.Cursor().•••This commit adds the Cursor() function to Tx. This allows iteration on the root bucket in a similar way to iteration on other buckets. Fixes #141. Ben Johnson2014-04-291-0/+25
* Printf's %s and %q do the right thing with []byte; removed string conversion.Kevin Gillette2014-04-251-1/+1
* Add 'bolt bench'.•••This commit adds a flexible benchmarking tool to the 'bolt' CLI. It allows the user to separately specify the write mode and read mode (e.g. sequential random, etc). It also allows the user to isolate profiling to either the read or the writes. Currently the bench tool only supports "seq" read and write modes. It also does not support streaming of Bolt counters yet. Fixes #95. /cc @snormore Ben Johnson2014-04-181-208/+0
* move bench package to bench/cmd/bolt/benchSteven Normore2014-04-181-96/+96
* add bench sub-packageSteven Normore2014-04-181-46/+35
* add benchmarks using Benchmark frameworkSteven Normore2014-04-181-41/+117
* moar bench packageSteven Normore2014-04-181-0/+41
* Return bucket from CreateBucket() functions.•••This commit changes the API for: Tx.CreateBucket() Tx.CreateBucketIfNotExists() Bucket.CreateBucket() Bucket.CreateBucketIfNotExists() These functions now return the *Bucket and error instead of just the error. Ben Johnson2014-04-151-15/+44
* Merge branch 'master' into nested-keys•••Conflicts: db_test.go tx_test.go Ben Johnson2014-04-111-15/+35
|\
| * make all benchmarks constant size and add multiple sizesMartin Kobetic2014-04-081-15/+35
* | Add nested buckets.•••This commit adds the ability to create buckets inside of other buckets. It also replaces the buckets page with a root bucket. Fixes #56. Ben Johnson2014-04-111-326/+87
|/
* Update cursor benchmark.Ben Johnson2014-04-041-15/+19
* Add Tx.OnCommit() handler.•••This commit adds the ability to execute a function after a transaction has successfully committed. Ben Johnson2014-04-041-0/+28
* Add performance counters.•••This commit adds performance counters for each transaction which are rolled up to the database level on each commit/rollback. Counters are meant to be a very fast way to track what is going on in the database. A few timers are also added in areas where the time.Now() overhead is not noticible. The DB.Stat() function is now deprecated since the `bolt` CLI now performs similar functions. Fixes #108. Ben Johnson2014-04-021-2/+0
* Write freelist after each commit.•••Well, this is embarassing. Somehow the freelist was never getting written after each commit. This commit fixes that and fixes a small reporting issue with "bolt pages". Ben Johnson2014-03-311-1/+1
* Fix bucket reclamation.•••The bucket page is allocated separately from the rest of the pages but the old bucket pages were not being added to the freelist. This change fixes that and adds a simple check for database consistency. More advanced consistency checks can be added in the future. Fixes #82. Ben Johnson2014-03-251-1/+1
* Make DB/Tx API more consistent.•••I consolidated the DB.Tx() and DB.RWTx() calls into a single DB.Begin(writable bool) call. This is more consistent with the database/sql library. I also changed the DB.Do() and DB.With() call to DB.Update() and DB.View(), respectively. This is more intuitive and more inline with other database verbiage. Ben Johnson2014-03-241-46/+46
* Add ErrTxClosed error.•••Commit/Rollback and mutable calls on Tx and Bucket now return ErrTxClosed if the transaction has already been committed or rolled back. Non-mutable calls have added an assertion to check if the transaction is closed which will cause a panic. I don't want to introduce an error return for accessor methods that are being used improperly so I think the panic is appropriate. Ben Johnson2014-03-231-0/+45
* Remove ease-of-use functions from the DB type.•••Functions such as DB.Put(), DB.Get(), and DB.Delete() were originally added to be easy to use, however, after implementing Bolt in multiple projects I have found these ease-of-use functions useless. Nearly every use case requires multiple calls in a single transaction. Using the DB ease of use functions turned out to be an antipattern. Ben Johnson2014-03-211-83/+138
* Skip long-running tests with go test -shortTommi Virtanen2014-03-131-0/+8
* Fix Cursor.Last() on empty buckets.•••@tv42 reported that creating a cursor on an empty bucket and then calling Cursor.Last() causes an index out of range error and panics. This commit adds a check for the page's item count being greater than zero. Fixes #63. Ben Johnson2014-03-131-6/+21
* Consolidate Tx and RWTx.Ben Johnson2014-03-081-0/+437