When using sqlite3 through adb shell arrow keys, instead of moving the cursor to the desired position or summoning the history facility, the following is showed
A workaround would be to use a local version of SQLite with readline support.
Copy a database file from your device to your local machine:
adb pull
Use your local version of SQLite to access the database file:
sqlite3
If you made changes you can transfer them to the device. Copy your local database file from your local machine to your device:
sqlite3