Q018error

Slice in a runtime query

A kind: slice parameter is used in a dynamic: runtime query.

db/queries/example.sql:1:1: error[Q018]: query "SearchAuthors": a kind: slice parameter cannot be used with dynamic: runtime, whose builder cannot expand slice placeholders
Printed by sgl from a small PostgreSQL reproduction project.

When it is reported

The runtime builder writes the WHERE clause as the program runs, and cannot expand slice placeholders inside it.

How to fix it

Filter with the builder's Where instead, or make the query static.

See it in an example

In your terminal

$ sgl explain Q018

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