From: Gabriel E. <ga...@de...> - 2002-04-18 22:26:46
|
I should have said; it is in the postgres dbd. Most databases return the affected rows and row counts in one call. Postgresql uses two calls to do this. I have patched my copy of postgres. I sent a patch to the Ruby-Postgresql maintainer as well, which supports the change to the Pg.rb in DBI (it is in the latest version on the Ruby-Postgresql site.) What I did was create another function just like rows called "rows.affected", which returns @pgresult.cmdtuples instead of num_tuples. I couldn't think of an easy way to make rows() return either value depending without analyzing the query... maybe it is simple. Thanks, Gabriel (btw, I sent a similar patch to the SQLrelay maintainers, so the postgresql driver there returns either rows or affected rows, so the DBI interface to SQLRelay for Postgres should be correct) On Thu, 18 Apr 2002, Sean Chittenden wrote: > > Has any decision been reached on whether to include the affected > > rows count in rows(), or if a new method will be created for the > > purpose? > > > > It's the last feature that keeps me from using a stock dbi on our > > system. > > I think that's a function of the underlying DBD. What database are > you using? I might be able to toss you a patch if it's postgres... -sc > > -- > Sean Chittenden > |