Pakyow app with PostgreSQL database -
can explain how utilize postgresql database pakyow app?
i have built pakyow app , have postgresql database, don't know how set app utilize database.
pakyow doesn't have database back upwards built-in, it's compatible ruby orm (see docs). sequel go-to library working databases in pakyow. sequel working in app, you'll first need add together sequel , pg (since want utilize postgres) gemfile:
gem 'sequel' gem 'pg' next you'll need configure adapter in app.rb. best place in configure block each environment. example, configure adapter development:
$db = sequel.connect('postgres://user:password@host:port/database_name') you can access $db global throughout app.
have @ sequel documentation info accessing info via direct queries or models.
database postgresql web-applications pakyow
No comments:
Post a Comment