kemal-pg
kemal-pg
Postgresql connection middleware for Kemal
Installation
Add this to your application's shard.yml
:
dependencies:
kemal-pg:
github: sdogruyol/kemal-pg
Usage
This middleware adds Postgresql
connection pool to Kemal as a middleware.
require "kemal"
require "kemal-pg"
pg_connect "postgres://user@host:5432/your_db"
# Make sure to yield `env`.
get "/" do |env|
users = conn.exec("SELECT * FROM users")
"Hello from postgresql"
end
Contributing
- Fork it ( https://github.com/sdogruyol/kemal-pg/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- sdogruyol Sdogruyol - creator, maintainer