At the moment I have my SQL queries as a multiline string in my Rust files.
let sql = r#"
SELECT
*
FROM
public.users
WHERE
"email" = $1
"#;
let user = match sqlx::query_as::<Postgres, User>(sql)...
Due to indentation the queries have a lot of whitespaces in them.
Is this a problem? having all this extra whitespace sent to the SQL server over and over again?
Is there any better way of keeping the SQL? or some SQL builder that would allow to have the code nice and will generate the SQL more compact and without all those extra whitespaces?
Nope. For such small pieces of data, latency is a much bigger problem (==orders of magnitude slower) than throughput. If your ping time is, say, 25ms, then any amount of data that takes less than a couple of ms to transmit (not counting latency) will be insignificant.