Skip to content

Add option to include inactive items in V3 metadata list APIs #212

@eazyhozy

Description

@eazyhozy

Problem

The V3 metadata list APIs currently return only active items by hardcoding .filter { it.active } in the service layer.

Use case: Users need to clean up inactive metadata (databases, tables, aliases), but the current implementation makes it impossible to discover inactive items without already knowing their exact names. The only way to retrieve an inactive item is via individual GET endpoints (e.g., /graph/v3/databases/{name}), which requires the name upfront.

Affected APIs in V3CompatService.kt:

  • getDatabases() (line 49)
  • getTables() (line 99)
  • getAliases() (line 178)

Proposed Solution

Add a query parameter to filter items by active status. Two options for the parameter design:

Option 1: status parameter

GET /graph/v3/databases?status=all
GET /graph/v3/databases?status=inactive

Values: all | active (default) | inactive

Option 2: active parameter

GET /graph/v3/databases?active=all
GET /graph/v3/databases?active=false

Values: true (default) | false | all

Both options maintain backward compatibility by defaulting to active-only behavior.

Alternatives Considered

  1. Use individual GET endpoints: Requires knowing the exact names upfront, which defeats the purpose of discovery for cleanup.
  2. Use V2 API: May have different filtering behavior, but creates inconsistency in client code.

Additional Context

This change aligns with the existing behavior of individual GET endpoints, which already return items regardless of active status.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions