I was building a deployment web application using Heroku.com when I realized that the only database type they support is PostgreSQL. So far, my application (running on Ruby gem Sinatra) has accessed the database using the .Sqlite method for Sequel gem.
Here is my Ruby script when I used Sequel to access the .db file through SQLite:
DB = Sequel.sqlite('mydatabase.db') DB.create_table :mytable do primary_key :id String :column_name end
I installed PostgreSQL, learning that Heroku used just that. Here's the script via postgres (my username is literally "postgress", although I obviously will not reveal my password in this question):
DB = Sequel.postgres('mydatabase.db',:user=>'postgres',:password=>'my_password_here',:host=>'localhost',:port=>5432,:max_connections=>10) DB.create_table :mytable do primary_key :id String :column_name end
However, when I run this code, I get the following error:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sequel-3.38.0/lib/sequel/adapters/postgres.rb:208:in 'initialize': PG::Error: FATAL: database "mydatabase.db" does not exist (Sequel::DatabaseConnectionError)
I tried looking in Google, StackOverflow, Sequel docs and Heroku help docs for any help, but I did not find any solution to this problem.
Does anyone know what I'm doing wrong?
source share