Skip to content

Enhance StatusQuery and ResourceQuery #52

Description

@browdues

What problem does this solve?

The current query functionality for StatusQuery and ResourceQuery may not fully utilize all available database fields. Some database columns exist but aren't queryable, limiting user ability to filter commands and resources.

Additionally, StatusQuery is used in contexts beyond status (such as the cancel command), so renaming it to FormaCommandQuery would improve clarity.

Database fields available and not currently queryable:

  • forma_commands table: timestamp, agent_version, agent_id
  • resources table:valid_from, command_id, operation, ksuid

Proposed solution

  1. Rename StatusQuery to FormaCommandQuery:
  • Update type definition in internal/metastructure/datastore/datastore.go
  • Update all usages (querier, datastore implementations, cancel command, API endpoints, etc)
  1. Add support for querying additional database fields:
  • Review which missing fields (see above) are useful to query
  • Update query parsing in internal/metastructure/querier/bluge_querier.go
  • Update SQL implementations in both SQLite and PostgreSQL datastores

Important: Ensure backward compatibility with existing queries throughout implementation. Focus on adding fields that have clear use cases and are indexed in the database for performance.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions