Ben Johnson
482f00fdfc
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.
2014-03-23 12:20:16 -06:00
Ben Johnson
4132080333
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 .
2014-03-13 14:39:28 -06:00
Ben Johnson
c551e45a47
Consolidate Tx and RWTx.
2014-03-08 20:40:48 -07:00
Ben Johnson
57376f0905
Rename Transaction to Tx.
...
I changed the Transaction/RWTransaction types to Tx/RWTx, respectively. This makes the naming
more consistent with other packages such as database/sql. The txnid is changed to txid as well.
2014-03-08 17:04:02 -07:00
Ben Johnson
a1f43f4d60
Allow reads of unflushed nodes.
...
This commit allows cursors to read updated values from within the
RWTransaction.
2014-03-01 09:13:59 -07:00
Ben Johnson
956453b69f
Minor refactor.
2014-02-28 15:13:07 -07:00
Ben Johnson
3b2fd8f2d3
Revert "Refactor Transaction/Bucket API."
...
This reverts commit 1ad2b99f281d587b767b36f886401e81d17915a9.
2014-02-22 22:54:54 -07:00
Ben Johnson
1ad2b99f28
Refactor Transaction/Bucket API.
2014-02-21 22:57:50 -07:00
Ben Johnson
15e0eae829
Bidirectional cursors.
2014-02-20 13:53:40 -07:00
Tommi Virtanen
8438c6ebc3
Cursor.Get is now Cursor.Seek, and returns the first possible key.
...
This makes range and prefix queries possible.
Closes : #44
2014-02-20 11:33:28 -08:00
Ben Johnson
2d1f21a40d
Fix Cursor godoc for First(), Next(), and Get().
2014-02-20 11:04:46 -07:00
Ben Johnson
d1952237ed
Improve test coverage.
2014-02-15 23:45:17 -07:00
Ben Johnson
8ad59edd02
API Documentation.
2014-02-13 10:58:27 -07:00
Ben Johnson
b8122bf568
Cursor iteration.
2014-02-11 09:07:07 -07:00
Ben Johnson
509e93dff4
Add freelist.
2014-02-10 14:04:01 -07:00
Ben Johnson
3da04c52b9
Rebalance after deletion.
2014-02-08 23:13:54 -07:00
Ben Johnson
84939c21f6
Refactor node lookup.
2014-02-07 15:03:29 -07:00
Ben Johnson
8b3b81ef47
Fix quick tests.
2014-02-05 07:56:13 -07:00
Ben Johnson
1a17a2cf1e
Add RWTransaction.Put().
2014-02-01 12:30:37 -05:00
Ben Johnson
8d5757e9dd
gofmt
2014-01-30 17:04:56 -05:00
Ben Johnson
149d48fb9e
Fix leaf/branch deserialization.
2014-01-30 00:11:46 -05:00
Ben Johnson
4fc84daf2a
Refactor meta.copy() and page.init().
2014-01-29 22:35:58 -05:00
Ben Johnson
ef590ecdfb
lpage
2014-01-27 22:22:37 -05:00
Ben Johnson
192649f453
Intermediate.
2014-01-27 10:11:54 -05:00
Ben Johnson
1baa6d576a
Initialize transaction/rwtransaction.
2014-01-26 15:29:06 -07:00
Ben Johnson
73ab1d420d
TODO
2014-01-24 16:32:18 -07:00
Ben Johnson
20b26eac78
TODO
2014-01-24 12:51:56 -07:00
Ben Johnson
bce3e667df
Intermediate commit.
2014-01-21 15:00:48 -07:00
Ben Johnson
153372abd4
Refactoring to RWCursor, RWTxn, and branch/leaf nodes and pages.
2014-01-17 15:23:39 -07:00
Ben Johnson
cec7b942e7
Add system buckets.
2014-01-14 13:01:02 -07:00
Ben Johnson
79d9b6bb5a
Begin Transaction.Cursor().
2014-01-13 10:35:04 -07:00
Ben Johnson
ee24437bfc
Initial db.open.
2014-01-11 22:51:01 -07:00
Ben Johnson
df8333328f
DB.Open(), pages, and meta.
2014-01-10 07:32:12 -07:00
Ben Johnson
f922c1d2bc
Move all C code into repo.
2014-01-09 09:07:10 -07:00
Ben Johnson
ebc9f0da9e
Basic types.
2014-01-08 08:06:17 -07:00