Proposal for "MDB2_TableBrowser"

» Metadata » Status
» Description
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.

CHANGES:
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.
» Dependencies » Links
  • MDB2
  • PHP >= 5
» Timeline » Changelog
  • First Draft: 2008-09-26
  • Proposal: 2008-09-26
  • Call for Votes: 2008-10-19
  • Isaac Tewolde
    [2008-09-29 18:01 UTC]

    Added the ability to use multiple filter chains.

    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.
    Chain 1:
    1: type= "mammal"
    2: lifespan <40

    Chain 2:
    1: type="bird"
    2: lifespan > 10

    An example use of this is in file example.php
  • Isaac Tewolde
    [2008-09-30 16:44 UTC]

    Added 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().

    Example:
    $browser->addCustomColumn('md5(TYPE)', 'Special Column');

    see example source link to see how it works.
  • Isaac Tewolde
    [2008-10-01 17:26 UTC]

    Cleanups
    ######
    -Code cleanup using phpcs
    -package.xml fixed (generated using PEAR_PackageFileManager)
    -package file created using 'pear package'
    -Added more documentation

    Functionality Changes
    ##############
    -Added grouping and order by functionality
    -Example updated.
  • Isaac Tewolde
    [2008-10-08 17:59 UTC]

    -Example script now creates its own table and data
    -Interface names changed to reflect the package they belong to
    -insertRows method added for adding more than one row at a time
  • Isaac Tewolde
    [2008-10-16 02:03 UTC]

    -Some code clean up
    -Removed some duplicated code
    -Simplified the interface for dealing with multiple filter chains
    -Example script modified to reflect interface changes
  • Isaac Tewolde
    [2008-10-19 19:56 UTC]

    I 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

    Changes:
    -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