Monday, August 20, 2012

Sinatra Datamapper Postgresql Heroku

I am about to add more toys to my heroku web app in the coming days.

By default, ruby non-rails apps deployed on heroku do not have a database addon (read this), as heroku isn't sure what type of database a developer might require.

Reading their documentation, I was able to get the postgresql addon by entering this command...
j@ime:~$ heroku login
Enter your Heroku credentials.
Password (typing will be hidden): 
Authentication successful.
j@ime:~$ heroku addons:add heroku-postgresql
 !    No app specified.
 !    Run this command from an app folder or specify which app to use with --app 
j@ime:~$ cd aaa
j@ime:~/aaa$ heroku addons:add heroku-postgresql
Adding heroku-postgresql on js812... done, v15 (free)
Database has been created and is available
Use `heroku addons:docs heroku-postgresql` to view documentation.

I am thinking of using datamapper. It's an application that will help my Sinatra app connect to and access an SQL database of my choice--postgresql. To learn more about datamapper, I am reading documentation from their website, as well as looking under the hood of some apps that use datamapper.

I don't know how to use an SQL database at the moment. I have a MySQL tutorial lined up on my account with

No comments:

Post a Comment