Skip to content

Commit eef5fd9

Browse files
committed
Added module for mysql
1 parent 1d58732 commit eef5fd9

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

DirectSQL/DirectSQL.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ This .NET library is very thin database framework on top of System.Data.</Descri
1616
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
1717
</PackageReference>
1818
<PackageReference Include="IBM.Data.DB2.Core" Version="1.2.2.100" />
19+
<PackageReference Include="MySql.Data" Version="8.0.13" />
1920
<PackageReference Include="Npgsql" Version="4.0.3" />
2021
<PackageReference Include="System.Data.SqlClient" Version="4.5.1" />
2122
<PackageReference Include="System.Data.SQLite.Core.MSIL" Version="1.0.109" />

DirectSQL/MySql/MySqlDatabase.cs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Data;
4+
using System.Text;
5+
6+
using MySql.Data.MySqlClient;
7+
8+
namespace DirectSQL.MySql
9+
{
10+
public class MySqlDatabase : Database
11+
{
12+
13+
readonly private String _mySqlConnectionString;
14+
15+
public MySqlDatabase(String mySqlConnectionString)
16+
{
17+
_mySqlConnectionString = mySqlConnectionString;
18+
}
19+
20+
protected override IDbConnection CreateConnection()
21+
{
22+
return new MySqlConnection( _mySqlConnectionString );
23+
}
24+
25+
26+
public static MySqlParameter CreateMySqlParameter(string name, object value)
27+
{
28+
return new MySqlParameter(name, value);
29+
}
30+
31+
}
32+
}

0 commit comments

Comments
 (0)