mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 19:17:32 +00:00
fix(user): add search query for login name (#4173)
* fix(user): add search query for login name * fix(user): change login name query to IN from EXISTS * fix(loginname): include InQuery into ListQuery with SubSelect as possible datasource * fix(user): apply suggestions from code review Co-authored-by: Livio Spring <livio.a@gmail.com> * fix: correct unit test for search query Co-authored-by: Fabi <38692350+hifabienne@users.noreply.github.com> Co-authored-by: Livio Spring <livio.a@gmail.com>
This commit is contained in:
@@ -6,7 +6,7 @@ import (
|
||||
"github.com/zitadel/zitadel/internal/errors"
|
||||
)
|
||||
|
||||
//SearchQuery defines the which and how data are queried
|
||||
// SearchQuery defines the which and how data are queried
|
||||
type SearchQuery struct {
|
||||
Columns Columns
|
||||
Limit uint64
|
||||
@@ -15,7 +15,7 @@ type SearchQuery struct {
|
||||
Tx *sql.Tx
|
||||
}
|
||||
|
||||
//Columns defines which fields of the event are needed for the query
|
||||
// Columns defines which fields of the event are needed for the query
|
||||
type Columns int32
|
||||
|
||||
const (
|
||||
@@ -36,14 +36,14 @@ func (c Columns) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
//Filter represents all fields needed to compare a field of an event with a value
|
||||
// Filter represents all fields needed to compare a field of an event with a value
|
||||
type Filter struct {
|
||||
Field Field
|
||||
Value interface{}
|
||||
Operation Operation
|
||||
}
|
||||
|
||||
//Operation defines how fields are compared
|
||||
// Operation defines how fields are compared
|
||||
type Operation int32
|
||||
|
||||
const (
|
||||
@@ -63,7 +63,7 @@ const (
|
||||
operationCount
|
||||
)
|
||||
|
||||
//Field is the representation of a field from the event
|
||||
// Field is the representation of a field from the event
|
||||
type Field int32
|
||||
|
||||
const (
|
||||
@@ -91,7 +91,7 @@ const (
|
||||
fieldCount
|
||||
)
|
||||
|
||||
//NewFilter is used in tests. Use searchQuery.*Filter() instead
|
||||
// NewFilter is used in tests. Use searchQuery.*Filter() instead
|
||||
func NewFilter(field Field, value interface{}, operation Operation) *Filter {
|
||||
return &Filter{
|
||||
Field: field,
|
||||
@@ -100,7 +100,7 @@ func NewFilter(field Field, value interface{}, operation Operation) *Filter {
|
||||
}
|
||||
}
|
||||
|
||||
//Validate checks if the fields of the filter have valid values
|
||||
// Validate checks if the fields of the filter have valid values
|
||||
func (f *Filter) Validate() error {
|
||||
if f == nil {
|
||||
return errors.ThrowPreconditionFailed(nil, "REPO-z6KcG", "filter is nil")
|
||||
|
Reference in New Issue
Block a user