- 修复 QuestDB 表达式解析 DateTime.UtcNow bug;

This commit is contained in:
2881099 2023-06-27 18:51:14 +08:00
parent 4e6eff1cb4
commit 08e5776281
2 changed files with 3 additions and 3 deletions

View File

@ -356,7 +356,7 @@ namespace FreeSql.QuestDb
{ {
case "Now": return _common.Now; case "Now": return _common.Now;
case "UtcNow": return _common.NowUtc; case "UtcNow": return _common.NowUtc;
case "Today": return "current_date"; case "Today": return $"date_trunc('day',{_common.NowUtc})";
case "MinValue": return "'0001/1/1 0:00:00'::timestamp"; case "MinValue": return "'0001/1/1 0:00:00'::timestamp";
case "MaxValue": return "'9999/12/31 23:59:59'::timestamp"; case "MaxValue": return "'9999/12/31 23:59:59'::timestamp";
} }

View File

@ -267,8 +267,8 @@ namespace FreeSql.QuestDb
public override string StringConcat(string[] objs, Type[] types) => $"{string.Join(" || ", objs)}"; public override string StringConcat(string[] objs, Type[] types) => $"{string.Join(" || ", objs)}";
public override string Mod(string left, string right, Type leftType, Type rightType) => $"{left} % {right}"; 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 Div(string left, string right, Type leftType, Type rightType) => $"{left} / {right}";
public override string Now => "current_timestamp"; public override string Now => "sysdate";
public override string NowUtc => "(current_timestamp at time zone 'UTC')"; public override string NowUtc => "systimestamp";
public override string QuoteWriteParamterAdapter(Type type, string paramterName) => paramterName; public override string QuoteWriteParamterAdapter(Type type, string paramterName) => paramterName;
protected override string QuoteReadColumnAdapter(Type type, Type mapType, string columnName) => columnName; protected override string QuoteReadColumnAdapter(Type type, Type mapType, string columnName) => columnName;