148#ifndef C4_STRICT_COLLECTION_API
246#define kC4InfoStore C4STR("info")
249#define kC4LocalDocStore C4STR("_local")
#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_RETURNS_NONNULL
Definition c4Compat.h:40
#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 C4Database C4Database
Opaque handle to an opened database.
Definition c4Base.h:136
CBL_CORE_API uint64_t c4db_getDocumentCount(C4Database *database)
Returns the number of (undeleted) documents in the database.
NODISCARD CBL_CORE_API C4Database * c4db_openNamed(C4String name, const C4DatabaseConfig2 *config, C4Error *outError)
Opens a database given its name (without the ".cblite2" extension) and directory.
CBL_CORE_API C4StringResult c4db_getPath(C4Database *)
Returns the path of the database.
NODISCARD CBL_CORE_API bool c4db_maintenance(C4Database *database, C4MaintenanceType type, C4Error *outError)
Performs database maintenance.
NODISCARD CBL_CORE_API bool c4db_deleteNamed(C4String dbName, C4String inDirectory, C4Error *outError)
Deletes the file(s) for the database with the given name in the given directory.
NODISCARD CBL_CORE_API bool c4db_delete(C4Database *database, C4Error *outError)
Closes the database and deletes the file/bundle.
NODISCARD CBL_CORE_API bool c4db_copyNamed(C4String sourcePath, C4String destinationName, const C4DatabaseConfig2 *config, C4Error *error)
Copies a prebuilt database from the given source path and places it in the destination directory,...
NODISCARD CBL_CORE_API bool c4key_setPassword(C4EncryptionKey *encryptionKey, C4String password, C4EncryptionAlgorithm alg)
Stores a password into a C4EncryptionKey, by using the key-derivation algorithm PBKDF2 to securely co...
CBL_CORE_API C4Timestamp c4db_nextDocExpiration(C4Database *database)
Returns the timestamp at which the next document expiration should take place, or 0 if there are no d...
NODISCARD CBL_CORE_API C4Database * c4db_openAgain(C4Database *db, C4Error *outError)
Opens a new handle to the same database file as db.
CBL_CORE_API const C4DatabaseConfig2 * c4db_getConfig2(C4Database *database)
Returns the configuration the database was opened with.
NODISCARD CBL_CORE_API bool c4_shutdown(C4Error *outError)
Closes down the storage engines.
NODISCARD CBL_CORE_API bool c4db_beginTransaction(C4Database *database, C4Error *outError)
Begins a transaction.
CBL_CORE_API bool c4db_isInTransaction(C4Database *database)
Is a transaction active?
NODISCARD CBL_CORE_API bool c4db_getUUIDs(C4Database *database, C4UUID *publicUUID, C4UUID *privateUUID, C4Error *outError)
Returns the database's public and/or private UUIDs.
C4MaintenanceType
Definition c4DatabaseTypes.h:109
C4EncryptionAlgorithm
Definition c4DatabaseTypes.h:45
NODISCARD CBL_CORE_API bool c4db_close(C4Database *database, C4Error *outError)
Closes the database.
CBL_CORE_API C4String c4db_getName(C4Database *)
Returns the name of the database, as given to c4db_openNamed.
NODISCARD CBL_CORE_API int64_t c4db_purgeExpiredDocs(C4Database *db, C4Error *)
Purges all documents that have expired.
CBL_CORE_API void c4_setExtensionPath(C4String path)
NODISCARD CBL_CORE_API bool c4key_setPasswordSHA1(C4EncryptionKey *encryptionKey, C4String password, C4EncryptionAlgorithm alg)
Stores a password into a C4EncryptionKey, by using the key-derivation algorithm PBKDF2 to securely co...
CBL_CORE_API void c4db_setExtraInfo(C4Database *database, C4ExtraInfo)
Associates an arbitrary pointer with this database instance, for client use.
NODISCARD CBL_CORE_API bool c4db_endTransaction(C4Database *database, bool commit, C4Error *outError)
Commits or aborts a transaction.
CBL_CORE_API bool c4_enableExtension(C4String name, C4String extensionPath, C4Error *outError)
Asks LiteCore to look for and validate the presence of an extension given the name of the extension a...
CBL_CORE_API C4SequenceNumber c4db_getLastSequence(C4Database *database)
Returns the latest sequence number allocated to a revision.
NODISCARD CBL_CORE_API bool c4db_rekey(C4Database *database, const C4EncryptionKey *newKey, C4Error *outError)
Changes a database's encryption key (removing encryption if it's NULL.)
CBL_CORE_API bool c4db_exists(C4String name, C4String inDirectory)
Returns true if a database with the given name exists in the directory.
CBL_CORE_API C4ExtraInfo c4db_getExtraInfo(C4Database *database)
Returns the C4ExtraInfo associated with this db reference.
NODISCARD CBL_CORE_API C4RawDocument * c4raw_get(C4Database *database, C4String storeName, C4String docID, C4Error *outError)
Reads a raw document from the database.
NODISCARD CBL_CORE_API bool c4raw_put(C4Database *database, C4String storeName, C4String key, C4String meta, C4String body, C4Error *outError)
Writes a raw document to the database, or deletes it if both meta and body are NULL.
Main database configuration struct (version 2) for use with c4db_openNamed etc.
Definition c4DatabaseTypes.h:63
Encryption key specified in a C4DatabaseConfig.
Definition c4DatabaseTypes.h:57
An error value.
Definition c4Error.h:133
Contents of a raw document.
Definition c4DatabaseTypes.h:149
Definition c4DatabaseTypes.h:77
A simple reference to a block of memory.
Definition FLSlice.h:45
A heap-allocated block of memory returned from an API call.
Definition FLSlice.h:63