writeSchemasHeader writes the multi-schema overview header lines.
(sb *strings.Builder, sections []SchemaSection, include string)
| 690 | |
| 691 | // writeSchemasHeader writes the multi-schema overview header lines. |
| 692 | func writeSchemasHeader(sb *strings.Builder, sections []SchemaSection, include string) { |
| 693 | stats := summarizeSchemas(sections) |
| 694 | if len(stats.schemaNames) > 0 { |
| 695 | fmt.Fprintf(sb, "Schemas: %d (%s)\n", len(sections), strings.Join(stats.schemaNames, ", ")) |
| 696 | } |
| 697 | switch include { |
| 698 | case schemaIncludeColumns: |
| 699 | fmt.Fprintf(sb, "Tables: %d (showing columns) | Views: %d\n", stats.totalTables, stats.totalViews) |
| 700 | case schemaIncludeDetails: |
| 701 | fmt.Fprintf(sb, "Tables: %d (showing details) | Views: %d\n", stats.totalTables, stats.totalViews) |
| 702 | default: |
| 703 | fmt.Fprintf(sb, "Tables: %d | Views: %d | Functions: %d\n", stats.totalTables, stats.totalViews, stats.totalFunctions) |
| 704 | } |
| 705 | if stats.truncatedAny { |
| 706 | fmt.Fprintf(sb, "Truncated: some schemas hit the %d-table limit per schema. Use schema= or table= to narrow.\n", schemaTableLimit) |
| 707 | } |
| 708 | } |
| 709 | |
| 710 | // schemaStats aggregates per-schema counters for header rendering. |
| 711 | type schemaStats struct { |
no test coverage detected