Skip to content
Playground(another site)

bynk.mysql.sql_invalid

Warning A literal MySql statement does not parse with the MySQL 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 MySQL's 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 MySql capability, so a syntax error shows up when you check, not on the first request. It also flags a statement of several commands, which the driver does not accept: send each with its own call, or use transaction. The parser is a pure-Rust one with a MySQL dialect, not MySQL's own (and MariaDB has forms of its own), so it can refuse valid SQL; 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 _ <- Legacy.all("SELEC id FROM orders", []) // ✗ expected a statement, found SELEC
let _ <- Legacy.all("SELECT id FROM orders", []) // ✓

In the Book

See also

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