[TYPO3-core] RFC #15457: Add support for prepared queries
Xavier Perseguers
typo3 at perseguers.ch
Mon Aug 16 22:21:30 CEST 2010
Hi,
Please find v3 attached.
We had kind of a live discussion with other core devs this morning and
here is the summary:
- "Old way" of creating queries ($GLOBALS['TYPO3_DB']->exec_* methods
will still work as before. Only if you explicitly call the
prepare_SELECTquery method will you gain access to enhanced DB API
- We want to provide a PDO-like syntax but we don't aim at having a
PDO-compatible implementation. We can provide enhancements and we should
not fear having some goodies. We want to learn from Extbase (this is why
I added some chaining feature for instance)
What as changed basically with this new version:
- Took comments into account
- Enhanced the documentation with some examples which render properly
when compiling documentation with doxygen or phpdoc
- Removed bindParam() method (borrowed from PDO) because we do not like
this way of programming and it hardly make sense in TYPO3. In PDO it is
used mainly for getting back parameters. We do not have that in TYPO3.
- Added bindValues() which takes an array of parameters. A complement to
the bindValue() method which acts as the parameter you may pass to
execute() but with a potentially clearer separation.
- Added chaining on both bindValue() and bindValues()
Sorry. Did not have time to provide unit tests.
Cheers
Xavier
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 15457_core_v3.diff
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100816/fb4d3264/attachment-0001.txt>
More information about the TYPO3-team-core
mailing list