mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
updates README to include new sequel adapter info
This commit is contained in:
parent
b3eefb7219
commit
501025b9de
1 changed files with 10 additions and 8 deletions
|
@ -5,7 +5,7 @@ The original use case was to ensure a clean state during tests. Each strategy
|
|||
is a small amount of code but is code that is usually needed in any ruby app
|
||||
that is testing with a database.
|
||||
|
||||
ActiveRecord, DataMapper, MongoMapper, Mongoid, and CouchPotato are supported.
|
||||
ActiveRecord, DataMapper, Sequel, MongoMapper, Mongoid, and CouchPotato are supported.
|
||||
|
||||
Here is an overview of the strategies supported for each library:
|
||||
|
||||
|
@ -14,15 +14,16 @@ Here is an overview of the strategies supported for each library:
|
|||
| DataMapper | Yes | **Yes** | No |
|
||||
| CouchPotato | **Yes** | No | No |
|
||||
| MongoMapper | **Yes** | No | No |
|
||||
| Mongoid | **Yes** | No | No |
|
||||
| Sequel | **Yes** | Yes | No |
|
||||
|
||||
(Default strategy for each library is denoted in bold)
|
||||
|
||||
The ActiveRecord @:deletion@ strategy is only useful for when the @:truncation@ strategy causes
|
||||
locks (as reported by some Oracle DB users). The @:truncation@ strategy is the preferred option
|
||||
since it is much faster.
|
||||
The ActiveRecord @:deletion@ strategy is useful for when the @:truncation@ strategy causes
|
||||
locks (as reported by some Oracle DB users). The @:deletion@ option has been reported to
|
||||
be faster than @:truncation@ in some cases as well. In general, the best approach is to use
|
||||
@:transaction@ since it is the fastest.
|
||||
|
||||
Database Cleaner also includes a @null@ strategy (that does no cleaning at all) which can be used
|
||||
Database Cleaner also includes a @null@ strategy (that does no cleaning at all) which can be used
|
||||
with any ORM library. You can also explicitly use it by setting your strategy to @nil@.
|
||||
|
||||
h2. How to use
|
||||
|
@ -119,7 +120,7 @@ After do |scenario|
|
|||
end
|
||||
</pre>
|
||||
|
||||
This should cover the basics of tear down between scenarios and keeping your database clean.
|
||||
This should cover the basics of tear down between scenarios and keeping your database clean.
|
||||
For more examples see the section "Why?"
|
||||
|
||||
h2. Common Errors
|
||||
|
@ -145,7 +146,7 @@ Sometimes you need to use multiple ORMs in your application. You can use Databas
|
|||
#How to specify particular orms
|
||||
DatabaseCleaner[:active_record].strategy = :transaction
|
||||
DatabaseCleaner[:mongo_mapper].strategy = :truncation
|
||||
|
||||
|
||||
#How to specify particular connections
|
||||
DatabaseCleaner[:active_record,{:connection => :two}]
|
||||
</pre>
|
||||
|
@ -161,6 +162,7 @@ Configuration options
|
|||
| Mongo Mapper | DatabaseCleaner[:mongo_mapper] | Multiple connections not yet supported |
|
||||
| Mongoid | DatabaseCleaner[:mongoid] | Multiple connections not yet supported |
|
||||
| Couch Potato | DatabaseCleaner[:couch_potato] | Multiple connections not yet supported |
|
||||
| Sequel | DatabaseCleaner[:sequel] | ? |
|
||||
|
||||
h2. Why?
|
||||
|
||||
|
|
Loading…
Reference in a new issue