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

Commit

Permalink
Prepare for 2.1.0 release (#438)
Browse files Browse the repository at this point in the history
* Prepare for 2.1.0 release

* Fix docs
  • Loading branch information
tomblench authored Jul 10, 2018
1 parent 0ccbe1a commit e4cf17b
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CDTDatastore.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ EOT

Pod::Spec.new do |s|
s.name = "CDTDatastore"
s.version = "2.0.3"
s.version = "2.1.0"
s.summary = "CDTDatastore is a document datastore which syncs."
s.description = <<-DESC
CDTDatastore is a JSON document datastore which speaks the
Expand Down
2 changes: 1 addition & 1 deletion CDTDatastore/Version.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define CLOUDANT_SYNC_VERSION "2.0.4-SNAPSHOT"
#define CLOUDANT_SYNC_VERSION "2.1.0"
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CDTDatastore CHANGELOG

## Unreleased
## 2.1.0 (2018-07-10)
- [NEW] Add method `-closeDatastoreNamed:` on `CDTDatastoreManager`.
- [FIXED] Fix issue where repeated calls to `-datastoreNamed:error:` on `CDTDatastoreManager` for
the same datastore could cause crashes or failures.
Expand Down
26 changes: 25 additions & 1 deletion doc/crud.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,33 @@ let ds2 = try manager.datastoreNamed("other_datastore")

These datastores are persisted to disk between application runs.

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

Calling `datastoreNamed` on an already open datastore will return the same reference to that
datastore.

Datastores are held open for as long as they are needed and are automatically closed when the
`CDTDatastoreManager` is deallocated. This will typically happen at the end of the program or
earlier (for instance if `autoreleasepool`s are used or the manager is explicitly set to `nil`).

In applications which open large numbers of Datastores it may be necessary to explicitly close
datastores after use to avoid exhaustion of file handles and other native resources.

To close a datastore:

Objective-C:

```objc
[manager closeDatastoreNamed:@"my_datastore"];
```
Swift:
```swift
manager.closeDatastoreNamed("my_datastore");
```

To delete a datastore and all associated data (i.e., attachments and
extension data such as indexes (see [query.md](query.md)):

Expand Down

0 comments on commit e4cf17b

Please sign in to comment.