hellsan631 / LogosDB

A database micro-framework for creating simple DB interaction without the need for a full framework
1 stars 0 forks source link

Caching of DB Calls #10

Open hellsan631 opened 9 years ago

hellsan631 commented 9 years ago

Write something so you can cache DB load calls and search within the cached results, instead of having to query the db multiple times.

For instance:

//Caches Table Results
Table::cache('loadMultiple', ["group_id" => 4]);

//This would search the cache of tables first, before querying the database
Table::loadSingle(["name" => "Companies"]);
hellsan631 commented 9 years ago
//This would override the caching (with the added true value at the end) 
//and the call would go straight to the DB.
Table::loadSingle(["name" => "Companies"], true);
hellsan631 commented 9 years ago

Might be more useful for db load statements to be cached in memcache or something similar, and for those to be auto cached, via a config option