Project

db_admin

0.03
No commit activity in last 3 years
No release in over 3 years
A Web UI to manage databases. Support PostgreSQL, MySQL, SQLite, Oracle, MS-SQL, etc.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 5.0
~> 2.0
 Project Readme

Ruby Database Admin

LICENSE 996.icu

A gem based on Sinatra and Sequel. You can use it to manage multiple databases at the same time.

For Rails user, this gem will treat ./config/database.yml as database configuration file.

Here are some demo pictures.

Demo home

Demo operations

Demo hover

Installation

gem install db_admin

If you prefer to use it in Gemfile:

group :development do
  # A Web UI for database admin. Run `$ db_admin` and then
  # visit http://localhost:4567
  gem 'db_admin', require: false # You needn't to require the code.
end

Make sure you have installed database driver gem.

E.g: gem install pg, gem install sqlite3 or gem install mysql2, etc. Then

$ db_admin # Run this command to start a Sinatra Web.

Visit http://localhost:4567

Connect to database

There are two ways for you to connect to a database.

  1. Visit http://localhost:4567 . The homepage will ask you to connect to a database. Please look at the demo picture above.

  2. touch ./config/database.yml or touch ./database.yml

You can use Rails's database.yml file directly.

In database.yml, 'Omit the key' or 'keep the value blank' means use the default value.

# 'database.yml' for Rails style example 1. We only connect to the 'development' database!
development:
  adapter: postgresql
  encoding: unicode
  host: localhost
  database: something_development
  username: username
  password:
  port: 5432
# 'database.yml' for Rails style example 2. Inherited style is also supported.
default: &default
  adapter: postgresql
  # Below omitted ...

development:
  <<: *default
  database: something_development
  # Below omitted ...
# 'database.yml' for none-Rails style example.
adapter: postgres
encoding: unicode
host: localhost
database: your_database_name
user: username
password:
port: 5432

Customizing

If you want to change some code for your own purpose, please

$ git clone git@github.com:gazeldx/db_admin.git
$ cd db_admin
$ ruby lib/db_admin/run_web.rb # Then visit http://localhost:4567 

Debugging

You need to restart Web when you made a change.

Uncomment the below line in ./lib/db_admin.rb to auto-reload changed files.

require 'sinatra/reloader' if development? # `$ gem install sinatra-reloader` first.