Exposing that much of your internal implementation details could be very problematic.
You would not expose the internal implementation, you would simply accept SQL queries, maybe against a separate view of your SQL database, or maybe against a custom backend.
SQL shuould be the query languange, not the implementation.