Merge branch 'DotNetNext:master' into master

This commit is contained in:
huifeideshui
2025-12-19 16:00:33 +08:00
committed by GitHub
5 changed files with 11 additions and 5 deletions

View File

@@ -88,7 +88,8 @@ namespace SqlSugar
string oldOrderValue = this.OrderByValue;
string result = null;
sql = new StringBuilder();
sql.AppendFormat(SqlTemplate, "Count(*)", GetTableNameString, GetWhereValueString, GetGroupByString + HavingInfos, (Skip != null || Take != null) ? null : GetOrderByString);
var hints = this.Hints.HasValue() ? $" {this.Hints} Count(*)": "Count(*)";
sql.AppendFormat(SqlTemplate,hints, GetTableNameString, GetWhereValueString, GetGroupByString + HavingInfos, (Skip != null || Take != null) ? null : GetOrderByString);
if (IsCount)
{
if (sql.ToString().Contains("-- No table"))

View File

@@ -202,7 +202,7 @@ namespace SqlSugar
{
get
{
return " SELECT count(1) WHERE upper('{0}') IN ( SELECT upper(indexname) FROM pg_indexes )";
return " SELECT count(1) WHERE upper('{0}') IN ( SELECT upper(indexname) FROM pg_indexes WHERE schemaname = '"+GetSchema()+"' )";
}
}
protected override string IsAnyProcedureSql => throw new NotImplementedException();

View File

@@ -2,7 +2,7 @@
<package >
<metadata>
<id>SqlSugarCore</id>
<version>5.1.4.211-preview12</version>
<version>5.1.4.211-preview16</version>
<authors>sunkaixuan</authors>
<owners>果糖大数据科技</owners>
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>

View File

@@ -58,7 +58,11 @@ namespace SqlSugar
public static bool HasValue(this object thisValue)
{
if (thisValue == null || thisValue == DBNull.Value) return false;
return thisValue.ToString() != "";
if (thisValue is string s)
{
return !string.IsNullOrEmpty(s);
}
return thisValue != null;
}
public static bool HasValue(this IEnumerable<object> thisValue)

View File

@@ -9,7 +9,8 @@ namespace TDSQLForPGOBDCTest
{
Console.WriteLine("");
Console.WriteLine("#### MasterSlave Start ####");
InstanceFactory.CustomAssemblies = new System.Reflection.Assembly[] {
typeof(SqlSugar.TDSQLForPGODBC.TDSQLForPGODBCAdapter).Assembly };
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
{
ConnectionString = Config.ConnectionString,//Master Connection