From: | Randy Jonasz <rjonasz(at)click2net(dot)com> |
---|---|
To: | <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: RFC C++ Interface |
Date: | 2000-12-13 20:16:28 |
Message-ID: | Pine.BSF.4.30.0012131438010.51433-100000@nietzsche.jaded.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Interesting comments. I can see using the STL framework for iterating
through result sets being one way to go. Would something like:
vector<pgrows>table = pgdb.exec("Select * from foo");
vector<pgrows>::iterator row;
vector<pgrows>::iterator end = table.end();
for( row = table.begin(); row != end; ++row ) {
*row >> field1 >> field2;
//do something with fields
}
be along the lines you were thinking?
Cheers,
Randy
On Tue, 12 Dec 2000, Nathan Myers wrote:
> On Tue, Dec 12, 2000 at 05:28:46PM -0500, Bruce Momjian wrote:
> > > On Sun, Dec 10, 2000 at 06:53:11PM -0500, Bruce Momjian wrote:
> > > > > I appreciate your comments and would like to respond to your
> > > > > concerns. The API I sketched in my earlier e-mail is borrowed
> > > > > heavily from Rogue Wave's dbtools.h++ library. I think it can be
> > > > > a very clean and elegant way of accessing a database.
> > > >
> > > > Rogue Wave's API is quite interesting. It would be a challenge to
> > > > implement. If you think you can do it, I think it would be a real
> > > > win, and a real object-oriented API to PostgreSQL.
> > >
> > > I was co-architect of the Rogue Wave Dbtools.h++ interface design
> > > ... The design is really showing its age. SQL92 and SQL3 didn't
> > > exist then, and neither did the STL or the ISO 14882 C++ Language
> > > standard.
> >
> > Can you suggest areas that should be changed?
>
> As I recall, we were much more fond of operator overloading then than is
> considered tasteful or wise today. Also, there was no standard for how
> iterators ought to work, then, whereas today one needs unusually good
> reasons to depart from the STL style.
>
> Nathan Myers
> ncm(at)zembu(dot)com
>
>
Randy Jonasz
Software Engineer
Click2net Inc.
Web: http://www.click2net.com
Phone: (905) 271-3550
"You cannot possibly pay a philosopher what he's worth,
but try your best" -- Aristotle
From | Date | Subject | |
---|---|---|---|
Next Message | Raymond Chui | 2000-12-13 21:17:31 | How to import/export data from/to an ASCII file? |
Previous Message | Peter Eisentraut | 2000-12-13 20:09:17 | Re: Bug in FOREIGN KEY |