#define CBLAPI
Definition: CBL_Compat.h:104
#define _cbl_nullable
Definition: CBL_Compat.h:92
#define CBL_CAPI_BEGIN
Definition: CBL_Compat.h:105
#define CBL_CAPI_END
Definition: CBL_Compat.h:106
#define CBL_PUBLIC
Definition: CBL_Compat.h:123
#define _cbl_warn_unused
Definition: CBL_Compat.h:40
CBLCollection *_cbl_nullable CBLDatabase_DefaultCollection(const CBLDatabase *db, CBLError *_cbl_nullable outError)
Returns the default collection.
_cbl_warn_unused FLMutableArray _cbl_nullable CBLCollection_GetIndexNames(CBLCollection *collection, CBLError *_cbl_nullable outError)
Returns the names of the indexes in the collection, as a Fleece array of strings.
void(* CBLCollectionChangeListener)(void *_cbl_nullable context, const CBLCollectionChange *change)
A collection change listener callback, invoked after one or more documents are changed on disk.
Definition: CBLCollection.h:415
bool CBLCollection_SetDocumentExpiration(CBLCollection *collection, FLSlice docID, CBLTimestamp expiration, CBLError *_cbl_nullable outError)
Sets or clears the expiration time of a document.
uint64_t CBLCollection_Count(const CBLCollection *collection)
Returns the number of documents in the collection.
bool CBLCollection_DeleteDocumentWithConcurrencyControl(CBLCollection *collection, const CBLDocument *document, CBLConcurrencyControl concurrency, CBLError *_cbl_nullable outError)
Deletes a document from the collection.
bool CBLCollection_PurgeDocument(CBLCollection *collection, const CBLDocument *document, CBLError *_cbl_nullable outError)
Purges a document.
CBL_PUBLIC const FLString kCBLDefaultCollectionName
The default collection's name.
bool CBLCollection_DeleteIndex(CBLCollection *collection, FLString name, CBLError *_cbl_nullable outError)
Deletes an index in the collection by name.
bool CBLDatabase_DeleteCollection(CBLDatabase *db, FLString collectionName, FLString scopeName, CBLError *_cbl_nullable outError)
Delete an existing collection.
bool CBLCollection_CreateValueIndex(CBLCollection *collection, FLString name, CBLValueIndexConfiguration config, CBLError *_cbl_nullable outError)
Creates a value index in the collection.
bool CBLCollection_SaveDocument(CBLCollection *collection, CBLDocument *doc, CBLError *_cbl_nullable outError)
Saves a (mutable) document to the collection.
CBLCollection *_cbl_nullable CBLDatabase_Collection(const CBLDatabase *db, FLString collectionName, FLString scopeName, CBLError *_cbl_nullable outError)
Returns the existing collection with the given name and scope.
bool CBLCollection_CreateFullTextIndex(CBLCollection *collection, FLString name, CBLFullTextIndexConfiguration config, CBLError *_cbl_nullable outError)
Creates a full-text index in the collection.
bool CBLCollection_DeleteDocument(CBLCollection *collection, const CBLDocument *document, CBLError *_cbl_nullable outError)
Deletes a document from the collection.
bool CBLCollection_PurgeDocumentByID(CBLCollection *collection, FLString docID, CBLError *_cbl_nullable outError)
Purges a document, given only its ID.
_cbl_warn_unused CBLListenerToken * CBLCollection_AddChangeListener(const CBLCollection *collection, CBLCollectionChangeListener listener, void *_cbl_nullable context)
Registers a collection change listener callback.
_cbl_warn_unused const CBLDocument *_cbl_nullable CBLCollection_GetDocument(const CBLCollection *collection, FLString docID, CBLError *_cbl_nullable outError)
Reads a document from the collection, creating a new (immutable) CBLDocument object.
CBLScope *_cbl_nullable CBLDatabase_Scope(const CBLDatabase *db, FLString scopeName, CBLError *_cbl_nullable outError)
Returns an existing scope with the given name.
CBLCollection *_cbl_nullable CBLDatabase_CreateCollection(CBLDatabase *db, FLString collectionName, FLString scopeName, CBLError *_cbl_nullable outError)
Create a new collection.
FLMutableArray _cbl_nullable CBLDatabase_CollectionNames(const CBLDatabase *db, FLString scopeName, CBLError *_cbl_nullable outError)
Returns the names of all collections in the scope.
CBLScope * CBLDatabase_DefaultScope(const CBLDatabase *db, CBLError *_cbl_nullable outError)
Returns the default scope.
_cbl_warn_unused CBLDocument *_cbl_nullable CBLCollection_GetMutableDocument(CBLCollection *collection, FLString docID, CBLError *_cbl_nullable outError)
Reads a document from the collection, in mutable form that can be updated and saved.
_cbl_warn_unused CBLListenerToken * CBLCollection_AddDocumentChangeListener(const CBLCollection *collection, FLString docID, CBLCollectionDocumentChangeListener listener, void *_cbl_nullable context)
Registers a document change listener callback.
FLString CBLCollection_Name(const CBLCollection *collection)
Returns the collection name.
FLMutableArray _cbl_nullable CBLDatabase_ScopeNames(const CBLDatabase *db, CBLError *_cbl_nullable outError)
Returns the names of all existing scopes in the database.
bool CBLCollection_SaveDocumentWithConflictHandler(CBLCollection *collection, CBLDocument *doc, CBLConflictHandler conflictHandler, void *_cbl_nullable context, CBLError *_cbl_nullable outError)
Saves a (mutable) document to the collection, allowing for custom conflict handling in the event that...
CBLScope * CBLCollection_Scope(const CBLCollection *collection)
Returns the scope of the collection.
bool CBLCollection_SaveDocumentWithConcurrencyControl(CBLCollection *collection, CBLDocument *doc, CBLConcurrencyControl concurrency, CBLError *_cbl_nullable outError)
Saves a (mutable) document to the collection.
struct CBLCollection CBLCollection
A collection, a document container.
Definition: CBLBase.h:194
CBLTimestamp CBLCollection_GetDocumentExpiration(CBLCollection *collection, FLSlice docID, CBLError *_cbl_nullable outError)
Returns the time, if any, at which a given document will expire and be purged.
void(* CBLCollectionDocumentChangeListener)(void *context, const CBLDocumentChange *change)
A document change listener callback, invoked after a specific document is changed on disk.
Definition: CBLCollection.h:450
struct CBLDatabase CBLDatabase
A connection to an open database.
Definition: CBLBase.h:182
CBLConcurrencyControl
Conflict-handling options when saving or deleting a document.
Definition: CBLDocument.h:35
bool(* CBLConflictHandler)(void *_cbl_nullable context, CBLDocument *_cbl_nullable documentBeingSaved, const CBLDocument *_cbl_nullable conflictingDocument)
Custom conflict handler for use when saving or deleting a document.
Definition: CBLDocument.h:56
struct CBLDocument CBLDocument
An in-memory copy of a document.
Definition: CBLBase.h:203
struct CBLListenerToken CBLListenerToken
An opaque 'cookie' representing a registered listener callback.
Definition: CBLBase.h:271
int64_t CBLTimestamp
A date/time representation used for document expiration (and in date/time queries....
Definition: CBLBase.h:123
#define CBL_REFCOUNTED(TYPE, NAME)
Definition: CBLBase.h:170
struct CBLScope CBLScope
A collection's scope.
Definition: CBLBase.h:188
struct _FLArray * FLMutableArray
A reference to a mutable array.
Definition: FLBase.h:39
Definition: CBLCollection.h:403
FLString * docIDs
The IDs of the documents that changed.
Definition: CBLCollection.h:406
unsigned numDocs
The number of documents that changed (size of the docIDs array).
Definition: CBLCollection.h:405
const CBLCollection * collection
The collection that changed.
Definition: CBLCollection.h:404
Definition: CBLCollection.h:439
const CBLCollection * collection
The collection that changed.
Definition: CBLCollection.h:440
FLString docID
The document's ID.
Definition: CBLCollection.h:441
A struct holding information about an error.
Definition: CBLBase.h:104
Full-Text Index Configuration.
Definition: CBLQuery.h:286
Value Index Configuration.
Definition: CBLQuery.h:265
A simple reference to a block of memory.
Definition: FLSlice.h:45