[TYPO3-mvc] Retrieving and saving from and to a different database

Henjo Hoeksma me at henjohoeksma.nl
Mon Apr 23 00:38:07 CEST 2012


Hi Jigal,

for this case fortunately separation of properties will not be necessary.
Time to dive into the mysteries of DBAL then! Thanks for your response :-)

Kind regards,

Henjo

Problems are small because we learned how to deal with them.
Problems are big because we need to learn how to deal with them.


On Sun, Apr 22, 2012 at 11:02, Jigal van Hemert
<jigal.van.hemert at typo3.org>wrote:

> Hi Henjo,
>
>
> On 22-4-2012 0:35, Henjo Hoeksma wrote:
>
>> I am currently looking for the possibilities to retrieve from and save to
>>> a different database than the sites database.
>>>
>>> I have seen the Typo3DbBackend class where the database handle is set and
>>> I wonder if I would extend that class using a constructor to set a
>>> different database handle if that would work.
>>>
>>
> Usually the way to have part of the database tables in a different
> database is using DBAL. You can define on a per table basis which database
> connection should be used. You can even map table and field names; this way
> you can use table and field names which do not follow the TYPO3 standards.
>
> There are a few restrictions and potential problems:
> - you cannot use tables from different databases (connections) in a single
> query (e.g. join two tables from different database connections)
> - the queries have to follow the DBAL guidelines. DBAL has to analyze and
> rewrite the queries and only supports a subset of the MySQL syntax (also
> because other DBMSs have a different feature set).
>
> I've understood that Extbase is not fully DBAL compatible. If that is the
> case this should be a priority to fix. The core (including system
> extensions) must be DBAL compatible IMO.
>
> Having certain properties of an object in one database and others in
> another database would be very hard if not impossible to achieve. Even a
> simple select query with a where clause which uses the value of such a
> property needs to be split in two queries to works across databases.
>
> --
> Jigal van Hemert
> TYPO3 Core Team member
>
> TYPO3 .... inspiring people to share!
> Get involved: typo3.org
> ______________________________**_________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc@**lists.typo3.org<TYPO3-project-typo3v4mvc at lists.typo3.org>
> http://lists.typo3.org/cgi-**bin/mailman/listinfo/typo3-**
> project-typo3v4mvc<http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc>
>


More information about the TYPO3-project-typo3v4mvc mailing list