I wonder if annotations and annotation pre-processors could have been an alternate way to approach this had they been applicable to String constants.
String name = "Joan";
PreparedStatement query = @SQL "select * from users where firstname = \{name}";