![]() |
Couchbase Lite
Objective-C API for iOS and Mac OS
|
Options for opening a database.
All properties default to NO or nil.
Properties | |
| BOOL | create |
| Create database if it doesn't exist? More... | |
| BOOL | readOnly |
| Open database read-only? More... | |
| NSString * | storageType |
| The underlying storage engine to use. More... | |
| id | encryptionKey |
| A key to encrypt the database with. More... | |
|
readwritenonatomicassign |
Create database if it doesn't exist?
|
readwritenonatomicassign |
Open database read-only?
|
readwritenonatomiccopy |
The underlying storage engine to use.
Legal values are kCBLSQLiteStorage, kCBLForestDBStorage, or nil. If the database is being created, the given storage engine will be used, or the default if the value is nil. If the database exists, and the value is not nil, the database will be upgraded to that storage engine if possible. (SQLite-to-ForestDB upgrades are supported.)
|
readwritenonatomicstrong |
A key to encrypt the database with.
If the database does not exist and is being created, it will use this key, and the same key must be given every time it's opened.
The primary form of key is an NSData object 32 bytes in length: this is interpreted as a raw AES-256 key. To create a key, generate random data using a secure cryptographic randomizer like SecRandomCopyBytes or CCRandomGenerateBytes. Alternatively, the value may be an NSString containing a passphrase. This will be run through 64,000 rounds of the PBKDF algorithm to securely convert it into an AES-256 key. On Mac OS only, the value may be @YES. This instructs Couchbase Lite to use a key stored in the user's Keychain, or generate one there if it doesn't exist yet. A default nil value, of course, means the database is unencrypted.