Sunday, March 30, 2008

sqlite3 - commiting to the memory bank

How-To write data to a sqlite database.


natasha:~/rails/azure/db briandunbar$ sqlite3 development.sqlite3 "select * from stuff";
natasha:~/rails/azure/db briandunbar$ sqlite3 development.sqlite3 "insert into stuff (title,description) values ('chair','four legs');"
natasha:~/rails/azure/db briandunbar$ sqlite3 development.sqlite3 "select * from stuff";
1|chair|four legs


Assumes
A sqlite db file named development.sqlite3.
This database has two columns 'title' and 'description'.
That one has nothing else to do on a gloomy afternoon.

Results
Data is written.
Cockatoo looks at you funny when you chuckle madly.
blog comments powered by Disqus