I have this query:
let sql = "SELECT *, (SELECT volledige_naam, id FROM ->player->member) as playing FROM type::thing($tb, $id);";
let vars: BTreeMap<String, Value> =map![
"tb".into() => record_id.tb.to_owned().into(),
"id".into() => record_id.id.to_owned().into(),
];
let ress = db.ds.execute(&sql, &db.ses, Some(vars)).await?;
which works fine, but a want to also use parameters for player and member instead of hardcoding.
I would think for member I could insert a table like type::table($member), but this doesn’t work. Also the player should be a parameter. I tried different types::*, but without success.
I can get it to work with format!() of course, but that doesn’t seem right.
How should I do this?
jan winsemius is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.