I'm not sure if it's a module issue as I've never had this issue with SQLx so it may be a query problem. Have you outputted your queries in a log file to confirm they are formatted correctly?
It's hard for anyone to troubleshoot with only parts of the code. I am not going to spend the time to fill in the blanks to get it to compile and test.