resolveIncludeLevel normalizes and validates the `include` parameter. When empty, it defaults to "details" if a table was requested and "summary" otherwise.
(input SchemaInput)
| 277 | // resolveIncludeLevel normalizes and validates the `include` parameter. |
| 278 | // When empty, it defaults to "details" if a table was requested and "summary" otherwise. |
| 279 | func resolveIncludeLevel(input SchemaInput) (string, error) { |
| 280 | include := input.Include |
| 281 | if include == "" { |
| 282 | if input.Table != "" { |
| 283 | return schemaIncludeDetails, nil |
| 284 | } |
| 285 | return schemaIncludeSummary, nil |
| 286 | } |
| 287 | if include != schemaIncludeSummary && include != schemaIncludeColumns && include != schemaIncludeDetails { |
| 288 | return "", errors.Errorf("invalid include value %q (must be summary|columns|details)", input.Include) |
| 289 | } |
| 290 | return include, nil |
| 291 | } |
| 292 | |
| 293 | // resolveSchemaTarget runs the shared database resolver and handles the ambiguous |
| 294 | // case with elicitation fallback. Returns either a resolved database (on success) |