Darren Cato
Darren Cato

Reputation: 1372

How to access sqlite3 tables generated by ruby on rails rvm install

I'm learning ruby on rails by reading the "agile web development with rails" book. I installed ruby and rails using rvm. I'm using the default sqlite3 database, and generating models and tables is awesome.

I'd like to manually browse my db, just to see the structure.

So at the command line is run

sqlite3

and in the shell

.tables

nothing shows up... Where are my tables?

Upvotes: 1

Views: 521

Answers (2)

tjim
tjim

Reputation: 333

For added clarity, the reason ".tables" returned nothing is because you didn't load the database. Start sqlite3 this way:

sqlite3 pathToDatabase/databaseFileName

Upvotes: 0

rewritten
rewritten

Reputation: 16435

you want to run

rails dbconsole

or

rails db

as it will load your database etc.

Upvotes: 3

Related Questions