Simply Create a SQLite3 Table in Ruby on Rails Tutorial and Example

Simply Create a SQLite3 Table in Ruby on Rails Tutorial and Example


The SQLite3 flat file database is used to store information in a file within your application directory rather than a database server, such as MySQL. This format is useful for backing up data with your application, and is ideal for a smaller program that needs only limited database use. Ruby on Rails lets you incorporate SQLite3 table generation within the program's console. You must have the SQLite3 module installed to complete this task.

Instructions
1
Open the "Start" menu and type "command prompt" into the Start menu's search field. Select "Command Prompt" from the list of options.

2
Type "gem install sqlite3" to install the SQLite Ruby package.

Sponsored Links

HTML Editor - Download
Edit, format, validate, preview & publish HTML. Download now!
www.ultraedit.com/HTML-Editor
3
Type "sqlite db\<name>" without quotation marks. Replace "<name>" with the name of the SQLite3 database you'd like to create. This will take you to a console window for creating SQLite3 tables.

4
Type "create table <name>" without quotation marks. Replace "<name>" with the name of the table you'd like to create, such as "create table articles."



Read more: http://www.ehow.com/how_12107765_create-sqlite3-table-ruby-rails.html#ixzz34JPX5HcT

Comments