Skip to content

Typed error when a query requires spatial but the extension is unavailable #16

Open

Description

@cpsievert

Motivation

querychat's "maps" capability (posit-dev/querychat#323) needs to give the LLM actionable guidance when a ggsql query requires spatial features but the DuckDB spatial extension isn't available (never installed, or setup failed). Today querychat string-matches DuckDB error messages ("spatial" + "extension", or st_* catalog errors), which is fragile across DuckDB versions and only catches failures at execution time.

Proposal

Raise a dedicated exception type (e.g. SpatialExtensionError) when a query uses spatial features (DRAW spatial, ggsql:world, PROJECT TO <map>) and the spatial extension is unavailable — ideally at validate() time, since querychat already calls validate() before execute(), which would let callers gate on it without ever hitting DuckDB.

Callers can then catch a type instead of matching strings.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions