Skip to content

A POST endpoint cannot serve a read: a single-SELECT template with returns-data answers data: [] #271

Backlog

Description

@jrosskopf

Found while fixing the vector-search examples on the landing page (DataZooDE/flapi-landingpage#6), and verified with the 26.11.25 binary.

Every POST/PUT/PATCH/DELETE endpoint takes the write path (DatabaseManager write execution, src/database_manager.cpp around 2446-2490):

  • A template that is a single SELECT answers {"rows_affected": 0}.
  • With operation.returns-data: true it answers "data": []. The trailing-SELECT branch only runs when statements.size() > 1, so the rows of a one-statement SELECT are never returned.

A search endpoint commonly takes its input as a POST body: an embedding vector, a long filter, anything too large for a query string. Today it only works with a workaround: a leading SET VARIABLE ...; so that the SELECT becomes a second statement, read back via getvariable().

Options:

  1. With returns-data: true, return the rows of the last statement when it is a SELECT, even when it is the only statement.
  2. Honour operation.type: Read on a POST, so that it runs the read path (validators, rendering, no transaction or write-cache maintenance). CONFIG_REFERENCE §8.1 lists operation.type as "auto-detected", but it is unclear whether an explicit Read is respected for POST.

Whichever is chosen also needs:

  • the MCP behaviour of such a tool (tools/call currently returns the write result);
  • an update to CONFIG_REFERENCE §8;
  • an update to the landing-page vector-search examples, to drop the SET VARIABLE workaround.

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