- 修复 Pgsql string[] 属性表达式 Contains 缺少类型转换的 SQL 语法错误;

This commit is contained in:
28810
2019-09-24 21:54:43 +08:00
parent bd83f67b7b
commit 0a3e173662
3 changed files with 15 additions and 2 deletions

View File

@ -135,7 +135,13 @@ namespace FreeSql.Odbc.PostgreSQL
if (left.StartsWith("(") || left.EndsWith(")"))
return $"{right1} in {left}";
if (right1.StartsWith("(") || right1.EndsWith(")")) right1 = $"array[{right1.TrimStart('(').TrimEnd(')')}]";
return $"({left} @> array[{right1}])";
right1 = $"array[{right1}]";
if (objExp != null)
{
var dbinfo = _common._orm.CodeFirst.GetDbInfo(objExp.Type);
if (dbinfo.HasValue) right1 = $"{right1}::{dbinfo.Value.dbtype}";
}
return $"({left} @> {right1})";
case "Concat":
if (left.StartsWith("(") || left.EndsWith(")")) left = $"array[{left.TrimStart('(').TrimEnd(')')}]";
var right2 = getExp(callExp.Arguments[argIndex]);