Skip to content

Postgres insights made easy-er

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE.txt
MIT
MIT-LICENSE
Notifications You must be signed in to change notification settings

ArtemisInternet/pgheroine

 
 

Repository files navigation

PGHeroine

Installation

Add gem to Gemfile

filename: Gemfile

gem %q|pgheroine|

Mount engine

filename: config/routes.rb

MyApp::Application.routes.draw do
  ...
  mount PGHeroine::Engine => %q|/pgheroine|
  ...
end

Configure

PGHeroin includes a simple configuration class that you can use in an intializer if you dislike the defaults for whatever stupid reason.

The configuration is available at PGHeroine.configuration

filename: config/initializers/pgheroine.rb

require 'pgheroine/configuration'

PGHeroine.configuration.new do |config|
  config.application_root = Rails.root
  config.relative_configuration_file_path = 'config/pgheroine.yml'
end

filename: config/pgheroine.yml

default: &default
  adapter: postgresql
  encoding: unicode
  pool: 5
  username: postgres

fakes: &fakes
  fake_1:
    <<: *default
    database: fake_1
  fake_2:
    <<: *default
    database: fake_2
  fake_3:
    <<: *default
    database: fake_3

development:
  <<: *fakes

test:
  <<: *fakes

Resetting configuration

If you need to reset the configuration, perhaps for tests.

PGHeroine.configuration.reset!

Testing

If you want to integrate against pgheroine with multiple databases, you'll probably need to set up those databases.
One way that the authors of pgheroine do this is by adding entries into config/database.yml and then running the db:create:all task.

See test/dummy/config/database.yml for examples.

This project rocks and uses MIT-LICENSE.

About

Postgres insights made easy-er

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE.txt
MIT
MIT-LICENSE

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 94.2%
  • CSS 3.1%
  • JavaScript 2.7%