aboutsummaryrefslogtreecommitdiff
path: root/transaction.go
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-01-08 08:06:17 -0700
committerBen Johnson <benbjohnson@yahoo.com>2014-01-08 08:06:17 -0700
commitebc9f0da9e0d2fe90a4f9a820114d462fdf13178 (patch)
tree287fb8791e03a70d5959c12dabab4bb25766d713 /transaction.go
parentNOTES (diff)
downloaddedo-ebc9f0da9e0d2fe90a4f9a820114d462fdf13178.tar.gz
dedo-ebc9f0da9e0d2fe90a4f9a820114d462fdf13178.tar.xz
Basic types.
Diffstat (limited to 'transaction.go')
-rw-r--r--transaction.go33
1 files changed, 33 insertions, 0 deletions
diff --git a/transaction.go b/transaction.go
new file mode 100644
index 0000000..74118d1
--- /dev/null
+++ b/transaction.go
@@ -0,0 +1,33 @@
+package bolt
+
+// TODO: #define DB_DIRTY 0x01 /**< DB was modified or is DUPSORT data */
+// TODO: #define DB_STALE 0x02 /**< Named-DB record is older than txnID */
+// TODO: #define DB_NEW 0x04 /**< Named-DB handle opened in this txn */
+// TODO: #define DB_VALID 0x08 /**< DB handle is valid, see also #MDB_VALID */
+
+// TODO: #define MDB_TXN_RDONLY 0x01 /**< read-only transaction */
+// TODO: #define MDB_TXN_ERROR 0x02 /**< an error has occurred */
+// TODO: #define MDB_TXN_DIRTY 0x04 /**< must write, even if dirty list is empty */
+// TODO: #define MDB_TXN_SPILLS 0x08 /**< txn or a parent has spilled pages */
+
+type Transaction interface {
+}
+
+type transaction struct {
+ id int
+ flags int
+ db *db
+ parent *transaction
+ child *transaction
+ nextPageNumber int
+ freePages []int
+ spillPages []int
+ dirtyList []int
+ reader *reader
+ // TODO: bucketxs []*bucketx
+ buckets []*bucket
+ bucketFlags []int
+ cursors []*cursor
+ // Implicit from slices? TODO: MDB_dbi mt_numdbs;
+ mt_dirty_room int
+}