updates README to include new sequel adapter info

This commit is contained in:
Ben Mabey 2011-12-19 20:42:34 -07:00
parent b3eefb7219
commit 501025b9de

View file

@ -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 is a small amount of code but is code that is usually needed in any ruby app
that is testing with a database. 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: 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 | | DataMapper | Yes | **Yes** | No |
| CouchPotato | **Yes** | No | No | | CouchPotato | **Yes** | No | No |
| MongoMapper | **Yes** | No | No | | MongoMapper | **Yes** | No | No |
| Mongoid | **Yes** | No | No | | Sequel | **Yes** | Yes | No |
(Default strategy for each library is denoted in bold) (Default strategy for each library is denoted in bold)
The ActiveRecord @:deletion@ strategy is only useful for when the @:truncation@ strategy causes The ActiveRecord @:deletion@ strategy is useful for when the @:truncation@ strategy causes
locks (as reported by some Oracle DB users). The @:truncation@ strategy is the preferred option locks (as reported by some Oracle DB users). The @:deletion@ option has been reported to
since it is much faster. 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@. with any ORM library. You can also explicitly use it by setting your strategy to @nil@.
h2. How to use h2. How to use
@ -119,7 +120,7 @@ After do |scenario|
end end
</pre> </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?" For more examples see the section "Why?"
h2. Common Errors 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 #How to specify particular orms
DatabaseCleaner[:active_record].strategy = :transaction DatabaseCleaner[:active_record].strategy = :transaction
DatabaseCleaner[:mongo_mapper].strategy = :truncation DatabaseCleaner[:mongo_mapper].strategy = :truncation
#How to specify particular connections #How to specify particular connections
DatabaseCleaner[:active_record,{:connection => :two}] DatabaseCleaner[:active_record,{:connection => :two}]
</pre> </pre>
@ -161,6 +162,7 @@ Configuration options
| Mongo Mapper | DatabaseCleaner[:mongo_mapper] | Multiple connections not yet supported | | Mongo Mapper | DatabaseCleaner[:mongo_mapper] | Multiple connections not yet supported |
| Mongoid | DatabaseCleaner[:mongoid] | Multiple connections not yet supported | | Mongoid | DatabaseCleaner[:mongoid] | Multiple connections not yet supported |
| Couch Potato | DatabaseCleaner[:couch_potato] | Multiple connections not yet supported | | Couch Potato | DatabaseCleaner[:couch_potato] | Multiple connections not yet supported |
| Sequel | DatabaseCleaner[:sequel] | ? |
h2. Why? h2. Why?