$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
From: Vinzenz Feenstra (evilissimo_at_[hidden])
Date: 2005-02-10 11:11:36
Arkadiy Vertleyb wrote:
> "Vinzenz Feenstra" <evilissimo_at_[hidden]> wrote
> 
> 
>>What exactly ist the motivation and the goal of rel/rtl ?
> 
> 
> To implement an STL-compatible "relational table" container, that is
> type-safe and allows fields of any built-in or user-defined type.
> 
> Naturally, once there is a container, operations are required.  Hence, the
> relational algebra.
> 
> We think such library could become a good alternative to, for example, MS
> Access, for light-weight applications.   Also, the possibility to perform
> relational operations on objects might bring new and unexpected
> possibilities.  As always with relational databases, the library is
> particulary convenient and efficient when multiple views of the same data
> are required and need to be kept in-sync.
> 
> HTH,
> 
> Arkadiy
> 
Hmm, that sounds interessting.
I started thinking about doing some Policy Based, for a Database 
Frontend Library. And thought about using a STL-Container like interface
But this class will access a real database, like SQLite.
This what I am posting here is only an idea how it could be used:
------------------------------------------------------------------------
typedef  dbContainer<
                    // SQLite does not need any user/pw infos
                    dbDatabase ( "Company.db" ),
                    dbTable ( "Ware" ), // using table Ware
                    dbRow <  // defining the field of a row
                           dbValues <
                                     dbInt<
                                           "id" ,
                                           dbFieldOptions<
                                                          dbPrimaryKey
 
dbAutoIncrement
                                                         >
                                           >,
                                      dbText  < "name" > ,
                                      dbFloat < "price" >
                                     >
                         > , // end fields of a row definition
                    dbBackend < dbSQLite >  // use the SQLite Backend
                    >  WareTable;
typedef WareTable::row_type WT_Row;
WareTable wt_test;
wt_test.insert(WT_Row(dbNULLType, "Apple"  , "3.33" ));
wt_test.insert(WT_Row(dbNULLType, "Orange" , "2.13" ));
wt_test.insert(WT_Row(dbNULLType, "Peach"  , "4.57" ));
wt_test.insert(WT_Row(dbNULLType, "Plum"   , "7.49" ));
dbResIterator<WT_Row> results = wt_test.lookup(dbText<"name","Plum">);
while(results){
   while(results.columns)
      std::cout << *(results.columns++) << std::endl;
   ++results;
}
------------------------------------------------------------------------
However this is only an idea I have, where nothing of it is implemented 
or something.
I was asking myself if boost::rel/rtl will go in this direction or not.
A db- backend would be nice, wouldn't it?
Or a kind of SaveToDatabase ^^ xD
BR
Vinzenz