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

Function BenchmarkExtractMetadata

pkg/gosqlx/extract_test.go:799–816  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

797}
798
799func BenchmarkExtractMetadata(b *testing.B) {
800 sql := `SELECT
801 u.name,
802 COUNT(o.id) as order_count,
803 UPPER(u.email)
804 FROM users u
805 LEFT JOIN orders o ON u.id = o.user_id
806 WHERE u.active = true
807 GROUP BY u.name, u.email
808 HAVING COUNT(o.id) > 5
809 ORDER BY order_count DESC`
810 astNode, _ := Parse(sql)
811
812 b.ResetTimer()
813 for i := 0; i < b.N; i++ {
814 _ = ExtractMetadata(astNode)
815 }
816}
817
818// Test edge cases
819func TestExtractTables_NoTables(t *testing.T) {

Callers

nothing calls this directly

Calls 2

ParseFunction · 0.85
ExtractMetadataFunction · 0.85

Tested by

no test coverage detected