Giter Club home page Giter Club logo

dba's Introduction

Dba, our db tools, powered by ruby

Features

  • manage db config in one place
  • use favored command tools eg. pgcli, psql, sequel
  • connect as easy as possible
  • write sqlets(db script) quickly
  • make test and run easily
  • try and learn advanced db knowledge

Quick start

  • config ~/.dbs.yml(or DBSFILE env) as sample-dbs.yml
  • install ruby locally eg. brew install ruby
  • install pg locally eg. brew install [email protected]
  • run bundle install
  • put source /path/to/here/dba.rc in your ~/.bashrc

Try

run like below:

dbcli help
dbmigrate help
pga help
rake demo
sql/demo.rb
rspec spec/try_db_spec.rb 

Run with docker

dockerdba down # get image
# config ~/.dbs.yml with a docker_test db item
dockerdba try
# write your scripts by dockerdba/try.sh

Used in starup

pull staging db to local

  • pga gen_datafile postgres://xxx/to_staging_db 生成大表过滤规则文件(如.datafiles/starup.pg.staging.localdomain.5432.yml), 可自行编辑该规则文件
  • pga copy postgres://src_staging_db_url/db1 postgres://localhost/new_not_exist_db1 --dryrun 生成shell脚本,去掉--dryrun可立即触发执行。可自行定制生产的shell脚本

Inspired by

dba's People

Contributors

cao7113 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.