Bug Report #1091

Add AVG, MAX, MIN, and SUM to the Database Library

Added by ambirex - about 3 years ago. Updated almost 3 years ago.

Status:Closed Start date:
Priority:Normal Due date:
Assignee:Jeremy Bush % Done:

0%

Category:Libraries:Database
Target version:2.3.3
Resolution:fixed Points:

Description

From the discussion at:
http://forum.kohanaphp.com/comments.php?DiscussionID=1844&page=1

These functions aren't database specific function, but are included in the ANSI-92 spec and are available by all the database Kohana supports.

Database_Core_r1.patch - r1 of proposed patch (2.2 kB) ambirex -, 02/03/2009 05:04 pm

1091-patches.zip - second set of patches (2.8 kB) ambirex -, 02/06/2009 06:01 pm

Mssql_r2.diff (1.1 kB) ambirex -, 02/06/2009 06:02 pm

Mysql_r2.diff (1.1 kB) ambirex -, 02/06/2009 06:02 pm

Pdosqlite_r2.diff (1.1 kB) ambirex -, 02/06/2009 06:02 pm

Pgsql_r2.diff (1 kB) ambirex -, 02/06/2009 06:03 pm

Associated revisions

History

Updated by Jeremy Bush almost 3 years ago

This should be built into the select() method, much like count(*) is. There shouldn't be different methods for it.

See http://dev.kohanaphp.com/browser/trunk/system/libraries/drivers/Database/Mysql.php#L126

Updated by ambirex - almost 3 years ago

Added patches for the database drivers that have the method escape_column ( aka Mysqli does not have the method ).

Attached a zip file of all the patches as well as the patches individually.

Updated by John Heathco almost 3 years ago

We could also modify select() to check for is_string like the other DB methods and then use Database_Expression.

Updated by Jeremy Bush almost 3 years ago

  • Status changed from New to Closed
  • Resolution set to fixed

Fixed in r4227 and merged to 2.4 in r4228.

Please remember to follow the kohana coding standards when submitting patches. string concatenation does now have spaces around the ".".

Also available in: Atom PDF