Received: from smtp.cistron-office.nl (10fwd.cistron-office.nl [195.64.65.197]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f2BJKDx02523 for ; Sun, 11 Mar 2001 14:20:13 -0500 (EST) (envelope-from jtv@cistron-office.nl) Received: from subspace.cistron-office.nl ([195.64.65.200]) by smtp.cistron-office.nl with esmtp (Exim 3.22 #1 (Debian)) id 14cBNz-0002cr-00; Sun, 11 Mar 2001 20:20:11 +0100 Received: (from jtv@localhost) by subspace.cistron-office.nl (8.9.3/8.9.3/Debian 8.9.3-6) id UAA29935; Sun, 11 Mar 2001 20:20:11 +0100 Date: Sun, 11 Mar 2001 20:20:10 +0100 From: "J. T. Vermeulen" To: Randy Jonasz Cc: "J.T.Vermeulen" , pgsql-interfaces@postgresql.org Subject: Re: libpq++ Message-ID: <20010311202010.B29078@cistron.nl> Mail-Followup-To: Randy Jonasz , "J.T.Vermeulen" , pgsql-interfaces@postgresql.org References: <20010308000250.I3900@cistron.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from rjonasz@click2net.com on Thu, Mar 08, 2001 at 04:31:19PM -0500 X-Disclaimer: Include standard disclaimer here. X-Archive-Number: 200103/90 X-Sequence-Number: 1251 On Thu, 08 Mar 2001, Randy Jonasz wrote: > psgresult::iterator row = res.begin(); > pgresult::iterator end = res.end(); > > while( start < end ) { > > *row >> var1 >> var2; > //or > var1 = row["colname"]; > //or > var1 = row[col]; > > } Right! For now I wouldn't so far as to make the result sets modifiable though. That would be opening a whole new can of worms. Also, there is the issue of type safety to be dealt with. I think that has priority over operator << on result sets. So initially at least, const_iterators only. But definitely yes on the sequence algorithms, and perhaps we could find a meaningful way to work in associative behaviour as well. One side effect of having a type-safe interface would be that the COPY command no longer requires complete compile-time knowledge of a table's definition. If COPY is faster than INSERT for mass inserts (I have no idea whether it is, but it might just skip a bit of parsing on the server side and send less data over the wire), that would allow for faster data insertion while keeping the program reasonably robust w.r.t. schema changes. Another thing that could be done is to also have a more restricted interface where you don't send SQL at all, and all operations are encoded in the class interface. That might make it possible to have more-or-less generic failover built into the frontend (automatically restore active triggers when connection to server is recovered, stuff like that). Jeroen