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

Function TestHandleParseSQL_Subquery

pkg/mcp/tools_test.go:500–514  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

498}
499
500func TestHandleParseSQL_Subquery(t *testing.T) {
501 ctx := context.Background()
502 req := makeReq(map[string]any{
503 "sql": "SELECT * FROM (SELECT id FROM users) AS sub",
504 })
505 res, err := handleParseSQL(ctx, req)
506 if err != nil {
507 t.Fatalf("unexpected error: %v", err)
508 }
509 data := unmarshalResult(t, res)
510 count, ok := data["statement_count"].(float64)
511 if !ok || count != 1 {
512 t.Errorf("expected statement_count=1, got %v", data["statement_count"])
513 }
514}
515
516func TestHandleExtractMetadata_ComplexJoin(t *testing.T) {
517 ctx := context.Background()

Callers

nothing calls this directly

Calls 5

makeReqFunction · 0.85
handleParseSQLFunction · 0.85
unmarshalResultFunction · 0.85
FatalfMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected