{"id":20699135,"url":"https://github.com/cao7113/dba","last_synced_at":"2026-04-28T00:32:35.757Z","repository":{"id":48138518,"uuid":"142856262","full_name":"cao7113/dba","owner":"cao7113","description":"db toolbox for geeks","archived":false,"fork":false,"pushed_at":"2023-03-17T00:42:52.000Z","size":66,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-17T10:46:06.533Z","etag":null,"topics":["db","sql"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cao7113.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-30T09:44:27.000Z","updated_at":"2019-11-13T02:28:01.000Z","dependencies_parsed_at":"2025-01-17T19:10:48.684Z","dependency_job_id":"25ed1d53-864f-4d73-b54f-4c4508603bb3","html_url":"https://github.com/cao7113/dba","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cao7113/dba","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cao7113%2Fdba","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cao7113%2Fdba/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cao7113%2Fdba/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cao7113%2Fdba/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cao7113","download_url":"https://codeload.github.com/cao7113/dba/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cao7113%2Fdba/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32361477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["db","sql"],"created_at":"2024-11-17T00:28:25.192Z","updated_at":"2026-04-28T00:32:35.742Z","avatar_url":"https://github.com/cao7113.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dba, our db tools, powered by ruby\n\n## Features\n\n* manage db config in one place \n* use favored command tools eg. pgcli, psql, sequel\n* connect as easy as possible \n* write sqlets(db script) quickly\n* make test and run easily\n* try and learn advanced db knowledge\n\n## Quick start\n\n* config `~/.dbs.yml`(or `DBSFILE` env) as `sample-dbs.yml`\n* install ruby locally eg. `brew install ruby` \n* install pg locally eg. `brew install postgresql@9.6`\n* run `bundle install`\n* put `source /path/to/here/dba.rc` in your `~/.bashrc`\n\n### Try\n\nrun like below:\n\n```\ndbcli help\ndbmigrate help\npga help\nrake demo\nsql/demo.rb\nrspec spec/try_db_spec.rb \n```\n\n## Run with docker\n\n```\ndockerdba down # get image\n# config ~/.dbs.yml with a docker_test db item\ndockerdba try\n# write your scripts by dockerdba/try.sh\n```\n\n## Used in starup\n\n### pull staging db to local\n\n* `pga gen_datafile postgres://xxx/to_staging_db` \n  生成大表过滤规则文件(如`.datafiles/starup.pg.staging.localdomain.5432.yml`), 可自行编辑该规则文件\n* `pga copy postgres://src_staging_db_url/db1 postgres://localhost/new_not_exist_db1 --dryrun` \n  生成shell脚本，去掉--dryrun可立即触发执行。可自行定制生产的shell脚本\n\n## Inspired by\n\n* https://github.com/Microsoft/pgtester\n* https://medium.com/yammer-engineering/testing-postgresql-scripts-with-rspec-and-pg-tester-c3c6c1679aec\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcao7113%2Fdba","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcao7113%2Fdba","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcao7113%2Fdba/lists"}