DatabaseConfiguration
public struct DatabaseConfiguration
Configuration for opening a database.
-
Path to the directory to store the database in.
Declaration
Swift
public var directory: String
-
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.
Declaration
Swift
public var fullSync: Bool
-
Enables or disables memory-mapped I/O. By default, memory-mapped I/O is enabled. Disabling it may affect database performance. Typically, there is no need to modify this setting.
Note
Memory-mapped I/O is always disabled to prevent database corruption on macOS. As a result, setting this configuration has no effect on the macOS platform.Declaration
Swift
public var mmapEnabled: Bool
-
The key to encrypt the database with.
Declaration
Swift
public var encryptionKey: EncryptionKey?
-
Initializes a DatabaseConfiguration’s builder with default values.
Declaration
Swift
public init()
-
Initializes a DatabaseConfiguration’s builder with the configuration object.
Declaration
Swift
public init(config: DatabaseConfiguration?)
-
[false] Full sync is off by default because the performance hit is seldom worth the benefit
Declaration
Swift
static let defaultFullSync: Bool
-
[false] Memory mapped database files are disabled by default. Always disabled for macOS.
Declaration
Swift
static let defaultMmapEnabled: Bool