(t *testing.T, r *http.Request)
| 403 | } |
| 404 | |
| 405 | func checkCreateTablesRequest(t *testing.T, r *http.Request) { |
| 406 | t.Helper() |
| 407 | |
| 408 | body, err := io.ReadAll(r.Body) |
| 409 | if err != nil { |
| 410 | t.Fatal(err) |
| 411 | } |
| 412 | got := map[string]any{} |
| 413 | err = json.Unmarshal(body, &got) |
| 414 | if err != nil { |
| 415 | t.Fatal(err) |
| 416 | } |
| 417 | want := map[string]any{ |
| 418 | "tables": []any{ |
| 419 | map[string]any{ |
| 420 | "description": "Test description", |
| 421 | "is_incremental": false, |
| 422 | "name": "test_some_table", |
| 423 | "relations": []any{}, |
| 424 | "title": "Test Some Table", |
| 425 | "columns": []any{ |
| 426 | map[string]any{ |
| 427 | "name": "_cq_id", |
| 428 | "type": "uuid", |
| 429 | "description": "Internal CQ ID of the row", |
| 430 | "primary_key": false, |
| 431 | "not_null": true, |
| 432 | "unique": true, |
| 433 | "incremental_key": false, |
| 434 | }, |
| 435 | map[string]any{ |
| 436 | "name": "_cq_parent_id", |
| 437 | "type": "uuid", |
| 438 | "description": "Internal CQ ID of the parent row", |
| 439 | "primary_key": false, |
| 440 | "not_null": false, |
| 441 | "unique": false, |
| 442 | "incremental_key": false, |
| 443 | }, |
| 444 | map[string]any{ |
| 445 | "name": "column1", |
| 446 | "type": "utf8", |
| 447 | "description": "Test Column 1", |
| 448 | "primary_key": true, |
| 449 | "not_null": false, |
| 450 | "unique": false, |
| 451 | "incremental_key": false, |
| 452 | }, |
| 453 | map[string]any{ |
| 454 | "name": "column2", |
| 455 | "type": "int64", |
| 456 | "description": "Test Column 2", |
| 457 | "primary_key": false, |
| 458 | "not_null": false, |
| 459 | "unique": false, |
| 460 | "incremental_key": false, |
| 461 | }, |
| 462 | map[string]any{ |
no outgoing calls
no test coverage detected