Skip to content

Commit

Permalink
发布x.4.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
xuejmnet committed Mar 4, 2022
1 parent 947d70f commit 4901074
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 52 deletions.
8 changes: 4 additions & 4 deletions nuget-publish.bat
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
:start
::定义版本
set EFCORE2=2.4.1.10
set EFCORE3=3.4.1.10
set EFCORE5=5.4.1.10
set EFCORE6=6.4.1.10
set EFCORE2=2.4.2.01
set EFCORE3=3.4.2.01
set EFCORE5=5.4.2.01
set EFCORE6=6.4.2.01

::删除所有bin与obj下的文件
@echo off
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,43 +69,6 @@ source.Provider is EntityQueryProvider
source.Expression))
: source;
}
/// <summary>
/// 流式聚合
/// </summary>
/// <param name="source"></param>
/// <typeparam name="TEntity"></typeparam>
/// <returns></returns>
public static IQueryable<TEntity> StreamMerge<TEntity>(this IQueryable<TEntity> source)
{
Check.NotNull(source, nameof(source));
return
source.Provider is EntityQueryProvider
? source.Provider.CreateQuery<TEntity>(
Expression.Call(
(Expression)null,
NotSupportMethodInfo.MakeGenericMethod(typeof(TEntity)),
source.Expression))
: source;
}
/// <summary>
/// 是否使用流式聚合
/// </summary>
/// <param name="source"></param>
/// <param name="isStreamMerge"></param>
/// <typeparam name="TEntity"></typeparam>
/// <returns></returns>
internal static IQueryable<TEntity> Merge<TEntity>(this IQueryable<TEntity> source,bool isStreamMerge)
{
Check.NotNull(source, nameof(source));
return
source.Provider is EntityQueryProvider
? source.Provider.CreateQuery<TEntity>(
Expression.Call(
(Expression)null,
NotSupportMethodInfo.MakeGenericMethod(typeof(TEntity)),
source.Expression))
: source;
}

/// <summary>
/// 需要Route启用HintRoute:开启提示路由的前提下手动指定表、手动指定数据源
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ public interface ICompileParameter
/// <returns></returns>
Expression GetNativeQueryExpression();
/// <summary>
/// 当前查询是否是支持的查询
/// 是否使用union all 聚合
/// </summary>
/// <returns></returns>
bool IsNotSupport();
bool UseUnionAllMerge();
/// <summary>
/// 当前查询的连接数限制
/// </summary>
Expand Down
10 changes: 5 additions & 5 deletions src/ShardingCore/Sharding/ShardingExecutors/CompileParameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class CompileParameter:ICompileParameter,IPrint
{
private readonly IShardingDbContext _shardingDbContext;
private readonly Expression _nativeQueryExpression;
private readonly bool _isNotSupport;
private readonly bool _useUnionAllMerge;
private readonly int? _maxQueryConnectionsLimit;
private readonly ConnectionModeEnum? _connectionMode;
private readonly bool? _readOnly;
Expand All @@ -34,7 +34,7 @@ public CompileParameter(IShardingDbContext shardingDbContext,Expression sharding
_nativeQueryExpression = shardingQueryableExtractParameter.Visit(shardingQueryExpression);
var extractShardingParameter = shardingQueryableExtractParameter.ExtractShardingParameter();
_shardingRouteConfigure = extractShardingParameter.ShardingQueryableAsRouteOptions?.RouteConfigure;
_isNotSupport = extractShardingParameter.IsNotSupport;
_useUnionAllMerge = extractShardingParameter.UseUnionAllMerge;
_maxQueryConnectionsLimit = extractShardingParameter.ShardingQueryableUseConnectionModeOptions?.MaxQueryConnectionsLimit;
_connectionMode = extractShardingParameter.ShardingQueryableUseConnectionModeOptions?.ConnectionMode;
if (shardingDbContext.IsUseReadWriteSeparation())
Expand All @@ -57,9 +57,9 @@ public Expression GetNativeQueryExpression()
return _nativeQueryExpression;
}

public bool IsNotSupport()
public bool UseUnionAllMerge()
{
return _isNotSupport;
return _useUnionAllMerge;
}

public int? GetMaxQueryConnectionsLimit()
Expand Down Expand Up @@ -94,7 +94,7 @@ public Action<ShardingRouteContext> GetAsRoute()

public string GetPrintInfo()
{
return $"is not support :{_isNotSupport},max query connections limit:{_maxQueryConnectionsLimit},connection mode:{_connectionMode},readonly:{_readOnly},as route:{_shardingRouteConfigure!=null},is sequence:{_isSequence},same with sharding comparer:{_sameWithShardingComparer}";
return $"is not support :{_useUnionAllMerge},max query connections limit:{_maxQueryConnectionsLimit},connection mode:{_connectionMode},readonly:{_readOnly},as route:{_shardingRouteConfigure!=null},is sequence:{_isSequence},same with sharding comparer:{_sameWithShardingComparer}";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private QueryCompilerContext(ICompileParameter compileParameter)
var compileParseResult = ShardingUtil.GetQueryCompileParseResultByExpression(_queryExpression, _shardingDbContextType);
_queryEntities = compileParseResult.QueryEntities;
_isNoTracking = compileParseResult.IsNoTracking;
_useUnionAllMerge = compileParameter.IsNotSupport();
_useUnionAllMerge = compileParameter.UseUnionAllMerge();
_maxQueryConnectionsLimit = compileParameter.GetMaxQueryConnectionsLimit();
_connectionMode = compileParameter.GetConnectionMode();
_entityMetadataManager = ShardingContainer.GetRequiredEntityMetadataManager(_shardingDbContextType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ namespace ShardingCore.Sharding.Visitors.ShardingExtractParameters
{
internal class ShardingExtParameter
{
public bool IsNotSupport { get; }
public bool UseUnionAllMerge { get; }
public ShardingQueryableAsRouteOptions ShardingQueryableAsRouteOptions { get; }
public ShardingQueryableUseConnectionModeOptions ShardingQueryableUseConnectionModeOptions { get; }
public ShardingQueryableReadWriteSeparationOptions ShardingQueryableReadWriteSeparationOptions { get; }
public ShardingQueryableAsSequenceOptions ShardingQueryableAsSequenceOptions { get; }

public ShardingExtParameter(bool isNotSupport,
public ShardingExtParameter(bool useUnionAllMerge,
ShardingQueryableAsRouteOptions shardingQueryableAsRouteOptions,
ShardingQueryableUseConnectionModeOptions shardingQueryableUseConnectionModeOptions,
ShardingQueryableReadWriteSeparationOptions shardingQueryableReadWriteSeparationOptions,
ShardingQueryableAsSequenceOptions shardingQueryableAsSequenceOptions)
{
IsNotSupport = isNotSupport;
UseUnionAllMerge = useUnionAllMerge;
ShardingQueryableAsRouteOptions = shardingQueryableAsRouteOptions;
ShardingQueryableUseConnectionModeOptions = shardingQueryableUseConnectionModeOptions;
ShardingQueryableReadWriteSeparationOptions = shardingQueryableReadWriteSeparationOptions;
Expand Down

0 comments on commit 4901074

Please sign in to comment.