mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
- 优化 Contains 表达式解析为 where in 自动拆分,防止大于 1000 的 SQL 错误;
This commit is contained in:
@ -137,9 +137,9 @@ namespace FreeSql.Odbc.PostgreSQL
|
||||
tsc.SetMapColumnTmp(null).SetMapTypeReturnOld(oldMapType);
|
||||
//判断 in 或 array @> array
|
||||
if (left.StartsWith("array[") || left.EndsWith("]"))
|
||||
return $"{args1} in ({left.Substring(6, left.Length - 7)})";
|
||||
if (left.StartsWith("(") || left.EndsWith(")"))
|
||||
return $"{args1} in {left}";
|
||||
return $"({args1}) in ({left.Substring(6, left.Length - 7)})";
|
||||
if (left.StartsWith("(") || left.EndsWith(")")) //在各大 Provider AdoProvider 中已约定,500元素分割, 3空格\r\n4空格
|
||||
return $"(({args1}) in {left.Replace(", \r\n \r\n", $") \r\n OR ({args1}) in (")})";
|
||||
if (args1.StartsWith("(") || args1.EndsWith(")")) args1 = $"array[{args1.TrimStart('(').TrimEnd(')')}]";
|
||||
args1 = $"array[{args1}]";
|
||||
if (objExp != null)
|
||||
|
Reference in New Issue
Block a user