Re: RFC C++ Interface
От | Randy Jonasz |
---|---|
Тема | Re: RFC C++ Interface |
Дата | |
Msg-id | Pine.BSF.4.30.0012131438010.51433-100000@nietzsche.jaded.net обсуждение исходный текст |
Ответ на | Re: RFC C++ Interface (ncm@zembu.com (Nathan Myers)) |
Ответы |
Re: RFC C++ Interface
|
Список | 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@zembu.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
В списке pgsql-hackers по дате отправления: