Skip to content
Playground(another site)

bynk.postgres.sql_invalid

Warning A literal Postgres statement does not parse with the Postgres dialect of a pure-Rust SQL parser, or is more than one command, in a project that has a schema.sql (warning: the parser is not Postgres' own, so it may refuse valid SQL).

When the project has a schema.sql at its root, Bynk parses each literal SQL statement of a Postgres capability, so a syntax error shows up when you check, not on the first request. It also flags a statement of several commands, which a prepared statement does not accept: send each with its own call, or use transaction. The parser is a pure-Rust one with a Postgres dialect, not Postgres' own, so it can refuse valid SQL, a newer or rarer form; that is why this is a warning and never blocks a build. Nothing runs, and the statement is not checked against the schema, which Bynk does not own. Correct the statement, or delete schema.sql to turn the check off.

Example

let _ <- Main.all("SELEC id FROM orders", []) // ✗ expected a statement, found SELEC
let _ <- Main.all("SELECT id FROM orders", []) // ✓

In the Book

See also

  • Every code in its category, Other, on the diagnostic index.
  • bynk explain bynk.postgres.sql_invalid shows the same from the installed toolchain, without a network.