Atlas › Test

quoted_number_string

Exact test identity: go.temporal.io/server/common/sqlquery/TestConvertSqlValue/quoted_number_string

Package
go.temporal.io/server/common/sqlquery
Suite / test hierarchy
TestConvertSqlValue/quoted_number_string
Test
quoted_number_string
Introduced at
query.go ×1 Frontier kind: Joint frontier
Covered ranges
3
Covered lines
6
Covered files
1

Co-introduced tests

2 other tests enter at the same concept.

Covered source

Expand a file to inspect source; the > gutter marks covered lines.

go.temporal.io/server/common/sqlquery/query.go 6 covered LOC · 3 ranges

Open complete file

49
50 // ParseValue returns a string, int64 or float64 if the parsing succeeds.
51 > func ParseValue(sqlValue string) (any, error) { query.go
52 > if sqlValue == "" {
53 return "", nil
54 }
55
56 > if sqlValue[0] == '\'' && sqlValue[len(sqlValue)-1] == '\'' { query.go
57 > strValue := strings.Trim(sqlValue, "'") query.go
58 > return strValue, nil
59 > }
60
61 // Unquoted value must be a number. Try int64 first.