How to prepare a statement from the CLI interpreter?
command-line-interface, prepared-statement, sqlite
Solution
Perhaps SQL Parameters using named parameters would do the trick
sqlite> .param set :user 'jeffatwood'
sqlite> select * from Users where username = :user
should return the desired row.
Problem
How does one prepare a statement from the SQLite CLI? I have found the page Compiling An SQL Statement but it is geared more towards the ODBC interface, not the CLI interpreter. I'm hopinpg for something akin to the following: ``` sqlite> pq = prepare(SELECT * FROM Users WHERE username=?) sqlite> run(pq, 'jeffatwood') 0 | jeffatwood | hunter2 | admin sqlite> ``` Does the SQLite CLI have any such functionality? Note that I am not referring to the Bash CLI but rather SQLite's CLI interpreter or the excellent LiteCLI alternative.