lp:~asteinlein/kolibri/db-cleanup

Created by Anders Steinlein and last modified
Get this branch:
bzr branch lp:~asteinlein/kolibri/db-cleanup
Only Anders Steinlein can upload to this branch. If you are Anders Steinlein please log in for upload directions.

Branch merges

Related bugs

Related blueprints

Branch information

Owner:
Anders Steinlein
Project:
Kolibri
Status:
Merged

Recent revisions

10. By Anders Steinlein

Fixed some bugs exposed during testing:
* Search for query placeholders as full words, to prevent wrong insertion when
  one placeholder matches the beginning of another.
* load() in a DAO can now accept multiple arguments.
* Check if result set is valid in first invocation of
  ObjectBuilder::fetchInfo(), to prevent error from getObject() when no rows
  were found.
* Return null from getColumn() and getObject() instead of false when no rows
  were found.
* Config sets LC_NUMERIC locale to the environment's current locale, to prevent
  floats from having wrong decimal separators in queries.

Also did some minor cleanup, most notably moving isPureNumber() from database
implementations to DatabaseConnection.

9. By Anders Steinlein

Fixed a few bugs and improved documentation in accordance with code review.

8. By Anders Steinlein

Removed numAffectedRows() from DatabaseConnection, as its presense in ResultSet
seems more logical. This can more easily be access by the DataAccessProxy, which
now looks up rows affected after insert()/update()/delete() and returns the
number instead of the ResultSet itself. ModelProxy is updated after this, to
accumulate affected rows and returns this instead of true/false.

This should conclude the work in this branch, barring any last-minute bugs.

7. By Anders Steinlein

Continued cleanup and improvement of database rewrite.

Added support for supplying a single query parameter without wrapping it in an
array, and introduced a general DatabaseException for general database errors.
All occurences of Exception in the database layer are now changed to either
DatabaseException or the more specific SqlException. They are never catched, but
given that improvement of error handling is an entirely different issue to
handle, this seems OK.

Database related validators are fixed to work again, and TransactionInterceptor
is cleaned up. This should conclude all general framework cleanup related to
this branch.

Frode's performance improvements in prepareQuery() is merged, and minor tweaks
to the README has been done.

6. By Anders Steinlein

Cleanup and bugfixes in the new database layer, elsewhere in the framework
relating to the database and wishlist example application. The example is now
again fully functional.

What used to be one() in DAOs are now removed, as load() now functions as both,
that is it sets the model into the proxy as well as returning the plain model
object.

A new SqlException class is introduced, currently only thrown in query() in
database connection implementations and never catched. It made for easier
debugging of bugs, and will be cleaned up and better integrated in coming
commits.

5. By Anders Steinlein

Reimplemented support for SQLite databases under the rewritten database layer.
As the SQLite PHP module is quite different from the PostgreSQL one, some
changes were made to the result set implementations. ResultSet is now a simple
interface all result set implementations must follow, while ResultSetArray is an
abstract class with support for direct array access to rows. PostgreSqlResultSet
extends this class and thus supports array access, while SqliteResultSet
basically wraps the native PHP class SQLiteUnbuffered which only supports
forward row iteration.

Bugfixes and updates where also made to other classes affected by the database
layer. The example Wishlist application now mostly works out of the box, though
a few issues remain.

4. By Anders Steinlein

Complete general functionality with comments of database rewrite, including the
PostgreSQL implementation and optimizations. Now provides an abstract ResultSet
for eased writing of result set implementations.

3. By Anders Steinlein

Mostly complete rewrite of the DB abstraction layer, including the PostgreSQL driver. ResultSet has become ObjectBuilder, with internal cleanup and refactoring to extract data from an external result set. This result set must be implemented by specific drivers, as PostgreSqlResultSet does for PostgreSQL.

2. By Anders Steinlein

Cleanup of layout in README. Misc spelling corrections.

1. By Anders Steinlein

Initial import, with README and simple example application.

Branch metadata

Branch format:
Branch format 6
Repository format:
Bazaar pack repository format 1 (needs bzr 0.92)
This branch contains Public information 
Everyone can see this information.

Subscribers