[TYPO3-mvc] Discussion: Storage Backend not compatible to DBAL
Xavier Perseguers
typo3 at perseguers.ch
Thu Nov 19 11:04:48 CET 2009
Hi,
> since the "fast Version" of rewriting did not get into 4.3 (sry i did
> not have the time for finishing patch due to an "clients emergency"
> (server break)) i would say for 4.4 we should provide a clean solution.
>
> BUT: providing backends for all instead of using DBAL is not a solution
> to me.
Neither to me.
> Why?
> 1. mixed envirenments would not be supported (as of DBAL)
> 2. table Mappings would not be supported (mapping feature of extbase
> works only within one database)
This is a *must* when using Oracle as the identifier length limit is 32
characters. Problem already arises with TemplaVoilà which has a long
table name:
tx_templavoila_datastructure
28 chars. But as it contains auto-increment columns, sysext:adodb (which
is the real DB layer to connect to another DBMS), creates a sequence for
the counter (as auto-increment is not supported by Oracle) whose name is
something like "<table>_<column>_seq" and this is longer than 32 characters.
DBAL provides a way to remap table names:
$TYPO3_CONF_VARS['EXTCONF']['dbal']['mapping'] = array(
'tx_templavoila_datastructure' => array(
'mapTableName' => 'tx_templavoila_ds',
),
);
You may have a (quick) look at this:
http://xavier.perseguers.ch/tutoriels/typo3/articles/oracle-database/configuring-typo3.html
This feature works well in DBAL but it needs parsing the query, this is
why there was (and for sure will still be) so problems with DBAL when
using "special" queries. If a query cannot be parsed, DBAL breaks. This
is very easy :-)
> 3. reinvent the wheel? better join forces an optimize DBAL
>
>
> Xavier made a patch which makes Extbase basically supported in 4.3 which
> I'm currently using. I - for shure - did not test all extbase
> possibilities for failure by know, just "select" no update or inserts by
> know...
Patch is this one:
http://bugs.typo3.org/view.php?id=12603
I said there that this patch will be part of TYPO3 4.4 after more
testing. It basically adds parsing to sql_query() method which normally
does nothing else than sending the query to ADOdb to be executed on
DBMS. However this does not include any remapping...
I guess my solution of trying to parse the query is the best solution
for Extbase but it needs a bit testing and Extbase should not start to
issue complex queries unless it is supported by DBAL.
Moreover, table name length implied by Extbase *will* be a problem and
remapping will have to be done I would say for each and every "Extbase
table" (I mean table from Extbase-based extensions). What would be very
cool, would be to provide this mapping semi-automatically:
- Have a tool in DBAL that detects potentially problematic table names
and show a possible mapping configuration to be used (I would add that
to TYPO3 4.4)
- It may be done purely on DBAL-side but having a method in Extbase that
would "shorten" a table name given an extension name (e.g., by special
camel-case name of extension with only upper letter) would ease DBAL work
--
Xavier Perseguers
DBAL Leader
http://forge.typo3.org/projects/show/extension-dbal
More information about the TYPO3-project-typo3v4mvc
mailing list