Update SqlFunc.CharIndex pgsql

This commit is contained in:
sunkaixuan 2023-04-23 11:36:54 +08:00
parent caf9f68099
commit 38aa7174f1
3 changed files with 12 additions and 0 deletions

View File

@ -104,6 +104,10 @@ namespace SqlSugar
} }
public class KdbndpMethod : DefaultDbMethod, IDbMethods 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() public override string TrueValue()
{ {
return "true"; return "true";

View File

@ -98,6 +98,10 @@ namespace SqlSugar
} }
public class OscarLMethod : DefaultDbMethod, IDbMethods 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) public override string IIF(MethodCallExpressionModel model)
{ {
var parameter = model.Args[0]; var parameter = model.Args[0];

View File

@ -133,6 +133,10 @@ namespace SqlSugar
} }
public class PostgreSQLMethod : DefaultDbMethod, IDbMethods 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() public override string TrueValue()
{ {
return "true"; return "true";