mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-16 16:50:41 +08:00
Update pgsql
This commit is contained in:
parent
be84b3a157
commit
e16032ef19
@ -441,7 +441,7 @@ namespace SqlSugar
|
||||
#endregion
|
||||
|
||||
#region Private
|
||||
private List<T> GetListOrCache<T>(string cacheKey, string sql)
|
||||
protected List<T> GetListOrCache<T>(string cacheKey, string sql)
|
||||
{
|
||||
return this.Context.Utilities.GetReflectionInoCacheInstance().GetOrCreate(cacheKey,
|
||||
() =>
|
||||
|
@ -406,8 +406,16 @@ namespace SqlSugar
|
||||
and kcu.constraint_name = tco.constraint_name
|
||||
where tco.constraint_type = 'PRIMARY KEY'
|
||||
and kcu.table_schema='public' and
|
||||
upper(kcu.table_name)=upper('{tableName}')";
|
||||
var pkList = this.Context.Ado.SqlQuery<string>(sql);
|
||||
upper(kcu.table_name)=upper('{tableName.TrimEnd('"').TrimStart('"')}')";
|
||||
List<string> pkList = new List<string>();
|
||||
if (isCache)
|
||||
{
|
||||
pkList=GetListOrCache<string>("GetColumnInfosByTableName_N_Pk"+tableName, sql);
|
||||
}
|
||||
else
|
||||
{
|
||||
pkList = this.Context.Ado.SqlQuery<string>(sql);
|
||||
}
|
||||
if (pkList.Count >1)
|
||||
{
|
||||
foreach (var item in result)
|
||||
|
@ -210,6 +210,12 @@ namespace SqlSugar
|
||||
return string.Format(" ( to_char({0},'yyyy-MM-dd')=to_char({1},'yyyy-MM-dd') ) ", parameter.MemberName, parameter2.MemberName); ;
|
||||
}
|
||||
|
||||
public override string HasValue(MethodCallExpressionModel model)
|
||||
{
|
||||
var parameter = model.Args[0];
|
||||
return string.Format("( {0} IS NOT NULL )", parameter.MemberName);
|
||||
}
|
||||
|
||||
public override string DateIsSameByType(MethodCallExpressionModel model)
|
||||
{
|
||||
var parameter = model.Args[0];
|
||||
|
Loading…
Reference in New Issue
Block a user