MSP-5013 fix get by name

This commit is contained in:
komissarovyv committed 2025-03-06 14:56:01 +03:00
1 parent efc4a4ee38
commit 7852772e9d
6 files changed
+116 -23

No files matched your search

+4 -1
View File
@@ -36,7 +36,10 @@ func (r Variable) All(ctx context.Context) ([]entity.Variable, error) {
func (r Variable) GetByName(ctx context.Context, name string) (*entity.Variable, error) {
ctx = sql_metrics.OperationLabelToContext(ctx, "Variable.GetByName")
query, args, err := squirrel.Select().From(Table("variable")).Where(squirrel.Eq{"name": name}).ToSql()
query, args, err := squirrel.Select("*").
From(Table("variable")).
Where(squirrel.Eq{"name": name}).
ToSql()
if err != nil {
return nil, errors.WithMessage(err, "build query")
}