Browse Source

Update SqlFunc.CharIndex pgsql

pull/32/head
sunkaixuan 2 years ago
parent
commit
38aa7174f1
  1. 4
      Src/Asp.NetCore2/SqlSugar/Realization/Kdbndp/SqlBuilder/KdbndpExpressionContext.cs
  2. 4
      Src/Asp.NetCore2/SqlSugar/Realization/Oscar/SqlBuilder/OscarExpressionContext.cs
  3. 4
      Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLExpressionContext.cs

4
Src/Asp.NetCore2/SqlSugar/Realization/Kdbndp/SqlBuilder/KdbndpExpressionContext.cs

@ -104,6 +104,10 @@ namespace SqlSugar
}
public class KdbndpMethod : DefaultDbMethod, IDbMethods
{
public override string CharIndex(MethodCallExpressionModel model)
{
return string.Format(" (strpos ({1},{0})-1)", model.Args[0].MemberName, model.Args[1].MemberName);
}
public override string TrueValue()
{
return "true";

4
Src/Asp.NetCore2/SqlSugar/Realization/Oscar/SqlBuilder/OscarExpressionContext.cs

@ -98,6 +98,10 @@ namespace SqlSugar
}
public class OscarLMethod : DefaultDbMethod, IDbMethods
{
public override string CharIndex(MethodCallExpressionModel model)
{
return string.Format(" (strpos ({1},{0})-1)", model.Args[0].MemberName, model.Args[1].MemberName);
}
public override string IIF(MethodCallExpressionModel model)
{
var parameter = model.Args[0];

4
Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLExpressionContext.cs

@ -133,6 +133,10 @@ namespace SqlSugar
}
public class PostgreSQLMethod : DefaultDbMethod, IDbMethods
{
public override string CharIndex(MethodCallExpressionModel model)
{
return string.Format(" (strpos ({1},{0})-1)", model.Args[0].MemberName, model.Args[1].MemberName);
}
public override string TrueValue()
{
return "true";

Loading…
Cancel
Save