Skip to content

Commit

Permalink
Merge pull request #1955 from mobwiz/feature/update-dmprovider
Browse files Browse the repository at this point in the history
当前内置的 DmProvider 在连接达梦主从集群会出错,无法正常工作。改为使用官方的 Dm.Provider 后可以正常工作。
  • Loading branch information
2881099 authored Dec 26, 2024
2 parents deafd57 + bbe7380 commit 8070706
Show file tree
Hide file tree
Showing 21 changed files with 6 additions and 341 deletions.
299 changes: 0 additions & 299 deletions FreeSql/FreeSql.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Providers/FreeSql.Provider.Dameng/DamengAdo/DamengAdo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public DamengAdo(CommonUtils util, string masterConnectionString, string[] slave
SlavePools.Add(slavePool);
});
}
public override object AddslashesProcessParam(object param, Type mapType, ColumnInfo mapColumn)
public override object AddslashesProcessParam(object param, Type mapType, Internal.Model.ColumnInfo mapColumn)
{
if (param == null) return "NULL";
if (mapType != null && mapType != param.GetType() && (param is IEnumerable == false))
Expand Down
2 changes: 1 addition & 1 deletion Providers/FreeSql.Provider.Dameng/DamengCodeFirst.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ protected override string GetComparisonDDLStatements(params TypeSchemaAndName[]
{
userId = DamengConnectionPool.GetUserId(conn.Value.ConnectionString);
}
var seqcols = new List<NativeTuple<ColumnInfo, string[], bool>>(); //序列:列,表,自增
var seqcols = new List<NativeTuple<Internal.Model.ColumnInfo, string[], bool>>(); //序列:列,表,自增
var seqnameDel = new List<string>(); //要删除的序列+触发器

var sb = new StringBuilder();
Expand Down
4 changes: 2 additions & 2 deletions Providers/FreeSql.Provider.Dameng/DamengUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public DamengUtils(IFreeSql orm) : base(orm)
{
}

public override DbParameter AppendParamter(List<DbParameter> _params, string parameterName, ColumnInfo col, Type type, object value)
public override DbParameter AppendParamter(List<DbParameter> _params, string parameterName, Internal.Model.ColumnInfo col, Type type, object value)
{
if (string.IsNullOrEmpty(parameterName)) parameterName = $"p_{_params?.Count}";
var dbtype = (DmDbType?)_orm.CodeFirst.GetDbInfo(type)?.type;
Expand Down Expand Up @@ -114,7 +114,7 @@ public override string TrimQuoteSqlName(string name)
public override string QuoteWriteParamterAdapter(Type type, string paramterName) => paramterName;
protected override string QuoteReadColumnAdapter(Type type, Type mapType, string columnName) => columnName;

public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, ColumnInfo col, Type type, object value)
public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, Internal.Model.ColumnInfo col, Type type, object value)
{
if (value == null) return "NULL";
if (type.IsNumberType()) return string.Format(CultureInfo.InvariantCulture, "{0}", value);
Expand Down
16 changes: 2 additions & 14 deletions Providers/FreeSql.Provider.Dameng/FreeSql.Provider.Dameng.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,20 @@
</ItemGroup>

<ItemGroup>
<None Include="lib\DmProvider\net6.0\DmProvider.dll" Pack="true" PackagePath="\lib\net6.0\" />
<None Include="lib\DmProvider\netstandard2.0\DmProvider.dll" Pack="true" PackagePath="\lib\netstandard2.0\" />
<None Include="lib\DmProvider\netcoreapp3.1\DmProvider.dll" Pack="true" PackagePath="\lib\netcoreapp3.1\" />
<None Include="lib\DmProvider\net45\DmProvider.dll" Pack="true" PackagePath="\lib\net45\" />
<None Include="lib\DmProvider\net40\DmProvider.dll" Pack="true" PackagePath="\lib\net40\" />
<None Include="lib/**/*.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="DM.DmProvider" Version="8.3.1.28188" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="5.0.0" Condition="'$(TargetFramework)' == 'netcoreapp3.1'" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="5.0.0" Condition="'$(TargetFramework)' == 'netstandard2.0'" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\FreeSql\FreeSql.csproj" />
</ItemGroup>

<ItemGroup>
<Reference Include="DmProvider">
<HintPath>lib\DmProvider\netstandard2.0\DmProvider.dll</HintPath>
<Private>false</Private>
</Reference>
</ItemGroup>

</ItemGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0' or '$(TargetFramework)' == 'netcoreapp3.1' or '$(TargetFramework)' == 'netstandard2.0'">
<DefineConstants>ns20;netstandard20</DefineConstants>
</PropertyGroup>
Expand Down

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 8070706

Please sign in to comment.