@@ -59,7 +59,7 @@ func (d *DB) ConvertExprToSQL(ctx *filter.ConvertContext, expr *exprv1.Expr) err
59
59
if err != nil {
60
60
return err
61
61
}
62
- if ! slices .Contains ([]string {"create_time" , "update_time" , "visibility" , "content" }, identifier ) {
62
+ if ! slices .Contains ([]string {"creator_id" , " create_time" , "update_time" , "visibility" , "content" }, identifier ) {
63
63
return errors .Errorf ("invalid identifier for %s" , v .CallExpr .Function )
64
64
}
65
65
value , err := filter .GetConstValue (v .CallExpr .Args [1 ])
@@ -121,6 +121,23 @@ func (d *DB) ConvertExprToSQL(ctx *filter.ConvertContext, expr *exprv1.Expr) err
121
121
return err
122
122
}
123
123
ctx .Args = append (ctx .Args , valueStr )
124
+ } else if identifier == "creator_id" {
125
+ if operator != "=" && operator != "!=" {
126
+ return errors .Errorf ("invalid operator for %s" , v .CallExpr .Function )
127
+ }
128
+ valueInt , ok := value .(int64 )
129
+ if ! ok {
130
+ return errors .New ("invalid int value" )
131
+ }
132
+
133
+ var factor string
134
+ if identifier == "creator_id" {
135
+ factor = "`memo`.`creator_id`"
136
+ }
137
+ if _ , err := ctx .Buffer .WriteString (fmt .Sprintf ("%s %s ?" , factor , operator )); err != nil {
138
+ return err
139
+ }
140
+ ctx .Args = append (ctx .Args , valueInt )
124
141
}
125
142
case "@in" :
126
143
if len (v .CallExpr .Args ) != 2 {
0 commit comments