Re: General Parser - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: General Parser
Date
Msg-id 41861A10.1000607@opencloud.com
Whole thread Raw
In response to General Parser  (Ulrich Meis <kenobi@halifax.rwth-aachen.de>)
Responses Re: General Parser
code duplication (was: Re: General Parser)
stable release
List pgsql-jdbc
Ulrich Meis wrote:

> Attached you'll find a QueryParser class I've written that has all the
> functionality that is implemented in the above methods and handles dollar
> quoting. It parses the query in one run, so I believe it's pretty fast.

> The class still needs extensive testing but I wanted to make sure that I'm
> doing the right thing first...so what are your thoughts?

I think it's a good idea to unify all the parsing that needs to be done,
if only because it reduces code duplication.

That said, this still needs some work as the various different callers
need different parsing done. For example, we only care about splitting
queries into multiple statements when using the V3 protocol, we only
care about ? placeholders when parsing a query supplied via
prepareStatement, the { call } syntax only makes sense for
CallableStatements, and there's no need to disassemble the SELECT etc if
the application never uses an updatable resultset.

I'm not sure how easy it will be to have a single flexible parser and
still have low overhead for the cases where we don't want to completely
disassemble the query.

-O

pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: General Parser
Next
From: Ulrich Meis
Date:
Subject: Re: General Parser