The codes:==============
// very complex where clause combined from several
let query: String = String.from("where ..........");runtime variables.
error: expected string literal
--> src/abc.rs:80:25
|
80 | let rows_num: i64 = sqlx::query!(
| ____________^
81 | | &*query,
82 | | ).fetch_one(connection)
| |^
|
= note: this error originates in the macro sqlx::query
(in Nightly builds, run with -Z macro-backtrace for more info)
//========================
And the doc states:
- The query must be a string literal or else it cannot be introspected (and thus cannot be dynamic or the result of another macro).
I know the sqlx computes at compile time, my where clause computation is at run time.
I really want to use variable, because the where clause depends other several conditions.
Are there any ways to use variable in sqlx?