Re: libpq++ - Mailing list pgsql-interfaces

From Carlos Moreno
Subject Re: libpq++
Date
Msg-id 200105091515.AA58851606@mochima.com
Whole thread Raw
In response to libpq++  ("J. T. Vermeulen" <jtv@cistron-office.nl>)
Responses Re: libpq++
List pgsql-interfaces
>>  - provide STL-conformant interfaces for iterating over result sets;
>>  - allow fields to be accessed in a type-safe manner;

This would be beautiful!  I can picture myself having fun 
writing code like this:

conn.Exec ("select .....");

copy (conn.tuples().begin(), conn.tuples().end(),      ostream_iterator<tuple> (cout, "\n"));

(or even conn.begin(), conn.end())

or:

void custom_print_row (const tuple & row)
{   cout << "ID: " << row["ID"] << endl        << "Name: " << row["name"] << endl         << "Age: " << current_year()
-row["year_born"]         << endl << endl;
 
}

for_each (conn.begin(), conn.end(), custom_print_row);

Things like that...  Definitely nice! 

Carlos
--



pgsql-interfaces by date:

Previous
From: Bruce Momjian
Date:
Subject: libpq++ FieldSize fix
Next
From: Palle Girgensohn
Date:
Subject: Re: Trouble with JDBC2 ResultSet.getDate()