Updated: DAO
An updated DAO package is now available here. API documentation, also slightly updated, is here.
With this bugfix release, DAO is now at version 0.5.2.1.
Changes:
# Fix bugs in SQL generation for UPDATEs of a table with an aliase, add tests for that case and a few others.
# Change count() strategy: now use numRows() after running the real select to get count of rows, rather than building new count(*) select; old strategy fails for grouped queries. The count tests have been removed from the test suite for now.
The count() change is fairly major, for a bugfix. Unfortunately, my previous count() method was poorly thought out, and failed in many common cases: GROUPed queries, for example, always count()‘ed wrong. It also forced an additional query, without gathering any more information than could be found by using one query (properly) rather than two. On an application level, the major implication of this change is that instead of using LIMITed queries for paging though large record sets, you should use the row argument to fetch() to fetch the rows from the whole found set that you want. This way, you can with one SELECT find the total record count, and be set up to load the desired records.
Filed under: projects

0 Comments:
Post a Comment
<< Home