#define NODISCARD
Definition CompilerSupport.h:59
#define CBL_CORE_API
Definition c4Compat.h:134
#define C4NULLABLE
Definition c4Compat.h:38
#define C4API
Definition c4Compat.h:114
#define C4_ASSUME_NONNULL_BEGIN
Definition c4Compat.h:36
#define C4API_END_DECLS
Definition c4Compat.h:116
#define C4API_BEGIN_DECLS
Definition c4Compat.h:115
#define C4_ASSUME_NONNULL_END
Definition c4Compat.h:37
int64_t C4Timestamp
A date/time representation used for document expiration (and in date/time queries....
Definition c4Base.h:96
uint64_t C4SequenceNumber
A database sequence number, representing the order in which a revision was created.
Definition c4Base.h:91
struct C4Collection C4Collection
Opaque handle to a namespace of documents in an opened database.
Definition c4Base.h:126
struct C4Database C4Database
Opaque handle to an opened database.
Definition c4Base.h:136
CBL_CORE_API C4Timestamp c4coll_nextDocExpiration(C4Collection *)
Returns the time at which the next document expiration in this collection should take place,...
NODISCARD CBL_CORE_API C4Collection * c4db_createCollection(C4Database *db, C4CollectionSpec spec, C4Error *outError)
Creates and returns an empty collection with the given name & scope.
CBL_CORE_API bool c4db_hasCollection(C4Database *db, C4CollectionSpec spec)
Returns true if the collection exists.
CBL_CORE_API uint64_t c4coll_getDocumentCount(C4Collection *)
Returns the number of (undeleted) documents in the collection.
CBL_CORE_API C4Database * c4coll_getDatabase(C4Collection *)
Returns the database containing the collection, or NULL if the collection is invalid.
NODISCARD CBL_CORE_API C4Document * c4coll_createDoc(C4Collection *collection, C4String docID, C4Slice body, C4RevisionFlags revisionFlags, C4Error *error)
Convenience function to create a new document.
CBL_CORE_API C4Collection * c4db_getDefaultCollection(C4Database *db, C4Error *outError)
Returns the default collection, whose name is "`_default`" (kC4DefaultCollectionName).
CBL_CORE_API bool c4coll_isValid(C4Collection *)
Returns false if this collection has been deleted, or its database closed.
NODISCARD CBL_CORE_API C4Document * c4coll_putDoc(C4Collection *collection, const C4DocPutRequest *request, size_t *outCommonAncestorIndex, C4Error *outError)
A high-level Put operation, to insert a new or downloaded revision.
CBL_CORE_API bool c4db_hasScope(C4Database *db, C4String name)
Returns true if the named scope exists.
NODISCARD CBL_CORE_API C4Document * c4coll_getDoc(C4Collection *collection, C4String docID, bool mustExist, C4DocContentLevel content, C4Error *outError)
Gets a document from the collection given its ID.
NODISCARD CBL_CORE_API FLMutableArray c4db_collectionNames(C4Database *db, C4String inScope, C4Error *outError)
Returns the names of all existing collections in the given scope, in the order in which they were cre...
CBL_CORE_API C4CollectionSpec c4coll_getSpec(C4Collection *)
Returns the name and scope of the collection.
NODISCARD CBL_CORE_API bool c4coll_moveDoc(C4Collection *collection, C4String docID, C4Collection *toCollection, C4String newDocID, C4Error *error)
Moves a document to another collection, possibly with a different docID.
NODISCARD CBL_CORE_API bool c4coll_setDocExpiration(C4Collection *collection, C4String docID, C4Timestamp timestamp, C4Error *outError)
Sets an expiration date on a document.
NODISCARD CBL_CORE_API bool c4coll_purgeDoc(C4Collection *collection, C4String docID, C4Error *outError)
Removes all trace of a document and its revisions from the collection.
NODISCARD CBL_CORE_API FLMutableArray c4db_scopeNames(C4Database *db, C4Error *outError)
Returns the names of all existing scopes, in the order in which they were created.
CBL_CORE_API C4Timestamp c4coll_getDocExpiration(C4Collection *collection, C4String docID, C4Error *outError)
Returns the expiration time of a document, if one has been set, else 0.
NODISCARD CBL_CORE_API bool c4db_deleteCollection(C4Database *db, C4CollectionSpec spec, C4Error *outError)
Deletes the collection with the given name & scope.
NODISCARD CBL_CORE_API C4Document * c4coll_getDocBySequence(C4Collection *collection, C4SequenceNumber, C4Error *outError)
Gets a document from the collection given its sequence number.
CBL_CORE_API C4Collection * c4db_getCollection(C4Database *db, C4CollectionSpec spec, C4Error *outError)
Returns the existing collection with the given name & scope, or NULL if it doesn't exist.
NODISCARD CBL_CORE_API int64_t c4coll_purgeExpiredDocs(C4Collection *, C4Error *)
Purges all documents that have expired.
CBL_CORE_API C4SequenceNumber c4coll_getLastSequence(C4Collection *)
Returns the latest sequence number allocated to a revision.
C4DocContentLevel
Definition c4DocumentTypes.h:50
C4RevisionFlags
Definition c4DocumentTypes.h:33
struct _FLArray * FLMutableArray
A reference to a mutable array.
Definition FLBase.h:39
Full identifier of a collection in a database, including its scope.
Definition c4DatabaseTypes.h:91
Parameters for adding a revision using c4doc_put.
Definition c4DocumentTypes.h:88
Describes a version-controlled document.
Definition c4DocumentStruct.h:32
An error value.
Definition c4Error.h:133
A simple reference to a block of memory.
Definition FLSlice.h:45