mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 20:57:31 +00:00
perf: remove owner removed columns from projections for oidc (#6925)
* fix: remove owner removed columns from login names projection * fix: remove owner removed columns from flow projection * fix: remove owner removed columns from project, projectgrant and member projections * fix: correct unit tests for session projection * fix: correct unit tests for session projection
This commit is contained in:
@@ -72,10 +72,6 @@ var (
|
||||
name: projection.ProjectColumnState,
|
||||
table: projectsTable,
|
||||
}
|
||||
ProjectColumnOwnerRemoved = Column{
|
||||
name: projection.ProjectColumnOwnerRemoved,
|
||||
table: projectsTable,
|
||||
}
|
||||
)
|
||||
|
||||
type Projects struct {
|
||||
@@ -103,7 +99,7 @@ type ProjectSearchQueries struct {
|
||||
Queries []SearchQuery
|
||||
}
|
||||
|
||||
func (q *Queries) ProjectByID(ctx context.Context, shouldTriggerBulk bool, id string, withOwnerRemoved bool) (project *Project, err error) {
|
||||
func (q *Queries) ProjectByID(ctx context.Context, shouldTriggerBulk bool, id string) (project *Project, err error) {
|
||||
ctx, span := tracing.NewSpan(ctx)
|
||||
defer func() { span.EndWithError(err) }()
|
||||
|
||||
@@ -119,9 +115,6 @@ func (q *Queries) ProjectByID(ctx context.Context, shouldTriggerBulk bool, id st
|
||||
ProjectColumnID.identifier(): id,
|
||||
ProjectColumnInstanceID.identifier(): authz.GetInstance(ctx).InstanceID(),
|
||||
}
|
||||
if !withOwnerRemoved {
|
||||
eq[ProjectColumnOwnerRemoved.identifier()] = false
|
||||
}
|
||||
query, args, err := stmt.Where(eq).ToSql()
|
||||
if err != nil {
|
||||
return nil, errors.ThrowInternal(err, "QUERY-2m00Q", "Errors.Query.SQLStatment")
|
||||
@@ -134,15 +127,12 @@ func (q *Queries) ProjectByID(ctx context.Context, shouldTriggerBulk bool, id st
|
||||
return project, err
|
||||
}
|
||||
|
||||
func (q *Queries) SearchProjects(ctx context.Context, queries *ProjectSearchQueries, withOwnerRemoved bool) (projects *Projects, err error) {
|
||||
func (q *Queries) SearchProjects(ctx context.Context, queries *ProjectSearchQueries) (projects *Projects, err error) {
|
||||
ctx, span := tracing.NewSpan(ctx)
|
||||
defer func() { span.EndWithError(err) }()
|
||||
|
||||
query, scan := prepareProjectsQuery(ctx, q.client)
|
||||
eq := sq.Eq{ProjectColumnInstanceID.identifier(): authz.GetInstance(ctx).InstanceID()}
|
||||
if !withOwnerRemoved {
|
||||
eq[ProjectColumnOwnerRemoved.identifier()] = false
|
||||
}
|
||||
stmt, args, err := queries.toQuery(query).Where(eq).ToSql()
|
||||
if err != nil {
|
||||
return nil, errors.ThrowInvalidArgument(err, "QUERY-fn9ew", "Errors.Query.InvalidRequest")
|
||||
|
Reference in New Issue
Block a user