{"repo":"amatsuda/database_rewinder","free":true,"listed":false,"github":"https://github.com/amatsuda/database_rewinder","clone":"git clone https://github.com/amatsuda/database_rewinder.git","description":"minimalist's tiny and ultra-fast database cleaner","language":"Ruby","stars":824,"topics":["rails","testing","database","postgresql","mysql","sqlite3"],"license":"MIT","category":"databases-storage","readme_excerpt":"DatabaseRewinder database\\ rewinder is a minimalist's tiny and ultra-fast database cleaner. Features Cleans up tables via DELETE SQL. No other strategies are implemented ATM Supports multiple databases Runs extremely fast :dash: Why is it fast? database\\ rewinder memorizes every table name into which INSERT SQL was performed during each test case. Then it executes DELETE SQL only against these tables when cleaning. So, the more number of tables you have in your database, the more benefit you will get. Also, database\\ rewinder joins all DELETE SQL statements and casts it in one DB server call. Credit This strategy was originally devised and implemented by Shingo Morita (@eudoxa) at COOKPAD Inc. Supported versions ActiveRecord 4.2, 5.0, 5.1, 5.2, 6.0, 6.1, 7.0, 7.1, 7.2 (edge) Ruby 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3 (trunk) Installation Add this line to your Gemfile's :test group: gem 'database rewinder' And then execute: $ bundle Usage Basic configuration Do clean in after(:each) . And do clean all or clean with in before(:suite) if you'd like to. Dealing with multiple DBs You can configure multiple DB connections to tell DatabaseRewinder to cleanup all of them after each test. In order to add another connection, use DatabaseRewinder[] method. MySQL + use\\ transactional\\ tests Specific Problems database\\ rewinder tries to create a new DB connection for deletion when you're running tests on MySQL. You would occasionally hit some weird errors (e.g. query execution timeout) b","default_branch":null,"files":null,"tree":[],"storefront":"/r/amatsuda","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/amatsuda/database_rewinder/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}