- 优化 lambda 使用 a == null ? 1 : 0 支持类似这样直接判断实体的情况;

This commit is contained in:
28810
2020-08-07 01:36:11 +08:00
parent 7efe02f69c
commit 25e73117b1
11 changed files with 94 additions and 51 deletions

View File

@ -114,7 +114,7 @@ namespace FreeSql.Odbc.KingbaseES
public override string[] SplitTableName(string name) => GetSplitTableNames(name, '"', '"', 2);
public override string QuoteParamterName(string name) => $"@{name.ToUpper()}";
public override string IsNull(string sql, object value) => $"coalesce({sql}, {value})";
public override string StringConcat(string[] objs, Type[] types) => $"{string.Join(" || ", objs.Select((a, b) => b == 0 ? $"{a}::varchar" : a))}"; //First ::varchar
public override string StringConcat(string[] objs, Type[] types) => $"{string.Join(" || ", objs.Select((a, b) => b == 0 ? $"{a}::text" : a))}"; //First ::text
public override string Mod(string left, string right, Type leftType, Type rightType) => $"{left} % {right}";
public override string Div(string left, string right, Type leftType, Type rightType) => $"{left} / {right}";
public override string Now => "current_timestamp";