Skip to content

Add actual results in the book #1895

@max-sixty

Description

@max-sixty

From #1642 (comment)

Would showing results of queries be helpful in the book? Currently we compile to SQL. For some queries, showing the actual results, executed against an artists table, might be helpful.

We would need to:

  • Producing the HTML that displays a small table of results as well as the SQL. Possibly with "tabs"? Likely there are existing approaches to this so we wouldn't have to write much HTML ourselves (though I'm not sure if there are native mdbook approaches, so we may have to embed some HTML...)
  • Run queries in the book's snapshot.rs, probably with duck-db, to generate the results. We could use prql_results as the language to hint to this file that it should produce results as well as the SQL, in the same way we use prql_no_test to avoid attempting to produce SQL.
  • Adjust some queries so they can run on the artists db we have in the playground. We don't need to adjust them all, we can do this very gradually.

Any of these would make a welcome PR. While they'd all be required in order to have this functional, we can merge individual PRs to split up the work.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions