Couchbase Lite C++
Couchbase Lite C++ API
Loading...
Searching...
No Matches
cbl::DatabaseConfiguration Class Reference

Database configuration options. More...

#include <cbl++/Database.hh>

Public Member Functions

 DatabaseConfiguration (const CBLDatabaseConfiguration &cblConfig)
 Constructs a configuration from a C CBLDatabaseConfiguration, copying the directory and (in EE) encryption key out of it.
 DatabaseConfiguration ()=default
 Default constructor: empty directory, no encryption, full-sync off.

Static Public Member Functions

static DatabaseConfiguration defaultConfiguration ()
 Returns a configuration initialized with the default settings (default directory, no encryption, full-sync off).

Public Attributes

std::string directory
 The parent directory of the database.
EncryptionKey encryptionKey
 The database's encryption key (if any)
bool fullSync {false}
 As Couchbase Lite normally configures its databases, There is a very small (though non-zero) chance that a power failure at just the wrong time could cause the most recently committed transaction's changes to be lost.

Detailed Description

Database configuration options.

Constructor & Destructor Documentation

◆ DatabaseConfiguration() [1/2]

cbl::DatabaseConfiguration::DatabaseConfiguration ( const CBLDatabaseConfiguration & cblConfig)
inline

Constructs a configuration from a C CBLDatabaseConfiguration, copying the directory and (in EE) encryption key out of it.

Parameters
cblConfigThe C configuration to copy from.

◆ DatabaseConfiguration() [2/2]

cbl::DatabaseConfiguration::DatabaseConfiguration ( )
default

Default constructor: empty directory, no encryption, full-sync off.

Member Function Documentation

◆ defaultConfiguration()

DatabaseConfiguration cbl::DatabaseConfiguration::defaultConfiguration ( )
inlinestatic

Returns a configuration initialized with the default settings (default directory, no encryption, full-sync off).

Member Data Documentation

◆ directory

std::string cbl::DatabaseConfiguration::directory

The parent directory of the database.

◆ encryptionKey

EncryptionKey cbl::DatabaseConfiguration::encryptionKey

The database's encryption key (if any)

◆ fullSync

bool cbl::DatabaseConfiguration::fullSync {false}

As Couchbase Lite normally configures its databases, There is a very small (though non-zero) chance that a power failure at just the wrong time could cause the most recently committed transaction's changes to be lost.

This would cause the database to appear as it did immediately before that transaction.

Setting this mode true ensures that an operating system crash or power failure will not cause the loss of any data. FULL synchronous is very safe but it is also dramatically slower.


The documentation for this class was generated from the following file: