bynk.types.sql_statement_at_boundary
Error A bynk.cloudflare SqlStatement, PgStatement or MySqlStatement appears in a storable or boundary-crossing position, or as a Json codec target — a statement from outside would carry SQL that was never a literal (standard-library P4c).
A SqlStatement, PgStatement or MySqlStatement is a statement a database capability runs, whose SQL the compiler requires to be a literal, so that request data is only ever bound as a parameter. One restored from storage or received from a caller would carry SQL that was never a literal, so it is refused as a record, sum or event field, an agent store field, a handler parameter or result, or a Json codec target. A capability operation's signature may name one. Keep or send the values instead, and build the statement where it runs.
Example
type Job = { statement: SqlStatement, // ✗ SQL that was never a literal}
type Job = { id: String, // ✓ send the value, build the statement where it runs}In the Book
See also
- Every code in its category, Type checking, on the diagnostic index.
bynk explain bynk.types.sql_statement_at_boundaryshows the same from the installed toolchain, without a network.