[OGo-Developer] sope-gdl1: escaping and datatypes

Helge Hess developer@opengroupware.org
Thu, 6 Sep 2007 22:34:03 +0200


On 06.09.2007, at 19:20, Wolfgang Sourdeau wrote:
> There seems to be some confusion in the way GCS escape sequences such
> as "\" and "'". In -[GCSFolder _formatRowValue:], a GCSStringFormatter
> instance is invoked with the "stringByFormattingString:" method. But
> instead, wouldn't it be better if the escaping occured at the
> channel-level?

I didn't look at the GCS code in detail, but the SQL escaping  
"should" be done in the appropriate EOAdaptor subclass. The relevant  
methods are
-formatAttribute:
-formatValue:forAttribute:

Those call -expressionValueForContext: on the value which I think is  
overridden in the respective adaptor, but I'm not 100% sure.

When I look at GCSFolder -_formatRowValue:, it looks quite "wrong" to  
me (well GCS was designed for PG only ...).

> For example, using postgres causes the string to be escaped and to be
> unescaped afterwards, which seems a bit unclean...

Not sure what you mean by that. GCSFolder generates raw SQL, this  
isn't unescaped afterwards?

Helge