Boost logo

Boost :

From: Phil Endecott (spam_from_boost_dev_at_[hidden])
Date: 2008-07-10 20:34:31

Maciej Sobczak wrote:
> 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.


> PostgreSQL always uses text transmission of query arguments, and they
> are also passed separately from the query.

Not great :-(

> 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).

Hmm. I was under the impression that ints were always sent in network
byte order (i.e. big endian), and I think I would have noticed if I'd
got it wrong because I've only ever used it on little-endian systems.
Is there some other convention that you're thinking of? It took me a
while to get date/time types right I suppose.

Anyway, as I noted above, the benefit that I have mentally associated
with passing query arguments as strings but now see from your design
need not be dependent on it, is explicit typing. When I declare
statements I indicate the types of the arguments; when I execute the
statements the compiler checks that I'm supplying values of the right types.

IMHO you should go ahead and submit SOCI for a Boost review. Then we
can spend weeks discussing the relative merits of all the different
design choices....


Boost list run by bdawes at, gregod at, cpdaniel at, john at