-
Notifications
You must be signed in to change notification settings - Fork 0
ActiveRecord Class Mod
This page describes a modified version of the great ActiveRecord_Class library.
[h2]Modifications made[/h2]
[ul] [li]The discover_table_columns() method and all caching logic were ditched. Why? First of all, CI has a nice $this->db->list_fields('table_name') method which does the same in a cross-database-implementation way. Secondly, there is a $query->list_fields() method which returns an array of field names from your query object without making any additional queries. All in all, performance-wise you save one file read and lose one "SHOW COLUMNS FROM..." query for each table you .save() or .update() (but not .create() or .find_*()). Some hacky benchmarking's shown no difference, but the library got cleaner and there is no more "OMG, I changed my DB structure, but the old one stuck in the cache, and I forgot about that!"[/li] [/ul]
[h2]Download[/h2]