{"id":13879484,"url":"https://github.com/dafalcon/pgreset","last_synced_at":"2025-05-12T14:47:34.359Z","repository":{"id":54858256,"uuid":"69424799","full_name":"dafalcon/pgreset","owner":"dafalcon","description":"Automatically kill postgres connections during db:reset","archived":false,"fork":false,"pushed_at":"2023-10-12T20:47:40.000Z","size":20,"stargazers_count":42,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-23T05:42:42.558Z","etag":null,"topics":["gem","postgresql","rails","rails-db","ruby","ruby-on-rails"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dafalcon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-09-28T04:14:26.000Z","updated_at":"2024-12-25T17:52:42.000Z","dependencies_parsed_at":"2024-01-13T20:57:18.515Z","dependency_job_id":"8873625c-46db-473c-8198-597742b64a8e","html_url":"https://github.com/dafalcon/pgreset","commit_stats":{"total_commits":15,"total_committers":5,"mean_commits":3.0,"dds":"0.33333333333333337","last_synced_commit":"420e1e0c430eadbba02e6de03d42ffebde1d0542"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dafalcon%2Fpgreset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dafalcon%2Fpgreset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dafalcon%2Fpgreset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dafalcon%2Fpgreset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dafalcon","download_url":"https://codeload.github.com/dafalcon/pgreset/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253758112,"owners_count":21959532,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["gem","postgresql","rails","rails-db","ruby","ruby-on-rails"],"created_at":"2024-08-06T08:02:22.509Z","updated_at":"2025-05-12T14:47:34.312Z","avatar_url":"https://github.com/dafalcon.png","language":"Ruby","readme":"# pgreset\n\nThe pgreset gem makes it possible to run rails db:reset against a postgres database with active connections.  It should eliminate \"database in use\" errors from rails.\n\nCredit for the [original solution](https://github.com/basecamp/pow/issues/212) goes to [Manuel Meurer](https://github.com/manuelmeurer).\n\nSpecial thanks to [Emil Kampp](https://github.com/ekampp), [Michael Yin](https://github.com/layerssss), and [Kate Donaldson](https://github.com/katelovescode) for adding Rails 6.1 support.\n\n## Installation and Usage\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'pgreset'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install pgreset\n    \nNow you can run rails db:reset as normal, and rails will kill active connections to the database being reset:\n\n    $ rails db:reset\n    \n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`.\n\n## Testing\n\nThere's a script called pgreset-test.sh that can test a local copy of pgreset against various versions of ruby and rails.  The script assumes postgres is listening on a socket at /tmp/.s.PGSQL.5432 and accepts connections for a user with no password, and that rvm is installed.  You should at least test against these versions, since there were breaking changes to pgreset in them (replace PG_USER with your postgres username):\n\n    cd /path/to/your/pgreset/clone\n    ./pgreset-test.sh 3.0.4 6.0.4 PG_USER\n    ./pgreset-test.sh 3.1.2 7.0.8 PG_USER\n    ./pgreset-test.sh 3.1.2 7.1.1 PG_USER\n\n## Releasing\n\nTo release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/dafalcon/pgreset.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT\nLicense](https://opensource.org/licenses/MIT).\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdafalcon%2Fpgreset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdafalcon%2Fpgreset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdafalcon%2Fpgreset/lists"}