mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-11-08 02:14:53 +08:00
Update pgsql
This commit is contained in:
@@ -441,7 +441,7 @@ namespace SqlSugar
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Private
|
#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,
|
return this.Context.Utilities.GetReflectionInoCacheInstance().GetOrCreate(cacheKey,
|
||||||
() =>
|
() =>
|
||||||
|
|||||||
@@ -406,8 +406,16 @@ namespace SqlSugar
|
|||||||
and kcu.constraint_name = tco.constraint_name
|
and kcu.constraint_name = tco.constraint_name
|
||||||
where tco.constraint_type = 'PRIMARY KEY'
|
where tco.constraint_type = 'PRIMARY KEY'
|
||||||
and kcu.table_schema='public' and
|
and kcu.table_schema='public' and
|
||||||
upper(kcu.table_name)=upper('{tableName}')";
|
upper(kcu.table_name)=upper('{tableName.TrimEnd('"').TrimStart('"')}')";
|
||||||
var pkList = this.Context.Ado.SqlQuery<string>(sql);
|
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)
|
if (pkList.Count >1)
|
||||||
{
|
{
|
||||||
foreach (var item in result)
|
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); ;
|
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)
|
public override string DateIsSameByType(MethodCallExpressionModel model)
|
||||||
{
|
{
|
||||||
var parameter = model.Args[0];
|
var parameter = model.Args[0];
|
||||||
|
|||||||
Reference in New Issue
Block a user