Boost logo

Boost :

From: Maciej Sobczak (prog_at_[hidden])
Date: 2008-07-10 17:09:46


Phil Endecott wrote:

> Congratulations on the new release. I've had a quick look, and as far
> as I can see it still always uses passes query arguments, even in
> prepared statements, as text strings. In my code, I have enjoyed the
> increased type safety and small performance improvement from passing
> them in binary.

It depends on the given backend, but binary format is most natural in SOCI.

Oracle always uses binary transmission of query arguments, which are
passed separately from the query itself (so-called bound variables, they
are also essential for avoiding SQL-injection issues).

PostgreSQL always uses text transmission of query arguments, and they
are also passed separately from the query. I was meditating on the
binary data transmission, but the interface is basically ill-designed
and even PostgreSQL folks recommended the use of text format for
portability (details: with PostgreSQL the binary format has to comply
with *server* conventions not the client's and you never know what they
are).

I'm not sure about MySQL.

> Is this an inherent limitation of your frontend/backend
> API ?

On the contrary - the frontend/backend API is inherently
binary-oriented. Backends have to handle the differences if they cannot
do binary transmission, but frontend is not aware of this detail. If you
use Oracle, then everything is done in binary. I think it is also true
for ODBC.

-- 
Maciej Sobczak * www.msobczak.com * www.inspirel.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk