# Problem with sqlite3

**URL:** <https://www.ruby-forum.com/t/problem-with-sqlite3/166107>\
**Category:** Rails\
**Created:** [April 21, 2009, 11:32pm UTC](https://www.ruby-forum.com/t/problem-with-sqlite3/166107 "2009-04-21T23:32:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhargavi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/cab0a1/32.png) [@bhargavi](https://www.ruby-forum.com/u/bhargavi)\
**Post date:** [April 21, 2009, 11:32pm UTC](https://www.ruby-forum.com/t/problem-with-sqlite3/166107/1 "2009-04-21T23:32:17Z")

</div>

Hi all,

I am relatively new to ruby and RoR. I created a simple rails proj named  
foo by giving command  
-\> rails foo --database=sqlite3  
It created a new rails proj… So in that I created a simple db class  
named user by using the below command  
-\> ruby script/generate model user  
so in db/migrate I got a file named 20090421211825\_create\_users.rb  
created.  
and in app/models : user.rb got created.  
in user.rb… i have written like this

class User \< ActiveRecord::Base  
validate\_uniqueness :userid  
validate\_presence\_of :username  
end

in 20090421211825\_create\_users.rb, its like this

class CreateUsers \< ActiveRecord::Migration  
def self.up  
create\_table :users do |t|  
t.integer :userid  
t.string :username, :limit =\> 32  
t.timestamps  
end  
end

def self.down  
drop\_table :users  
end  
end

after I am done… I did rake db:migrate version=20090421211825

# == CreateUsers: migrating

# – create\_table(:users) -\> 0.0014s == CreateUsers: migrated (0.0018s)

I got schema.rb in db/migrate specifying the CREATE statement of the  
USER…  
now, I want to see whether my table exists in the db by just giving  
-\> sqlite3  
SQLite version 3.4.0  
Enter “.help” for instructions  
sqlite\> .tables  
sqlite\>

I am not getting my table… I don’t know whats wrong with that…Am I  
looking into the correct place… Did I do correctly??

If anyone knows, please suggest me what to do …your response is  
highly appreciated

Thanks,  
Bhargavi.

---

<div class="post-metadata">

**Author:** ![bhargavi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/cab0a1/32.png) [@bhargavi](https://www.ruby-forum.com/u/bhargavi)\
**Post date:** [April 22, 2009, 12:52am UTC](https://www.ruby-forum.com/t/problem-with-sqlite3/166107/2 "2009-04-22T00:52:55Z")

</div>

On Apr 21, 10:32 pm, Bhargavi V. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> looking into the correct place… Did I do correctly??  
> You need to tell sqlite3 which database to look at - pass the path to  
> your database file as the first argument (eg sqlite3 db/  
> development.sqlite3 )

Fred

---

<div class="post-metadata">

**Author:** ![bhargavi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/cab0a1/32.png) [@bhargavi](https://www.ruby-forum.com/u/bhargavi)\
**Post date:** [April 22, 2009, 1:22am UTC](https://www.ruby-forum.com/t/problem-with-sqlite3/166107/3 "2009-04-22T01:22:20Z")

</div>

Frederick C. wrote:

> On Apr 21, 10:32ï¿½pm, Bhargavi V. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> wrote:
> 
> > looking into the correct place… Did I do correctly??  
> > You need to tell sqlite3 which database to look at - pass the path to  
> > your database file as the first argument (eg sqlite3 db/  
> > development.sqlite3 )
> 
> Fred

Hi Fred,

Thanks a lot!!! now I can see my tables… 🙂

Thanks,  
Bhargavi.
