Skip to content
This repository was archived by the owner on Mar 11, 2022. It is now read-only.

Commit e4cf17b

Browse files
authored
Prepare for 2.1.0 release (#438)
* Prepare for 2.1.0 release * Fix docs
1 parent 0ccbe1a commit e4cf17b

File tree

4 files changed

+28
-4
lines changed

4 files changed

+28
-4
lines changed

CDTDatastore.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ EOT
1414

1515
Pod::Spec.new do |s|
1616
s.name = "CDTDatastore"
17-
s.version = "2.0.3"
17+
s.version = "2.1.0"
1818
s.summary = "CDTDatastore is a document datastore which syncs."
1919
s.description = <<-DESC
2020
CDTDatastore is a JSON document datastore which speaks the

CDTDatastore/Version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#define CLOUDANT_SYNC_VERSION "2.0.4-SNAPSHOT"
1+
#define CLOUDANT_SYNC_VERSION "2.1.0"

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CDTDatastore CHANGELOG
22

3-
## Unreleased
3+
## 2.1.0 (2018-07-10)
44
- [NEW] Add method `-closeDatastoreNamed:` on `CDTDatastoreManager`.
55
- [FIXED] Fix issue where repeated calls to `-datastoreNamed:error:` on `CDTDatastoreManager` for
66
the same datastore could cause crashes or failures.

doc/crud.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,33 @@ let ds2 = try manager.datastoreNamed("other_datastore")
6868

6969
These datastores are persisted to disk between application runs.
7070

71-
The `CDTDatabaseManager` handles creating and initialising non-existent
71+
The `CDTDatastoreManager` handles creating and initialising non-existent
7272
datastores, so the object returned is ready for reading and writing.
7373

74+
Calling `datastoreNamed` on an already open datastore will return the same reference to that
75+
datastore.
76+
77+
Datastores are held open for as long as they are needed and are automatically closed when the
78+
`CDTDatastoreManager` is deallocated. This will typically happen at the end of the program or
79+
earlier (for instance if `autoreleasepool`s are used or the manager is explicitly set to `nil`).
80+
81+
In applications which open large numbers of Datastores it may be necessary to explicitly close
82+
datastores after use to avoid exhaustion of file handles and other native resources.
83+
84+
To close a datastore:
85+
86+
Objective-C:
87+
88+
```objc
89+
[manager closeDatastoreNamed:@"my_datastore"];
90+
```
91+
92+
Swift:
93+
94+
```swift
95+
manager.closeDatastoreNamed("my_datastore");
96+
```
97+
7498
To delete a datastore and all associated data (i.e., attachments and
7599
extension data such as indexes (see [query.md](query.md)):
76100

0 commit comments

Comments
 (0)