Re: Patch for jdbc escaped functions

From: Xavier Poinsard <xpoinsard(at)free(dot)fr>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Patch for jdbc escaped functions
Date: 2004-11-22 14:09:39
Message-ID: 41A1F323.1070508@free.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Kris Jurka wrote:
> This code is not quite right in its determination of function arguments
> because it stops checking for literal and identifier markers.
> Consider that {fn concat('(', a."(")} should work.

Thanks for pointing these defects.
I added this to the parsing and your example to the tests.

>
> I also don't like the prospect of a giant if/else block that has every
> function that must do some kind of mapping/translation. What about a more
> pluggable architecture perhaps along the lines of the following:
>
> public interface StandardFunction {
> public void toSQL(StringBuffer sb, ArrayList args);
> }
>
> Then a static HashMap of say lowercase function name -> StandardFunction
> implementation can move all of the mapping/translation into a separate
> place. Maybe that's overkill in the opposite direction. Thoughts?

I used reflection to move the translation part to EscapedFunctions class.
Right ?

Attachment Content-Type Size
escapedfunctions2.diff text/x-patch 14.9 KB

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message James Robinson 2004-11-22 16:44:05 Any knowledgeable Object -> Relational coders in here?
Previous Message Kris Jurka 2004-11-22 08:36:32 Re: jdk1.5, pgsql8 on WinXP: classpath problems