Support custom database

This commit is contained in:
sunkaixuna 2022-01-25 17:25:28 +08:00
parent 2eb902b6a8
commit f4092607c9
4 changed files with 34 additions and 2 deletions

View File

@ -14,6 +14,9 @@ namespace SqlSugar
PostgreSQL,
Dm,
Kdbndp,
Oscar
Oscar,
MySqlConnector,
Access,
Custom=900
}
}

View File

@ -25,13 +25,25 @@ namespace SqlSugar
{
return new SqlServerQueryable<T>();
}
else if (currentConnectionConfig.DbType == DbType.MySql)
else if (currentConnectionConfig.DbType == DbType.MySql)
{
return new MySqlQueryable<T>();
}
else if (currentConnectionConfig.DbType == DbType.PostgreSQL)
{
return new PostgreSQLQueryable<T>();
}
else if (currentConnectionConfig.DbType == DbType.MySqlConnector)
{
return CustomProvider.GetQueryable<T>("MySql", "SqlSugar.MySqlConnector");
}
else if (currentConnectionConfig.DbType == DbType.Access)
{
return CustomProvider.GetQueryable<T>("MySql", "SqlSugar.Access");
}
else if (currentConnectionConfig.DbType == DbType.Custom)
{
return CustomProvider.GetQueryable<T>("DbType.Custom", "DbType.Custom");
}
else
{

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SqlSugar
{
public class CustomProvider
{
internal static ISugarQueryable<T> GetQueryable<T>(string dbName, string dllName)
{
throw new NotImplementedException();
}
}
}

View File

@ -102,6 +102,7 @@
<Compile Include="Interface\IFastBuilder.cs" />
<Compile Include="Interface\IFastest.cs" />
<Compile Include="OnlyNet\OracleFastBuilder.cs" />
<Compile Include="Realization\Custom\CustomProvider.cs" />
<Compile Include="Realization\MySql\SqlBuilder\MySqlFastBuilder.cs" />
<Compile Include="Realization\PostgreSQL\SqlBuilder\PostgreSQLFastBuilder.cs" />
<Compile Include="Realization\Sqlite\SqlBuilder\SqliteFastBuilder.cs" />