From ebc9f0da9e0d2fe90a4f9a820114d462fdf13178 Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Wed, 8 Jan 2014 08:06:17 -0700 Subject: Basic types. --- transaction.go | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 transaction.go (limited to 'transaction.go') 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 +} -- cgit v1.2.3