Skip to end of metadata
Go to start of metadata
You are viewing an old version of this page. View the current version. Compare with Current  |   View Page History

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

Zend Framework: Zend_Db_Expr Function Abstraction Component Proposal

Proposed Component Name Zend_Db_Expr Function Abstraction
Developer Notes http://framework.zend.com/wiki/display/ZFDEV/Zend_Db_Expr Function Abstraction
Proposers Benjamin Eberlei
Zend Liaison TBD
Revision 1.0 - 3 August 2009: Initial Draft. (wiki revision: 4)

Table of Contents

1. Overview

Currently Zend_Db_Select does not allow to write completly portable applications when it comes to
abstraction of SQL functions. This proposal aims to close the gap as much as possible by offering
an Expression object inside Zend_Db_Select and Zend_Db_Adapter_Abstract. The largest possible
subset of functions between all the current supported vendors is integrated. Additionally a
"non" compatible modus will be included that abstracts as much functions from each vendor as possible.

Each implemented Expression/SQL Function will enforce the escaping of values.

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

  • This component MUST abstract as much SQL functions as possible that are common between: MySQL, PgSql, SqLite, Oracle, IBM Db2, SqlSrv
  • This component MUST be nested inside each Zend_Db_Select instance and globally inside the Adapter
  • The Adapter SHOULD enforce the expression object to be created only once.
  • This component WILL offer a non-compliant modus where additional vendor-specific functions are nested in
  • This component WILL enforce escaping of all variables and columns in each expression.

4. Dependencies on Other Framework Components

  • Zend_Db_Adapter_Abstract
  • Zend_Db_Select

5. Theory of Operation

You can use the Query Expression object to generate Zend_Db_Expr instances with specific supported functions.

The question is, how would this query expression object be available to the consumer? There are several possible APIs:

I opt for a simple syntax, which makes the usage as non-verbose as possible.

6. Milestones / Tasks

  • Milestone 1: Community Review
  • Milestone 2: Zend Acceptance
  • Milestone 3: Implementation & Documentation

7. Class Index

  • Zend_Db_Expr_ExpressionAbstract
  • Zend_Db_Expr_Mysql
  • Zend_Db_Expr_Sqlite
  • Zend_Db_Expr_Oracle
  • Zend_Db_Expr_IbmDb2
  • Zend_Db_Expr_PgSql
  • Zend_Db_Expr_MsSqlServer

8. Use Cases

9. Class Skeletons

]]></ac:plain-text-body></ac:macro>

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.