bynk.d1.sql_invalid
Error A literal D1 statement does not prepare against the schema the binding's migrations build: a syntax error, or an unknown table or column.
Bynk prepares each literal SQL statement of a D1 capability against the schema your migrations build, applied to an empty in-memory SQLite, so a syntax error or an unknown table or column is a compile error, not a failure on the first request. Nothing runs. Correct the statement, or add the migration that creates what it names. A project whose schema is made elsewhere can turn the check off with [check] d1_sql = false.
Example
let _ <- Orders.all("SELECT id, totl FROM orders", []) // ✗ no such column: totl
let _ <- Orders.all("SELECT id, total FROM orders", []) // ✓In the Book
See also
- Every code in its category, Other, on the diagnostic index.
bynk explain bynk.d1.sql_invalidshows the same from the installed toolchain, without a network.