mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2026-02-25 04:27:14 +08:00
Merge branch 'DotNetNext:master' into master
This commit is contained in:
@@ -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"))
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user