11import Foundation
22import mongoc
33
4- /// Options to use when creating a `ClientSession` or `SyncClientSession` .
4+ /// Options to use when creating a `ClientSession`.
55public struct ClientSessionOptions {
66 /// Whether to enable causal consistency for this session. By default, causal consistency is enabled.
77 ///
@@ -33,7 +33,7 @@ private func withSessionOpts<T>(
3333 * A MongoDB client session.
3434 * This class represents a logical session used for ordering sequential operations.
3535 *
36- * To create a client session, use `startSession` or `withSession` on a `MongoClient` or a `SyncMongoClient` .
36+ * To create a client session, use `startSession` or `withSession` on a `MongoClient`.
3737 *
3838 * If `causalConsistency` is not set to `false` when starting a session, read and write operations that use the session
3939 * will be provided causal consistency guarantees depending on the read and write concerns used. Using "majority"
@@ -57,7 +57,7 @@ private func withSessionOpts<T>(
5757 * - https://docs.mongodb.com/manual/core/read-isolation-consistency-recency/#sessions
5858 * - https://docs.mongodb.com/manual/core/causal-consistency-read-write-concerns/
5959 */
60- public final class SyncClientSession {
60+ public final class ClientSession {
6161 /// Error thrown when an inactive session is used.
6262 internal static let SessionInactiveError = UserError . logicError ( message: " Tried to use an inactive session " )
6363 /// Error thrown when a user attempts to use a session with a client it was not created from.
@@ -86,7 +86,7 @@ public final class SyncClientSession {
8686 }
8787
8888 /// The client used to start this session.
89- public let client : SyncMongoClient
89+ public let client : MongoClient
9090
9191 /// The session ID of this session.
9292 public let id : Document
@@ -125,7 +125,7 @@ public final class SyncClientSession {
125125 public let options : ClientSessionOptions ?
126126
127127 /// Initializes a new client session.
128- internal init ( client: SyncMongoClient , options: ClientSessionOptions ? = nil ) throws {
128+ internal init ( client: MongoClient , options: ClientSessionOptions ? = nil ) throws {
129129 self . options = options
130130 self . client = client
131131
@@ -147,12 +147,12 @@ public final class SyncClientSession {
147147
148148 /// Retrieves this session's underlying connection. Throws an error if the provided client was not the client used
149149 /// to create this session, or if this session has been ended.
150- internal func getConnection( forUseWith client: SyncMongoClient ) throws -> Connection {
150+ internal func getConnection( forUseWith client: MongoClient ) throws -> Connection {
151151 guard case let . active( _, connection) = self . state else {
152- throw SyncClientSession . SessionInactiveError
152+ throw ClientSession . SessionInactiveError
153153 }
154154 guard self . client == client else {
155- throw SyncClientSession . ClientMismatchError
155+ throw ClientSession . ClientMismatchError
156156 }
157157 return connection
158158 }
@@ -205,7 +205,7 @@ public final class SyncClientSession {
205205 /// - `UserError.logicError` if this session is inactive
206206 internal func append( to doc: inout Document ) throws {
207207 guard case let . active( session, _) = self . state else {
208- throw SyncClientSession . SessionInactiveError
208+ throw ClientSession . SessionInactiveError
209209 }
210210
211211 var error = bson_error_t ( )
0 commit comments