mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 20:57:31 +00:00
feat(storage): read only transactions (#6417)
feat(storage): read only transactions for queries (#6415) * fix: tests * bastle wie en grosse * fix(database): scan as callback * fix tests * fix merge failures * remove as of system time * refactor: remove unused test * refacotr: remove unused lines
This commit is contained in:
@@ -104,14 +104,14 @@ func (q *Queries) CustomTextList(ctx context.Context, aggregateID, template, lan
|
||||
return nil, errors.ThrowInternal(err, "QUERY-M9gse", "Errors.Query.SQLStatement")
|
||||
}
|
||||
|
||||
rows, err := q.client.QueryContext(ctx, query, args...)
|
||||
err = q.client.QueryContext(ctx, func(rows *sql.Rows) error {
|
||||
texts, err = scan(rows)
|
||||
return err
|
||||
}, query, args...)
|
||||
if err != nil {
|
||||
return nil, errors.ThrowInternal(err, "QUERY-2j00f", "Errors.Internal")
|
||||
}
|
||||
texts, err = scan(rows)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
texts.LatestSequence, err = q.latestSequence(ctx, projectsTable)
|
||||
return texts, err
|
||||
}
|
||||
@@ -134,14 +134,14 @@ func (q *Queries) CustomTextListByTemplate(ctx context.Context, aggregateID, tem
|
||||
return nil, errors.ThrowInternal(err, "QUERY-M49fs", "Errors.Query.SQLStatement")
|
||||
}
|
||||
|
||||
rows, err := q.client.QueryContext(ctx, query, args...)
|
||||
err = q.client.QueryContext(ctx, func(rows *sql.Rows) error {
|
||||
texts, err = scan(rows)
|
||||
return err
|
||||
}, query, args...)
|
||||
if err != nil {
|
||||
return nil, errors.ThrowInternal(err, "QUERY-3n9ge", "Errors.Internal")
|
||||
}
|
||||
texts, err = scan(rows)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
texts.LatestSequence, err = q.latestSequence(ctx, projectsTable)
|
||||
return texts, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user