Pakyow application with PostgreSQL database
Pakyow does not have built-in database support, but is compatible with any Ruby ORM (see docs ). Sequel is my library for working with databases in Pakyow. To get Sequel to work in your application, you first need to add sequel
and pg
(since you want to use Postgres) to your Gemfile:
gem 'sequel'
gem 'pg'
Then you need to configure the adapter in app.rb
. The best place to do this is in the block configure
for each environment. For example, this will allow you to configure your adapter for development:
$db = Sequel.connect('postgres://user:password@host:port/database_name')
You can access the $db
global in your application.
See the Continue documentation for information on accessing your data through direct queries or models.
source to share