connect method
Creates a new connection to the client
Implementation
@override
Future<void> connect(
String userId, {
DatabaseProvider? databaseProvider, // Used only for testing
}) async {
if (db != null) {
throw Exception(
'An instance of StreamChatDatabase is already connected.\n'
'disconnect the previous instance before connecting again.',
);
}
_logger.info('connect');
db = databaseProvider?.call(userId, _connectionMode) ??
await _defaultDatabaseProvider(userId, _connectionMode);
}