Boost logo

Boost :

Subject: [boost] [rdb] 0.11
From: Jean-Louis Leroy (jl_at_[hidden])
Date: 2009-10-03 19:00:01

In this drop :

* Everything related to SQL composition has been moved to namespace

* Update syntax has changed, instead of .set().set() chains it is now
closer to SQL syntax (an deasier to implement):

    update(p).set( = 1, p.first_name = "Homer")

* Qualified table names:

    person::qualified p;
    partner::qualified l;
    select(, l).where( == l.wife)


    select from person, partner where = partner.wife

* in predicate:

    select(, l).where(
    select( + 1, 2))


    insert_into(p)(, p.age).values(1, null)
    update(p).set(p.age = null).where( == 1)

    select( == null)

Whoa! This gives:

    select id from person where age is null

I'm only 80% sure about this one. Like everybody I suppose I have tried
one day to compare with NULL, only to realize that the result is always
false. After a while, ahem...So I have implemented operator == to do the
right thing. It could have been:


Does anyone has an example where it makes sense to truly compare (using
=) with NULL ?

As for returning the NULL indicator when reading results, I chose not to
use Boost.Optional (although I will probably add support for optional as
well) because:
1. it would cost one bool (most likely the size of an integer) per column
2. IMHO the automatic conversion to bool is a bad idea
3. the value inside an optional<> cannot be addressed

Instead I have complemented a fusion::vector with a std::bitset.

The tutorial shows how to use this. I am hesitating a bit about pushing
fusion::vector inside the implementation (i.e. nullable<int, char...>
instead of nullable< fusion::vector<int, char> >).

* Result sets: execute(Select) now returns a ResultSet object that
allows retrieval row by row: also see the tutorial here :

There is also a "Jumbo select" at the bottom of the tutorial that recaps
everything that is supported for the moment.


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