MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / BenchmarkValidateLargeSQL

Function BenchmarkValidateLargeSQL

pkg/sql/parser/validate_test.go:122–140  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

120}
121
122func BenchmarkValidateLargeSQL(b *testing.B) {
123 // Build a large SQL query
124 var sb strings.Builder
125 sb.WriteString("SELECT ")
126 for i := 0; i < 100; i++ {
127 if i > 0 {
128 sb.WriteString(", ")
129 }
130 sb.WriteString("col_")
131 sb.WriteString(strings.Repeat("x", 5))
132 }
133 sb.WriteString(" FROM large_table WHERE id > 0")
134 sql := sb.String()
135
136 b.ResetTimer()
137 for i := 0; i < b.N; i++ {
138 _ = parser.Validate(sql)
139 }
140}

Callers

nothing calls this directly

Calls 2

ValidateFunction · 0.92
StringMethod · 0.45

Tested by

no test coverage detected