On Mon, Aug 3, 2009 at 3:16 PM, Benjamin Eberlei<[email protected]> wrote:
> Hello everyone,
>
> in combination with the Zend_Entity and Zend_Db_Mapper proposals I felt the
> need for an extension of Zend_Db_Expr. This functionality would also be a huge
> step for Zend_Db_Select to abstract vendor specific functionality even more.
>
> A common expression object offers access to abstract from vendor specfic 
> syntax
> of building database queries, conditions, functions and such. It should
> implement as much common functionality of the current supported database
> drivers as possible.
>
> http://framework.zend.com/wiki/display/ZFPROP/Zend_Db_Expr+Extension+-+Benjamin+Eberlei
>
> The expression object utilizes Zend_Db_Expr when necessary and offers
> convenience functionality to escape the inputs correctly.
>
> I hope you can give me valuable feedback!

If the intent is truly to abstract from "vendor specific syntax", the
first thought that comes to mind is to start with ANSI SQL and work
out from there. For instance, use case 6 suggests an ifnull() function
rather than coalesce(). The former, I believe, is implemented in MySQL
and SQLite, while the latter is standard and is supported across
MySQL, SQLite, Oracle, SQL Server, and PostgreSQL.

It gets further confusing since there is a function ISNULL in both
MySQL and SQL Server that do totally different things. In MySQL, it
returns 1 if the argument is NULL and 0 if it is not. In SQL Server,
it is similar to COALESCE (but not the same).

Andrew

Reply via email to