(t *testing.T)
| 498 | } |
| 499 | |
| 500 | func 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 | |
| 516 | func TestHandleExtractMetadata_ComplexJoin(t *testing.T) { |
| 517 | ctx := context.Background() |
nothing calls this directly
no test coverage detected