diff options
| author | Patrick Mezard <patrick@mezard.eu> | 2015-10-21 10:55:50 +0200 |
|---|---|---|
| committer | Patrick Mezard <patrick@mezard.eu> | 2015-10-21 10:55:50 +0200 |
| commit | e05e34c332d4c085119ec8fa881ed5351d1ba962 (patch) | |
| tree | c2ad79574a3bac06e020a89acbbb0cde1a2cf78d /tx.go | |
| parent | Merge pull request #442 from pmezard/mention-address-space-consumption (diff) | |
| download | dedo-e05e34c332d4c085119ec8fa881ed5351d1ba962.tar.gz dedo-e05e34c332d4c085119ec8fa881ed5351d1ba962.tar.xz | |
bucket: document buckets are valid only during the transaction
Issue #313
Diffstat (limited to '')
| -rw-r--r-- | tx.go | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -87,18 +87,21 @@ func (tx *Tx) Stats() TxStats { // Bucket retrieves a bucket by name. // Returns nil if the bucket does not exist. +// The bucket instance is only valid for the lifetime of the transaction. func (tx *Tx) Bucket(name []byte) *Bucket { return tx.root.Bucket(name) } // CreateBucket creates a new bucket. // Returns an error if the bucket already exists, if the bucket name is blank, or if the bucket name is too long. +// The bucket instance is only valid for the lifetime of the transaction. func (tx *Tx) CreateBucket(name []byte) (*Bucket, error) { return tx.root.CreateBucket(name) } // CreateBucketIfNotExists creates a new bucket if it doesn't already exist. // Returns an error if the bucket name is blank, or if the bucket name is too long. +// The bucket instance is only valid for the lifetime of the transaction. func (tx *Tx) CreateBucketIfNotExists(name []byte) (*Bucket, error) { return tx.root.CreateBucketIfNotExists(name) } |
