Database table abstraction library
Use this library to construct table browsing objects out of your database table. These objects allow your code to handle any database table in an abstract way. By freeing your code from the database details it is possible for you to build generic data reporting or manipulation functions that can work with any table.
Put another way, if you really hate using sql in your code, having to piece together bits of sql to make queries...this library gives you an alternative. Currently only the single table browser is implemented. If you need to work with data that spans multiple tables, you can build a table view as this library works with them as well.
This library has been completely rewritten and is more modular now. The package is now redone as an MDB2 module and the new architechture offers new possibilities.
First Draft: 2008-09-26
- Proposal: 2008-09-26
- Call for Votes: 2008-10-19
Isaac TewoldeAdded the ability to use multiple filter chains.
[2008-09-29 18:01 UTC]
Each filter chain is a set of conditions that must evaluate to true in order for a row to be matched. An example filter chain can be "All birds or mammals that have a life span >10"
This is represented internally as 1 chain with 2 conditions.
1: type="bird" or "mammal"
2: lifespan > 10
But what if you wanted to look for "birds with a lifespan >10" or "mammals with a lifespan <40"? This requires the use of 2 filter chains as we are looking to two sets of conditions that a row can match.
This is represented internally as 2 chains with 2 conditions each.
1: type= "mammal"
2: lifespan <40
2: lifespan > 10
An example use of this is in file example.php
Isaac TewoldeAdded the ability to add/remove custom columns to the table browser. These are columns that are not part of the table definition but are functions such as md5().
[2008-09-30 16:44 UTC]
$browser->addCustomColumn('md5(TYPE)', 'Special Column');
see example source link to see how it works.
[2008-10-01 17:26 UTC]
-Code cleanup using phpcs
-package.xml fixed (generated using PEAR_PackageFileManager)
-package file created using 'pear package'
-Added more documentation
-Added grouping and order by functionality
Isaac Tewolde-Example script now creates its own table and data
[2008-10-08 17:59 UTC]
-Interface names changed to reflect the package they belong to
-insertRows method added for adding more than one row at a time
Isaac Tewolde-Some code clean up
[2008-10-16 02:03 UTC]
-Removed some duplicated code
-Simplified the interface for dealing with multiple filter chains
-Example script modified to reflect interface changes
Isaac TewoldeI have been putting in a lot of work into this package, and the feedback I have received has been very helpful. I'm calling for votes now as I need to see how people use this to tighten up the interface and deal with other issues that arise
[2008-10-19 19:56 UTC]
-deleteRow has been added
-aliases and column names can be used interchangeably
*If you set up an alias for a column, the alias can be used in subsequent update/insert calls
-Mutli-table support is on the way, interface has been built
-Added getRowsSQL which returns the select sql statement instead of executing it
*Useful for debugging or if you are working with sub-selects