12 @protocol CBLValidationContext;
20 id<CBLValidationContext> context);
22 #define VALIDATIONBLOCK(BLOCK) ^void(CBLRevision* newRevision, id<CBLValidationContext> context)\ 28 #define FILTERBLOCK(BLOCK) ^BOOL(CBLSavedRevision* revision, NSDictionary* params) {BLOCK} 32 @protocol CBLFilterCompiler <NSObject>
33 - (
CBLFilterBlock) compileFilterFunction: (NSString*)filterSource language: (NSString*)language;
41 @property (readonly) NSString*
name;
62 #pragma mark - HOUSEKEEPING: 67 - (BOOL) close: (NSError**)error;
71 - (BOOL) compact: (NSError**)outError;
79 - (BOOL) deleteDatabase: (NSError**)outError;
86 - (BOOL) replaceUUIDs: (NSError**)outError;
99 - (BOOL) changeEncryptionKey: (
nullable id)keyOrPassword
100 error: (NSError**)error;
102 #pragma mark - DOCUMENT ACCESS: 125 #pragma mark - LOCAL DOCUMENTS: 129 - (
nullable CBLJSONDict*) existingLocalDocumentWithID: (NSString*)localDocID;
134 - (BOOL) putLocalDocument: (
nullable CBLJSONDict*)properties
135 withID: (NSString*)localDocID
136 error: (NSError**)outError;
139 - (BOOL) deleteLocalDocumentWithID: (NSString*)localDocID
140 error: (NSError**)outError ;
143 #pragma mark - VIEWS AND OTHER CALLBACKS: 157 - (
CBLView*) viewNamed: (NSString*)name;
165 - (void) setValidationNamed: (NSString*)validationName
181 + (void) setFilterCompiler: (
nullable id<CBLFilterCompiler>)compiler;
187 #pragma mark - TRANSACTIONS / THREADING: 192 - (BOOL) inTransaction: (BOOL(^)(
void))block;
197 - (void) doAsync: (
void (^)())block;
203 - (void) doSync: (
void (^)())block;
206 #pragma mark - REPLICATION: 245 @protocol CBLValidationContext <NSObject>
252 @property (readonly, nonatomic) NSURL* source;
260 - (void) rejectWithMessage: (NSString*)message;
263 #pragma mark - CONVENIENCE METHODS: 266 @property (readonly)
CBLArrayOf(NSString*)* changedKeys;
instancetype NS_UNAVAILABLE()
#define NS_ASSUME_NONNULL_BEGIN
Definition: CBLBase.h:20
A "view" in a CouchbaseLite database – essentially a persistent index managed by map/reduce...
Definition: CBLView.h:58
NSString *const kCBLDatabaseChangeNotification
This notification is posted by a CBLDatabase in response to document changes.
A revision of a CBLDocument.
Definition: CBLRevision.h:17
A CouchbaseLite database.
Definition: CBLDatabase.h:38
#define __nullable
Definition: CBLBase.h:23
#define nullable
Definition: CBLBase.h:22
Represents a query of a CouchbaseLite 'view', or of a view-like resource like _all_documents.
Definition: CBLQuery.h:34
A CouchbaseLite document (as opposed to any specific revision of it.)
Definition: CBLDocument.h:16
NSURL * internalURL
The URL of the database in the REST API.
Definition: CBLDatabase.h:59
NSUInteger documentCount
The number of documents in the database.
Definition: CBLDatabase.h:47
BOOL(^ CBLChangeEnumeratorBlock)(NSString *key, __nullable id oldValue, __nullable id newValue)
The type of callback block passed to -[CBLValidationContext enumerateChanges:].
Definition: CBLDatabase.h:238
CBLDocument * createDocument()
Creates a new CBLDocument object with no properties and a new (random) UUID.
#define NS_ASSUME_NONNULL_END
Definition: CBLBase.h:21
NSUInteger maxRevTreeDepth
The maximum depth of a document's revision tree (or, max length of its revision history.) Revisions older than this limit will be deleted during a -compact: operation.
Definition: CBLDatabase.h:76
void(^ CBLMapBlock)(CBLJSONDict *doc, CBLMapEmitBlock emit)
A "map" function called when a document is to be added to a view.
Definition: CBLView.h:28
NS_ASSUME_NONNULL_BEGIN typedef void(^ CBLValidationBlock)(CBLRevision *newRevision, id< CBLValidationContext > context)
Validation block, used to approve revisions being added to the database.
nullable id< CBLFilterCompiler > filterCompiler()
Returns the currently registered filter compiler (nil by default).
CBLArrayOf(CBLReplication * allReplications()
Returns an array of all current, running CBLReplications involving this database. ...
CBLQuery * createAllDocumentsQuery()
Returns a query that matches all documents in the database.
Top-level Couchbase Lite object; manages a collection of databases.
Definition: CBLManager.h:56
An existing revision of a CBLDocument.
Definition: CBLRevision.h:80
SInt64 lastSequenceNumber
The latest sequence number used.
Definition: CBLDatabase.h:53
BOOL(^ CBLFilterBlock)(CBLSavedRevision *revision, NSDictionary *__nullable params)
Filter block, used in changes feeds and replication.
Definition: CBLDatabase.h:26
CBLManager * manager
The database manager that owns this database.
Definition: CBLDatabase.h:44
CBLArrayOf(CBLModel *) *unsavedModels
All CBLModels associated with this database whose needsSave is true.
A 'push' or 'pull' replication between a local and a remote database.
Definition: CBLReplication.h:35
NSString * name
The database's name.
Definition: CBLDatabase.h:41