Could someone please explain to me why "sanitizing database inputs" was ever considered a good idea? Why not just add a feature in SQL like so? SELECT * FROM users WHERE username = [ ]raw-text-of-len-not-parsed-at-all E.g. SELECT * FROM users WHERE username = [21]flyin' and wavin' guy ^^^^^^^^^^^^^^^^^^^^^ these 21 chars are NOT parsed AT ALL, just taken as data I am not very familiar with SQL so you might need a dif…
How is this not "sanitizing inputs"? The basic idea behind your proposal exists and is called prepared statements. It's actually, I hope, the normal way to write queries these days. You write your query like: "SELECT * FROM users WHERE username = ?" and execute your query like "execute(query, username)". The problem? It's optional.
"Prepared statements" sounds EXACTLY like what I was thinking! I don't understand why people would ever use anything else.