Merge pull request #982 from luoyunchong/microsoftdata

 增加Microsoft.Data.Sqlite.Core的实现
This commit is contained in:
2881099
2021-12-28 11:12:26 +08:00
committed by GitHub
34 changed files with 10621 additions and 1 deletions

View File

@ -366,8 +366,21 @@ namespace FreeSql.Sqlite
{
case "Abs": return $"abs({getExp(exp.Arguments[0])})";
case "Sign": return $"sign({getExp(exp.Arguments[0])})";
#if MicrosoftData
case "Floor":
{
var funExp = getExp(exp.Arguments[0]);
return $"cast({funExp} as int) - ({funExp} < cast({funExp} as int))";
};
case "Ceiling":
{
var funExp = getExp(exp.Arguments[0]);
return $"cast ({funExp} as int ) + ({funExp} > cast ({funExp} as int ))";
};
#else
case "Floor": return $"floor({getExp(exp.Arguments[0])})";
case "Ceiling": return $"ceiling({getExp(exp.Arguments[0])})";
#endif
case "Round":
if (exp.Arguments.Count > 1 && exp.Arguments[1].Type.FullName == "System.Int32") return $"round({getExp(exp.Arguments[0])}, {getExp(exp.Arguments[1])})";
return $"round({getExp(exp.Arguments[0])})";