Is there a database that allows this already?
If not, here is how I think it could be done. I think it would require modifying the database software and the driver or code that is assembling the SQL query. I believe this is sometimes done by the database itself and sometimes by the driver.
A setting like 'Only Safe Parameters' would be enabled for the database user account used by the web server. If this is enabled then only parameters that are marked safe will be allowed. The network protocol of the database must have the ability for the driver to communicate that the parameters in the query were replaced by the driver safely and not by the calling code.
The user account used by an admin to do queries would not have this feature enabled because we don't use parameterized queries when doing administration.
Would this work? Is there something I'm missing?