• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

justin-millman / Kvasir / 28559885531

02 Jul 2026 01:53AM UTC coverage: 98.201% (-0.002%) from 98.203%
28559885531

push

github

justin-millman
Make Transaction Code Support Asynchronous Operations

This commit changes all of the code in the Transaction layer to operate asynchronously. In particular, all of the
query-executing operations are now async/await. This necessitated some small changes, such as abandoning the true
interfaces (such as IDbCommand) in favor of the top-level abstract base class (DbCommand), which has no functional
impact on anything. All of the transaction unit tests had to be updated as well to properly await and handle the
asynchronous nature of the execution mocks.

4491 of 4648 branches covered (96.62%)

Branch coverage included in aggregate %.

104 of 105 new or added lines in 3 files covered. (99.05%)

1 existing line in 1 file now uncovered.

7351 of 7411 relevant lines covered (99.19%)

5955.02 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Kvasir/Providers/MySQL/Connection.cs
1
using Kvasir.Transaction;
2
using MySql.Data.MySqlClient;
3
using System.Data.Common;
4
using System.Diagnostics;
5
using System.Threading.Tasks;
6

7
namespace Kvasir.Providers.MySQL {
8
    /// <summary>
9
    ///   The <see cref="IConnectionPool"/> implementation for the MySQL provider.
10
    /// </summary>
11
    internal sealed class ConnectionPool : IConnectionPool {
12
        /// <summary>
13
        ///   Creates a new MySQL <see cref="ConnectionPool"/>.
14
        /// </summary>
15
        /// <param name="server">
16
        ///   The database server.
17
        /// </param>
18
        /// <param name="database">
19
        ///   The database name.
20
        /// </param>
21
        /// <param name="username">
22
        ///   The connection username.
23
        /// </param>
24
        /// <param name="password">
25
        ///   The connection password.
26
        /// </param>
27
        public ConnectionPool(string server, string database, string username, string password) {
×
28
            Debug.Assert(server is not null && server != "");
×
29
            Debug.Assert(database is not null && database != "");
×
30
            Debug.Assert(username is not null && username != "");
×
31
            Debug.Assert(password is not null && password != "");
×
32

33
            connectionString_ = new MySqlConnectionStringBuilder() {
×
34
                Server = server,
×
35
                Database = database,
×
36
                UserID = username,
×
37
                Password = password
×
38
            }.ConnectionString;
×
39
        }
×
40

41
        /// <see cref="IConnectionPool.MakeConnectionAsync"/>
42
        public async Task<DbConnection> MakeConnectionAsync() {
43
            var connection = new MySqlConnection(connectionString_);
×
NEW
44
            await connection.OpenAsync();
×
45
            return connection;
×
UNCOV
46
        }
×
47

48

49
        private readonly string connectionString_;
50
    }
51
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc