SQLite in Terminal

SQLite is a lightweight database that is usually used for prototyping and testing during software development journey. Often times you will find yourself having to go into the database to see if database operations work as expected from your application. In this short article I will outline some of my commonly used commands while working with SQLite. While the examples that I will be covering were done on Ubuntu terminal, most of them work across different operating systems

How to open sqlite database in terminal

sqlite3 <database-file-name-with-file-extension>

e.g sqlite mydatabasefile.sqlite

The above will allow us to start querying our database from the terminal. From here you can run the usual database commands.

Exit the db console