Home » Database » DB_QueryTool
An OO-interface for easily retrieving and modifying data in a DB.
This package is unmaintained.
Download latest release 1.1.2 (archived versions might be outdated)
License: BSD
Description
This package is an OO-abstraction to the SQL-Query language, it provides methods such
as setWhere, setOrder, setGroup, setJoin, etc. to easily build queries.
It also provides an easy to learn interface that interacts nicely with HTML-forms using
arrays that contain the column data, that shall be updated/added in a DB.
This package bases on an SQL-Builder which lets you easily build
SQL-Statements and execute them.
Documentation
Maintainers
- Wolfram Kriesing (cain) — lead, inactive
- Lorenzo Alberton (quipo) — lead, active
Dependencies
Required
Releases
- 1.1.2 (stable, 2008-01-12)
Release notes
License: BSD
* fixed bug #12353: identifier quoting with functions in _buildSelect()
* fixed bug in addWhereSearch() introduced in the latest release
* Coding Standards fixes - 1.1.1 (stable, 2008-01-12)
Release notes
License: BSD
* fixed bug #10073: bug with empty() and 0 in _localeSafeImplode()
* fixed Coding Standards - 1.1.0 (stable, 2007-01-27)
Release notes
License: BSD
* added getOne() method (request #7580)
* added support for NULL fields in remove() (request #8056)
* fixed bug #3842, using the addJoin/setJoin methods causes an "invalid token" error with ibase;
the joined table columns aliases are now named in this format: "t_tablename_fieldname" instead of "_tablename_fieldname".
Only the ibase driver is affected by this change.
* custom implementation of implode() to circumvent locale handling of floats,
which clashes with SQL standards
* added table and field name quoting (requests #4613, #5250, #7570, #9197)
* fixed bug #9734, an incorrect regexp adds extraneous table names to the fields,
if the name of the field appears as a column name in the current table.
* phpdoc and CS fixes
* added new tests
* switched to package.xml v2NB: This will probably be the last release of DB_QueryTool, which is deprecated
in favour of MDB_QueryTool. - 1.0.3 (stable, 2006-05-01)
Release notes
License: BSD
* fixed DB_QueryTool_Result_Object::fetchRow() when the return type is
a scalar value instead of an array (bug #7532) - 1.0.2 (stable, 2006-01-26)
Release notes
License: BSD
* changed license to BSD
* fixed bug with big integers being incorrectly trimmed - 1.0.1 (stable, 2005-09-08)
- 1.0.0 (stable, 2005-03-03)
Release notes
License: PHP
* fixed bug #3290, getCount() method returns zero when using an offset
(patch by kubo at isite dot co dot jp)
* strings lenghtier than the column max size are truncated
to prevent db errors
* using setOrder() with setGroup()+setHaving() could cause a malformed query
* fully tested with MySQL, PostgreSQL and Firebird/Interbase
(added a new testsuite using SimpleTest) - 0.11.1 (stable, 2004-10-18)
Release notes
License: PHP
* allow multiple left|right join clauses.
NB: getJoin($type) now returns
array(
$joinTable1 => $joinOnClause1,
$joinTable2 => $joinOnClause2,
)
* allow class usage without instanciating a db object
(to use the class as a simple query builder)
* unset non-specific PEAR::DB options before calling connect()
(bug #1614)
* allow reuse of existing connection (bug #2007),
thanks to eln at gmx dot net - 0.10.1 (stable, 2004-05-05)
Release notes
License: PHP
* on UPDATE, field names are no more prefixed by the table name
(it didn't work with PostgreSQL)
* added an $options parameter to connect()
* fixed bug #284 (Log::factory() needs to return a reference)
* fixed bug #298 (reset() does not reset limit)
* fixed bug #322 (undefined var $autoConnect)
* changed useResult() method; now it accepts a $type parameter, use it to return
'array' results or 'object' results (thanks to Roman Dostovalov).
Please note that BC is maintained, useResult(true) will default to
useResult('array'), and useResult(false) will default to useResult('none').
* fixed problems with useResult(true) and empty results
* when using useResult(true), if the user doesn't call getFirst() on the first
iteration, the class does so automatically
* PHP 5 fixes
* fixes to the testsuite - 0.9.8 (stable, 2003-09-23)
Release notes
License: PHP
* added new method getQueryString() which returns the rendered query
* added setDbInstance() which lets you supply an existing DB-instance to work with
using this you dont need to pass a DSN to the constructor! - 0.9.7 (stable, 2003-09-15)
Release notes
License: PHP
* use Log 1.7 API
- 0.9.6 (stable, 2003-09-12)
Release notes
License: PHP
- bugfix in addMultiple()
- addWhereSearch now only prefixes known columns as it is supposed to be,
otherwise it would also prefix aliases with the table name, which is bull...
- quirk in the addLeftJoin() method ... not nice, but v1.0 will be, unit tests pass but thats still not enough proof
- make setLimit also work to unset it - 0.9.5 (stable, 2003-06-17)
Release notes
License: PHP
- bugfix when writing log files, times were wrong
- bugfix in EasyJoin, which added unnecessary conditions
- bugfix in building column alias which is at the end of the string
- bugfix in addMultiple() which didnt work without primaryCol
- bugfix in addHaving and unit test, thanks to Johannes Schaefer - 0.9.4 (stable, 2003-06-06)
Release notes
License: PHP
- added set/getLimit(), which set the limit globally,
getAll() and getCol() can still overwrite this temporarily
- added addOrder()
- added *Having() methods by Johannes Schaefer
- added log functionality
- added condition param to addWhereSearch()
- fix bug in building group clause for getCount()
- bug fix in building join - 0.9.3 (stable, 2003-03-11)
Release notes
License: PHP
- new method getCol() which lets you retreive just one column
- getAll() takes an additional optional parameter, where you can define
the method that should be used for firing the query
- update() does also consider the value of setWhere() when no primary column is given
added a _buildUpdateQuery() for that too
- added umbrello-uml class diagram
- fixing some typos, esp. for making the useResult() work
- bugfix in update, use fully qualified table name (Uwe Dörl)
- bugfix in _buildSelectQuery, enclose column names by ""
now Oracle should work and also reserved keywords can be used as column names (Uwe Dörl)
- some bugfixes and more CS issues - 0.9.2 (stable, 2003-02-09)
Release notes
License: PHP
- now you can customize the sequence name
- testing on postgres and added example
- enhancing the constructor to take the error/log callbacks
- some cleaning up - 0.9.1 (stable, 2003-01-29)
Release notes
License: PHP
maintanence release, fix a lot E_ALL issues and CS issues
- 0.9 (stable, 2003-01-17)
Release notes
License: PHP
- initial release in PEAR
Bugs
| ID | Status | Type | Version | Date | Summary |
|---|---|---|---|---|---|
| #284 | Closed | Bug | 2003-11-23 | Log::factory() needs to return a reference | |
| #298 | Closed | Bug | 2003-11-26 | [M]DB_QueryTool::reset doesnt take care of limit | |
| #945 | Closed | Bug | 2004-03-04 | [Patch] Return result object | |
| #954 | Closed | Bug | 2004-03-05 | Can't set primary key with add() | |
| #1038 | Closed | Bug | 2004-03-19 | joins don't work becaus second array_merge parameter line 1451 | |
| #1588 | Closed | Bug | 2004-06-08 | Error when instancing with no dsn | |
| #1614 | Closed | Bug | 2004-06-11 | Wrong options-array passed to DB::connect() | |
| #2007 | Closed | Bug | 2004-07-28 | Doesn't support using an existing DB object, but the docs says it should | |
| #2133 | Closed | Bug | 2004-08-16 | DB_QueryTool_Query::addLeftJoin(), bugs if none left join was previously set | |
| #2515 | Closed | Bug | 2004-10-12 | Adding more than one Left-Join doesn´t work properly | |
| #3290 | Closed | Bug | 2005-01-25 | DB_QueryTool_Query::getCount() method return zero when using an offset | |
| #3902 | Closed | Bug | 2005-03-21 | package is not ready to work with primaryCol not int | |
| #4128 | Duplicate | Bug | 2005-04-12 | primary key quoting in update() | |
| #4189 | Closed | Bug | 2005-04-20 | update() quote even if "raw" option is set | |
| #4377 | Closed | Bug | 2005-05-18 | Broken link "External Package Homepage" | |
| #4613 | Closed | Bug | 2005-06-16 | Table Names Not Quoted | |
| #5037 | Bogus | Bug | 2005-08-09 | "setLimit" is not working properly | |
| #5250 | Closed | Bug | 2005-08-31 | Table Name needed in queries | |
| #5785 | Wont fix | Req | 2005-10-25 | CHECK NOT NULL Columns | |
| #7316 | Closed | Bug | 1.7.6 | 2006-04-05 | Passing function calls by reference breaks in php5 |
| #7580 | Closed | Req | 1.0.3 | 2006-05-08 | getOne |
| #8129 | Closed | Req | 1.0.3 | 2006-07-06 | how to build a update query as "set field=field+1" ? |
| #9197 | Duplicate | Bug | 2006-10-31 | DB_QueryTool does not save | |
| #12353 | Closed | Bug | 1.1.0 | 2007-10-28 | wrong field name quoting |
| #14850 | Closed | Bug | 1.1.2 | 2008-10-22 | order by direction inside of backticks |
| #14862 | Closed | Bug | 1.1.2 | 2008-10-25 | Fatal error: Call to undefined method DB_Error::tableinfo() |
| #18968 | Closed | Bug | SVN | 2011-11-07 | Tests fail |