I'm a fresher of rails and SQLite.
Here is my scenario:
I had sqlite3
installed on my Windows Vista machine.
A blog application code had also been implemented at c:\rails\blog
.
I brought up my command prompt and went directly to c:\rails\blog\db
.
I ran the command sqlite3
to enter the database console.
when I used the .databases
command, no database was listed out? Why?
What have I done wrong?
When you run
sqlite3
with no parameters, a temporary database is created, which will be destroyed as soon as the program exits. This is what you did.To access the database, you need to specify the name of the file that holds the database.
You must provide the database (path and) name to the sqlite3 command, e.g.,
You probably didn't open the database itself
Remember, that in SQLite a database is just a file. As long as you don't open or attach one, there is no open one. On the other hand when you just open the database
.databases
feels a kind of useless, because you know which one you just opened.