Low commit activity in last 3 years
No release in over a year
Strategies for cleaning databases using Nobrainer. Can be used to ensure a clean state for testing.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 13
~> 3

Runtime

 Project Readme

Database Cleaner Adapter for Nobrainer

.github/workflows/ci.yml

Clean your Nobrainer databases with Database Cleaner.

See https://github.com/DatabaseCleaner/database_cleaner for more information.

Installation

# Gemfile
group :test do
  gem 'database_cleaner-nobrainer'
end

Supported Strategies

The nobrainer adapter only has one strategy: the deletion strategy.

Strategy configuration options

:only and :except may take a list of collection names:

# Only delete the "users" collection.
DatabaseCleaner[:nobrainer].strategy = :deletion, { only: ["users"] }

# Delete all collections except the "users" collection.
DatabaseCleaner[:nobrainer].strategy = :deletion, { except: ["users"] }

Adapter configuration options

#db defaults to the Nobrainer database, but can be specified manually in a few ways:

# Redis URI string:
DatabaseCleaner[:nobrainer].db = :logs

# Back to default:
DatabaseCleaner[:nobrainer].db = NoBrainer.current_db

# Multiple Nobrainer databases can be specified:
DatabaseCleaner[:nobrainer, connection: :default]
DatabaseCleaner[:nobrainer, connection: :shard_1]
DatabaseCleaner[:nobrainer, connection: :shard_2]

Earthfile

The Earthfile is to be used with Earthly.

To build the development Docker image, simply run earth +dev. To run the tests, run earth -P +rspec To publish a new version of the gem, run earthly +publish --RUBYGEMS_OTP=<OTP> --RUBYGEMS_ORG_API_KEY=$(cat ~/.gem/credentials | grep :rubygems_api_key | awk '{print $2}')

Please look at the Earthly documentation for more.

COPYRIGHT

See LICENSE for details.