Skip to content

docs: expand runnable query examples #5

Description

@dodok8

Objective

Add focused example documentation that shows complete schema and query inputs for the currently implemented Gelite pipeline.

The examples should make it easy to test the parser, resolver, SQLite planner, SQL renderer, and CLI REPL without reading crate-level tests first.

Motivation or use case

The project now has several language features that are covered by tests but not easy to discover from user-facing docs. Examples are especially important because Gelite is a learning project: readers should be able to connect a schema, a query, the expected pipeline behavior, and the current limitations.

Expected outcome

Documentation should include complete examples for the current select subset, including:

  • shaped select output
  • nested single-link selection
  • filter comparisons
  • boolean filters
  • path traversal filters
  • literal-list in and not in
  • ordering, limit, and offset
  • examples that can be run through gelite repl --schema or gelite repl --database

The examples should state which parts are currently inspectable only through debug output and which parts can execute against SQLite.

Scope

  • README.md: keep a short runnable example for the main workflow.
  • examples/: add or update example schema/query files if the repository already uses that pattern or if it keeps the README shorter.
  • Optional docs under docs/ if a separate examples page becomes clearer than a long README section.
  • Tests are not required unless examples are wired into an automated command.

Related specs and plans

  • spec/query.md: defines the supported query syntax and unsupported forms.
  • spec/schema.md: defines the schema syntax used by examples.
  • plan/cli-and-tooling-plan.md: describes the CLI and REPL inspection flow.

Boundaries and non-goals

  • Do not document future syntax as supported examples.
  • Do not add new query features in this issue.
  • Do not solve SQLite identifier quoting here; that is tracked separately.
  • Do not require a full tutorial or website.

Acceptance criteria

  • A reader can copy a schema and at least one query from the docs and run it through the current CLI.
  • Examples cover both a simple filter and a membership filter.
  • The docs mention current limitations where an example only validates compilation/rendering rather than full result shaping.
  • cargo test --workspace still passes if examples or docs are changed in a way that affects checked files.

Branch

Create the implementation branch after this issue exists, using issue-<issue-number>-query-examples-docs.

Checks

  • I searched existing issues for the same request or task.
  • I checked the relevant spec/ or plan/ document when one exists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions