sqlite supports parsing parameters for you:
$ cur.execute("select name from people where age=?;", (age,))
How can I access the resulting parsed sql? Something like:
$ age = 18
$ cur.format("select name from people where age=?;", (age,))
"select name from people where age=18;"
You can’t. There is no resulting sql to access because the query is never assembled into a single string. The sqlite library receives the sql string and the parameters separately.