Skip to content
quarry Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: e2c70559da319297c252bcabee97b75a3e19465ba1b8aa56eecb9a61618585a7
Ticket: aa28c880b6097f5719e25e1af188244e71507c38
Ticket reports: saved, named queries over the tracker
User & Date: dmestas on 2026-08-18 21:06:50
Changes

  1. Untracked field cmimetype: "text/x-markdown"
  2. comment changed to:
    The largest gap against fossil. A tracker of any size is unusable with one list: tk holds 5,809 tickets, sqlite 1,637. What people actually want is "my open tickets", "severity>=Critical in subsystem X", "closed since the last release".
    
    ## How fossil does it
    
    A `reportfmt` table in the repository holds saved reports: `rn` (integer key), `title`, `owner`, `sqlcode`, `cols`, `mtime`, and a `jx` JSON column carrying a `tag` for stable naming. Surfaces are `/reportlist`, `/rptview`, `/rptnew`, `/rptedit`, `/rptsql`. A report is addressable three ways — by `rn`, by title, and by `jx->>tag`.
    
    The report body is literal SQL against the TICKET/TICKETCHNG tables. Column naming drives presentation: a column named `bgcolor` colours the row rather than being displayed.
    
    ## What quarry must NOT copy
    
    Storing user-authored SQL and executing it. Fossil can do this because its reports are admin-authored config on a repository the admin already controls. quarry serves 23 stores from one process with one index handle each; arbitrary SQL from a form is a read-anything primitive across a shared surface, and `ATTACH`, `pragma` and `load_extension` are all reachable from a SELECT.
    
    ## Recommended shape
    
    A **structured filter**, not SQL:
    
    - Predicates over indexed ticket fields: field, operator (is / is-not / contains / before / after), value. AND-ed, which covers essentially every real report.
    - Sort field and direction.
    - Persisted per repository in the forge OLTP (`ticket_report`: repo, tag, title, owner, spec JSON, mtime), NOT in the index — a report is authored state, not derived, so 0001 §11 says it may not live somewhere wipeable.
    - Compiled to parameterised SQL by quarry. The user chooses fields and operators from what the schema actually has; they never supply syntax.
    
    This is strictly less expressive than fossil and covers the real cases. If a genuine gap appears later, the answer is more operators, not an SQL box.
    
    ## Surfaces
    
    - `report.list`, `report.get`, `report.save`, `report.delete` ops; the query itself is `ticket.list` with a spec.
    - `/r/{repo}/ticket?report=TAG`, and a report picker beside the open/all toggle.
    - Report authoring gated at write on the repository, matching fossil admin-only reports.
    
    ## Depends on
    
    Nothing. This is pure read over the folded `ticket` and `ticket_field` tables that already exist. `ticket_field` will want an index on `(name, value)` for predicate pushdown; measure before adding it.
    
  3. severity changed to: "Important"
  4. status changed to: "Open"
  5. title changed to:
    Ticket reports: saved, named queries over the tracker
    
  6. type changed to: "Feature_Request"