Q047error

optional needs one

optional: true is set on a query where it means nothing.

db/queries/example.sql:1:1: error[Q047]: query "ListAuthors" sets optional: true but optional applies only to command:one, not command "many". Remove optional or use a static command:one.
Printed by sgl from a small PostgreSQL reproduction project.

When it is reported

optional only applies to a static one query, where it turns a missing row into (row, false, nil).

How to fix it

Remove optional, or change the command to one.

See it in an example

In your terminal

$ sgl explain Q047

Look for OptionalNonOneCommand in Seagull's source to see where it is reported.