Project

elefant

0.0
No commit activity in last 3 years
No release in over 3 years
The elefant gem gives you a few insights analytics about your PostgreSQL database
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 5.5
~> 0.6
~> 10.4
~> 3.4
~> 0.7

Runtime

~> 0.7
~> 0.15
~> 1.4
 Project Readme

Elefant

Build Status

When you are running a small / medium sized project, there is usually not a dedicated DBA and you rarely care about the database analytics that PostgreSQL gives you for free. Elefant tries to help a little by providing a web interface for some basic database analytics as a small mountable rack application.

Screenshot

Installation

Add this line to your application's Gemfile:

gem 'elefant'

And then execute:

$ bundle

Or install it yourself as:

$ gem install elefant

Usage

Standalone

Run the web interface as a standalone rack application:

$ DATABASE_URL=postgres:///some_db_connection_string elefant-web

or if you want to use a different database specifically for elefant:

$ ELEFANT_DATABASE_URL=postgres:///some_db_connection_string elefant-web

Rails

You can mount the web interface in a rails application by adding this to config/routes.rb:

require 'elefant/web'
mount Elefant::Web => '/elefant'

It will pick up a connection from the ActiveRecord connection pool.

⚠️ There is no authentication built in! Mounting it as described above is probably a bad idea! ⚠️

In case you are using Devise, here is an example of mounting only for authenticated users of the :admin scope:

authenticate(:admin) do
  require 'elefant/web'
  mount Elefant::Web => '/elefant'
end 

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request