Class: Merb::Cache::DatabaseStore::Sequel::CacheModel

Class | Merb::Cache::DatabaseStore::Sequel::CacheModel
In: | lib/merb-cache/cache-store/database-sequel.rb
Parent: | Sequel::Model(Merb::Controller._cache.config[:table_name].to_sym)

The cache model

### Methods

cache_get cache_set check_table expire expire_all expire_match

### Public Class methods

cache_get(key)

Fetch data from the database using the specified key The entry is deleted if it has expired

#### Parameter

key<Sting>: | The key identifying the cache entry

#### Returns

data<String, NilClass>: | nil is returned whether the entry expired or was not found

cache_set(key, data, expire = nil, get = true)

Store data to the database using the specified key

#### Parameters

key<Sting>: | The key identifying the cache entry
data<String>: | The data to be put in cache
expire<~minutes>: | The number of minutes (from now) the cache should persist
get<Boolean>: | used internally to behave like this when set to true, perform update_or_create on the cache entry when set to false, force creation of the cache entry

check_table()

Perform auto-migration in case the table is unknown in the database

expire(key)

Expire the cache entry identified by the given key

#### Parameter

key<Sting>: | The key identifying the cache entry

expire_all()

Expire all the cache entries

expire_match(key)

Expire the cache entries matching the given key

#### Parameter

key<Sting>: | The key matching the cache entries

[Validate]