[squeak-dev] PostgresV3 with parameter binding

Levente Uzonyi leves at caesar.elte.hu
Sun Dec 23 12:50:45 UTC 2018


Hi Pierce,

On Sun, 23 Dec 2018, Pierce Ng wrote:

> Hi Levente, Balázs, and all,
>
> I've modified PostgresV3 to support parameter binding so that parsing
> SQL with placeholders and binding/executing with data are done
> separately. So far tested inserts and selects successfully.

That's great news.

I didn't finish the implementation of the extended query protocol, because 
it didn't really give us any benefit. I expected better parsing 
performance from binary encoded column values, but that only applies to 
certain types, its use is discouraged by the Postgres devs (it relies on 
internal representation which may change between versions) and you have to 
specify it before you execute the query for each response column.
But if you write SQL queries in Smalltalk (something we avoid to do), then 
there are cases when it is better than the simple query protocol.

>
> I've created an account on Squeaksource called PierceNg.  Happy to
> contribute my changes to the Squeaksource repo if you grant me commit
> access.

I have added you as developer.

>
> I'm more of a Pharo user, and intend to make PostgresV3's TLS work with
> Pharo, and also to develop a more friendly API for it. Of course I will
> keep protocol state machine changes in sync between the Squeak and Pharo
> versions.

The last time I checked, many things worked out of the box in Pharo. I'm 
sure there will be problems with text encoding and the time primitives 
(methods have different names for no reason).

Levente

>
> Screenshots:
>
> 1 - Wireshark capture of a select protocol exchange.
>
> 2 - Pharo inspector of a PG3ResultSet. More work needs to be done - the
> left-most column should not be large negative numbers.
>
> Cheers,
>
> Pierce
> https://www.samadhiweb.com/blog
>
>


More information about the Squeak-dev mailing list