mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-18 11:15:12 +00:00
event data search query
This commit is contained in:
@@ -252,6 +252,8 @@ func (db *CRDB) columnName(col repository.Field) string {
|
||||
return "editor_user"
|
||||
case repository.FieldEventType:
|
||||
return "event_type"
|
||||
case repository.FieldEventData:
|
||||
return "event_data"
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
@@ -272,6 +274,8 @@ func (db *CRDB) operation(operation repository.Operation) string {
|
||||
return ">"
|
||||
case repository.OperationLess:
|
||||
return "<"
|
||||
case repository.OperationJSONContains:
|
||||
return "@>"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package sql
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
@@ -137,6 +138,10 @@ func prepareCondition(criteria querier, filters []*repository.Filter) (clause st
|
||||
switch value.(type) {
|
||||
case []bool, []float64, []int64, []string, []repository.AggregateType, []repository.EventType, *[]bool, *[]float64, *[]int64, *[]string, *[]repository.AggregateType, *[]repository.EventType:
|
||||
value = pq.Array(value)
|
||||
case map[string]interface{}:
|
||||
var err error
|
||||
value, err = json.Marshal(value)
|
||||
logging.Log("SQL-BSsNy").OnError(err).Warn("unable to marshal search value")
|
||||
}
|
||||
|
||||
clauses[i] = getCondition(criteria, filter)
|
||||
|
||||
Reference in New Issue
Block a user