mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-30 04:28:09 +08:00
Add Json Index
This commit is contained in:
parent
4abd77972c
commit
fb25e2da96
@ -716,6 +716,13 @@ namespace SqlSugar
|
||||
{
|
||||
return null;
|
||||
}
|
||||
public virtual string JsonIndex(MethodCallExpressionModel model)
|
||||
{
|
||||
var parameter = model.Args[0];
|
||||
var parameter1 = model.Args[1];
|
||||
return $"({parameter.MemberName}::json ->> {parameter1.MemberValue})";
|
||||
}
|
||||
|
||||
|
||||
public virtual string JsonField(MethodCallExpressionModel model)
|
||||
{
|
||||
|
@ -98,6 +98,7 @@ namespace SqlSugar
|
||||
string Exists(MethodCallExpressionModel model);
|
||||
string GetDateString(string dateValue,string format);
|
||||
string GetForXmlPath();
|
||||
string JsonIndex(MethodCallExpressionModel model);
|
||||
string JsonField(MethodCallExpressionModel model);
|
||||
string JsonContainsFieldName(MethodCallExpressionModel model);
|
||||
string JsonArrayLength(MethodCallExpressionModel model);
|
||||
|
@ -113,7 +113,10 @@ namespace SqlSugar
|
||||
{
|
||||
throw new NotSupportedException("Can only be used in expressions");
|
||||
}
|
||||
|
||||
public static string JsonIndex(object json, int jsonIndex)
|
||||
{
|
||||
throw new NotSupportedException("Can only be used in expressions");
|
||||
}
|
||||
public static string JsonField(object json, string fieldName,string includeFieldName)
|
||||
{
|
||||
throw new NotSupportedException("Can only be used in expressions");
|
||||
|
Loading…
Reference in New Issue
Block a user