Boost logo

Boost :

From: Arkadiy Vertleyb (vertleyb_at_[hidden])
Date: 2002-11-01 10:44:11


1. We can have a column whose type is a table (see code below);
2. As far as other relations (operators) are concerned, right now we can't
do this because currently the operators are not default constructible. This
could be easily fixed.
3. Just out of curiosity, how would you use this feature? It might become a
major advantage of this library over traditional RDBMSs.

Arkadiy

==============================

COLUMN(a1, int);
typedef tuple<list<a1> > tuplea_type;
typedef table<tuplea_type> tablea_type;

COLUMN(b1, int);
COLUMN(b2, tablea_type);
typedef tuple<list<b1, list<b2> > > tupleb_type;
typedef table<tupleb_type, list<b1> > tableb_type;

void foo() {
  tableb_type tab;
  for (int i = 0; i < 5; ++i) {
    tablea_type t;
    t.insert(i);
    t.insert(i * i);
    t.insert(i * i * i);
    tab.insert(tupleb_type(i, t));
  }
  for (tableb_type::const_iterator it = tab.begin(); it != tab.end(); ++it){
    cout << "tuple " << FIELD(*it, b1) << endl;
    print(FIELD(*it, b2));
  }
}

==============================

"Joachim Achtzehnter" <joachim_at_[hidden]> wrote in message
news:Pine.WNT.4.43.0210311521220.159-100000_at_van4.netacquire.com...
> This is definitely interesting. With respect to relational programing I
> think Chris Date's recent ideas about how the relational model should be
> interpreted/used are especially relevant. In that context the current
> implementation has a significant shortcoming: It doesn't easily support
> columns whose type is a relation itself.
>
> Joachim
>
> --
> work: joachima_at_[hidden] (http://www.netacquire.com)
> private: joachim_at_[hidden] (http://www.kraut.ca)
>
> _______________________________________________
> Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost
>


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