Queries in app code use placeholders like :email. Trying one in the shell then means replacing them by hand. The sqlite3 shell can bind them for you.
sqlite> .parameter set :mail '[email protected]'
sqlite> SELECT id FROM users WHERE email = :mail;
1
sqlite> .parameter list
:mail '[email protected]'
Names can start with :, @ or $, the same styles SQLite accepts in code, and numbered ones like ?1 work too. .parameter list shows what is set, .parameter unset :mail removes one and .parameter clear removes all of them.
I like it because you can paste a query from the code unchanged, and a value with quotes in it is passed as data, so there’s no escaping to get wrong.
The value is evaluated as SQL first, which trips people up. 42 becomes a number and a plain word becomes text, but .parameter set :d 2026-01-01 stores 2024, because that is valid arithmetic. Quote dates and strings to be safe. The parameters live in a temporary table called sqlite_parameters, so they last for the session, and any placeholder you did not set is bound as NULL. That last one is sneaky: the query runs fine and finds nothing.
Further reading: Command Line Shell For SQLite (.parameter)