Alright, here comes a first stab of fixing the Sequel cache.
Patch against current ramaze at:
http://www.lassoweb.se/tmp/ramaze_sequel_cache.diff
I've mainly changed two things from the current Sequel Cache. The
first thing is that I have added the possibility to use options when
setting the cache. Like this:
# For default options (same as before)
Ramaze.options.cache.session = Ramaze::Cache::Sequel
# For custom options
Ramaze.options.cache.session = Ramaze::Cache::Sequel.using(
:connection => Sequel.mysql(
:host=>'localhost', :user=>'user',
:password=>'password', :database=>'blog'
),
:table => :blog_sessions
)
This will create a mysql cache in database 'blog' in table
'blog_sessions'. Each cache will can also have its own settings, so
it's possible to use two different tables (or even different database
adapters) for two different caches. The options array can also control
some other things, but please check out the patch for that.
The second thing I've done is to strip out all of Sequel::Model from
the cache class. Since we're trying to be as fast as possible (it's a
cache after all) I felt it was important to remove as much fancy stuff
as possible. The whole class now uses raw Sequel datasets instead.
I've borrowed parts of Sequels serialize plugin in order to make
serialization smooth, but the cache now handles all of it's tasks by
itself. No need for any Sequel plugins anymore.
Since its my first patch in quite a while I would be very happy to
accept suggestions on how to improve it. When it's good enough I hope
it will find it's way into the "official" Ramaze.
/lasso