I am getting this error trying to use sqlx and google literally has ONE result to try to research this from and it doesn't even apply to the situation, so I'm kinda stumped to even start trying to figure out what the issue is.
error returned from database: permission denied for table users
How did you create the sqlx client? You should be ysung a user with sufficient permissions to access the database.
Yes, that was the issue.
The user I created to be able to connect and used in the env variable did not have sufficient permissions. I had to go into psql and alter the user's permissions.
I found my solution here:
The user has access to access the database. The issue is that using query! and similar macros sqlx actually needs elevated permissions. So I had insufficient permissions for the compile time checks.