Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
write SQL code inline in your Rust program!
Example
You can write SQL almost like you are used to.
use inline_postgres as pg;
use *;
Limitations
The Rust tokenizer is designed for Rust, not SQL.
Hence, it does not know what to do with string literals delimited by single quotes ('
).
Any creation of such string literals like 'Peter Parker'
cannot be parsed by Rust and cause a compile error.
To work around this limitation, it was decided to use Rusts syntax of double quotes for the embedded SQL strings as well.
Safety
A query like SELECT * FROM PERSON WHERE FIRST_NAME = {name}
looks like it would concatenate the value directly into the query, which would be quite unsafe.
Luckily it does not do that, but instead runs the query like a prepared statement, and passes the parameters separately.
In fact, no use of the [sql!
] macro (and related ones) can result in an SQL injection attack.
It generates the SQL statements at compile time, and thus no runtime value can sneak into the query.