Uploaded image for project: 'PuppetDB'
  1. PuppetDB
  2. PDB-657

Refactor query logic to separate SQL generation from query object types

    Details

    • Type: Task
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PDB 2.1.0
    • Component/s: None
    • Labels:
      None

      Description

      Currently the code combines query operators (such as = or ~ for regex) with the fields they operate on (reports.certname) and the logical objects they query on (i.e. resources). This has required code duplication between the various supported queryable entities. Places where that code has not been duplicated (or has been changed slightly) leads to some endpoints (i.e. reports) having support for very few operators and other endpoints having similar operators, but slightly different ways in which values are fed into the query (i.e. from an aliased column, subquery or join) which are different depending on when/how the query is executed.

      This ticket is taking a run at creating a higher fidelity internal language that the user provided query can be expanded into. From this we can use a single set of operators and a specified context for the logical entities queried to translate that internal language/data structure into SQL. The ticket will be successful with a proof of concept implementation of one of the current endpoints in the new structure.

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  ryan.senior Ryan Senior
                  Reporter:
                  ryan.senior Ryan Senior
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: