@@ -121,6 +121,7 @@ final class ConnectionStorage {
121121 groupId: connection. groupId,
122122 safeModeLevel: connection. safeModeLevel,
123123 aiPolicy: connection. aiPolicy,
124+ mongoAuthSource: connection. mongoAuthSource,
124125 mongoReadPreference: connection. mongoReadPreference,
125126 mongoWriteConcern: connection. mongoWriteConcern,
126127 redisDatabase: connection. redisDatabase,
@@ -368,6 +369,14 @@ private struct StoredConnection: Codable {
368369 // AI policy
369370 let aiPolicy : String ?
370371
372+ // MongoDB-specific
373+ let mongoAuthSource : String ?
374+ let mongoReadPreference : String ?
375+ let mongoWriteConcern : String ?
376+
377+ // Redis-specific
378+ let redisDatabase : Int ?
379+
371380 // MSSQL schema
372381 let mssqlSchema : String ?
373382
@@ -413,6 +422,14 @@ private struct StoredConnection: Codable {
413422 // AI policy
414423 self . aiPolicy = connection. aiPolicy? . rawValue
415424
425+ // MongoDB-specific
426+ self . mongoAuthSource = connection. mongoAuthSource
427+ self . mongoReadPreference = connection. mongoReadPreference
428+ self . mongoWriteConcern = connection. mongoWriteConcern
429+
430+ // Redis-specific
431+ self . redisDatabase = connection. redisDatabase
432+
416433 // MSSQL schema
417434 self . mssqlSchema = connection. mssqlSchema
418435
@@ -431,7 +448,9 @@ private struct StoredConnection: Codable {
431448 case color, tagId, groupId
432449 case safeModeLevel
433450 case isReadOnly // Legacy key for migration reading only
434- case aiPolicy, mssqlSchema, oracleServiceName, startupCommands
451+ case aiPolicy
452+ case mongoAuthSource, mongoReadPreference, mongoWriteConcern, redisDatabase
453+ case mssqlSchema, oracleServiceName, startupCommands
435454 }
436455
437456 func encode( to encoder: Encoder ) throws {
@@ -460,6 +479,10 @@ private struct StoredConnection: Codable {
460479 try container. encodeIfPresent ( groupId, forKey: . groupId)
461480 try container. encode ( safeModeLevel, forKey: . safeModeLevel)
462481 try container. encodeIfPresent ( aiPolicy, forKey: . aiPolicy)
482+ try container. encodeIfPresent ( mongoAuthSource, forKey: . mongoAuthSource)
483+ try container. encodeIfPresent ( mongoReadPreference, forKey: . mongoReadPreference)
484+ try container. encodeIfPresent ( mongoWriteConcern, forKey: . mongoWriteConcern)
485+ try container. encodeIfPresent ( redisDatabase, forKey: . redisDatabase)
463486 try container. encodeIfPresent ( mssqlSchema, forKey: . mssqlSchema)
464487 try container. encodeIfPresent ( oracleServiceName, forKey: . oracleServiceName)
465488 try container. encodeIfPresent ( startupCommands, forKey: . startupCommands)
@@ -506,6 +529,10 @@ private struct StoredConnection: Codable {
506529 safeModeLevel = wasReadOnly ? SafeModeLevel . readOnly. rawValue : SafeModeLevel . silent. rawValue
507530 }
508531 aiPolicy = try container. decodeIfPresent ( String . self, forKey: . aiPolicy)
532+ mongoAuthSource = try container. decodeIfPresent ( String . self, forKey: . mongoAuthSource)
533+ mongoReadPreference = try container. decodeIfPresent ( String . self, forKey: . mongoReadPreference)
534+ mongoWriteConcern = try container. decodeIfPresent ( String . self, forKey: . mongoWriteConcern)
535+ redisDatabase = try container. decodeIfPresent ( Int . self, forKey: . redisDatabase)
509536 mssqlSchema = try container. decodeIfPresent ( String . self, forKey: . mssqlSchema)
510537 oracleServiceName = try container. decodeIfPresent ( String . self, forKey: . oracleServiceName)
511538 startupCommands = try container. decodeIfPresent ( String . self, forKey: . startupCommands)
@@ -550,6 +577,10 @@ private struct StoredConnection: Codable {
550577 groupId: parsedGroupId,
551578 safeModeLevel: SafeModeLevel ( rawValue: safeModeLevel) ?? . silent,
552579 aiPolicy: parsedAIPolicy,
580+ mongoAuthSource: mongoAuthSource,
581+ mongoReadPreference: mongoReadPreference,
582+ mongoWriteConcern: mongoWriteConcern,
583+ redisDatabase: redisDatabase,
553584 mssqlSchema: mssqlSchema,
554585 oracleServiceName: oracleServiceName,
555586 startupCommands: startupCommands
0 commit comments