A truly async SingleStore ADO.NET provider.
$ dotnet add package SingleStoreConnectorSingleStoreConnector is an ADO.NET data provider for SingleStore.
// set these values correctly for your database server
var builder = new SingleStoreConnectionStringBuilder
{
Server = "your-server",
UserID = "database-user",
Password = "P@ssw0rd!",
Database = "database-name",
};
// open a connection asynchronously
using var connection = new SingleStoreConnection(builder.ConnectionString);
await connection.OpenAsync();
// create a DB command and set the SQL statement with parameters
using var command = connection.CreateCommand();
command.CommandText = @"SELECT * FROM orders WHERE order_id = @OrderId;";
command.Parameters.AddWithValue("@OrderId", orderId);
// execute the command and read the results
using var reader = await command.ExecuteReaderAsync();
while (reader.Read())
{
var id = reader.GetInt32("order_id");
var date = reader.GetDateTime("order_date");
// ...
}
The main types provided by this library are:
SingleStoreConnection (implementation of DbConnection)SingleStoreCommand (implementation of DbCommand)SingleStoreDataReader (implementation of DbDataReader)SingleStoreBulkCopySingleStoreBulkLoaderSingleStoreConnectionStringBuilderSingleStoreConnectorFactorySingleStoreDataAdapterSingleStoreExceptionSingleStoreTransaction (implementation of DbTransaction)SingleStoreConnector is released as open source under the . Bug reports and contributions are welcome at .