ClusterDatabaseConnection
public class ClusterDatabaseConnection : DatabaseConnection
This class provides a connection to a real database cluster.
-
Declaration
Swift
public let eventLoop: EventLoop -
This type wraps an error thrown by the FoundationDB C API.
See moreDeclaration
Swift
public struct FdbApiError : Error -
This method opens a connection to a database cluster.
Throws
If we’re not able to connect to the database, this will throw a FutureError.Declaration
Swift
public init(fromClusterFile clusterPath: String? = nil, eventLoop: EventLoop) throwsParameters
clusterPathThe path to the cluster file.
-
This method starts a transaction.
Declaration
Swift
public func startTransaction() -> TransactionReturn Value
The transaction.
-
This method commits a transaction.
This must be a transaction createe on this database.
Declaration
Swift
public func commit(transaction: Transaction) -> EventLoopFuture<()>Parameters
transactionThe transaction to commit.
Return Value
A future that will fire when the transaction has finished committing. If the transaction is rejected, the future will throw an error.
View on GitHub
ClusterDatabaseConnection Class Reference