Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQLite Table not saving

Tags:

sqlite

I have a query regarding SQLite. I am running it on Mac OS X. I created a table, added, deleted rows,columns values and everything is working fine. But when i close the terminal and exit, and reopen the terminal again, the table that i created previously is no longer there. is thi sthe normal behaviour like session only or am i going wrong somewhere.

like image 684
Mithun Nair Avatar asked Jan 21 '23 11:01

Mithun Nair


1 Answers

Are you connecting to a database by name. If not by default the sqlite3 engine will create an in-memory database, and that will disappear once you disconnect.

Try starting your session with something like this:

sqlite3 my_database.litedb
like image 54
My Other Me Avatar answered Jan 29 '23 09:01

My Other Me