What happens on my clients is they always only call custom routines on the server, and the only thing sent is username and payload.
The username is on the server side used to confirm that the user exists and lookup the 36 char alphanumeric userid which every SQL query require.
Table names are alphanumeric 40+ chars that are stored in servers side code and not tables. These table names are never returned to clients, neither are user ids. Only resulting payload is returned, and in case of errors, table names are anonymised before being stored in any error log, both on server and client side.
My main concern is if a hacker can somehow hijack the statements sent and change it to a standard SQL statement that will return a list of available tables, which is what I mean by asking if the SQL is exposed to the client side directly or not?
I am not proficient enough to test it out myself