Topic: Database.yml syntax question

In the database.yml file, what an entry like this do?

  database: db/development.sqlite3

Specifically, the 'db/' bit has me baffled. Is that a sqlite thing?
All other examples have a simple name like

  database: oss_development


Re: Database.yml syntax question

Yes it is a SQLite thing. SQLite is a file-based database. The whole thing lives in that one file and Rails needs to know where that file is so it can use it.

Re: Database.yml syntax question

joec: the "db/" bit is the directory to store the database file in.

SQLite works differently to MySQL, Postgress et al.  The way it works is you tell SQL Lite where the file is that you want created to be your database.

When the SQL server connection in rails starts up, it looks to that location and either opens an existing file, or creates a new one.

In this case, you are telling it to make or use the file "development.sqlite3" in the directory "db" which is off the "root" directory of your Rails project.

Hope that clears it up.


Re: Database.yml syntax question

Thanks to everyone. And someone even posted the key bit: to which directory is the path rooted?
Thanks and Good on ya!