[Typo3-dev] quoting SQL-identifiers
Martin Kutschker
martin.kutschker at no5pam.blackbox.net
Mon Apr 25 09:39:18 CEST 2005
"Karsten Dambekalns" <karsten at typo3.org> schrieb im Newsbeitrag
news:mailman.1.1114183333.29393.typo3-dev at lists.netfielders.de...
> Hi.
>
> Rainer Kuhn wrote:
>> Martin Kutschker wrote:
>>> It's possible to quote SQL-identifiers (eg table names) to avoid a clash
>>> with reserved names.
>
> Even better - don't use reserved names at all. Use quoting to make sure
> *allowed* names are correctly understood (upper/lower case as an example).
Good advice, but has a problem. Depending on theRDBMS and its current and
*future* features reserved names may change or- more likely - to be added.
>> > How about other RDBMS'?
>>
>> AFAIK for PostgreSQL it's " (double quotes).
>
> For all *but* MySQL it's " - that's the standard. Go figure. :/
You can force Mysql into an ANSI mode. But I don't know what is affected
besides the quotes.
>> IMHO we should offer at least one DBAL method (as the one you suggested)
>> to use if needed. Furthermore I think it wouldn't be bad to use
>> identifier
>> quoting in DBAL per default, this could prevent any probems.
>
> "Real" DBAL, i.e. if using the DBAL extension, does quote all identifiers
> automagically. To have TYPO3 quote identifiers automatically will probably
> not be accepted by Kasper (this would mean we'd have to do more parsing
> and
> string-juggling), so rather change the field name.
>
>
> That's my view. :)
So DBAL does fiddle with queries. Judging from earlier posts I thiought it
didn't.
Can't say I like automagical quoting better that clean quoting via distinct
API. But that's only my view.
Masi
More information about the TYPO3-dev
mailing list