On Mar 14, 2007, at 2:13 PM, johnf wrote:
> Hmm interesting. I like the fact that it is written python. It
> works. But
> it is not following the standard API as I understand it. It does
> not have
> any of the "fetch" functions.
> Uses several other functions:
> for row in pg8000.Cursor.iterate_dict(cur):
> print row
I first saw this product last week, and dbapi-compliance was planned
for the future. A week later I see that they've already added it. It
seems it is an additional module; see the notes at: http://
pybrary.net/trac/wiki/pg8000/DBAPI
> This statement is interesting:
> The database connection is derived from the Cursor class, which
> provides a
> default cursor for running queries. It also provides transaction
> control via
> the 'begin', 'commit', and 'rollback' methods. Without beginning a
> transaction explicitly, all statements will autocommit to the
> database.
>
> There is that word again "autocommit".
That's the way most modules work.
> I really like the multi-cursor one connection thing.
> db = pg8000.Connection(string)
> cur1 = pg8000.Cursor(db)
> cur2 = pg8000.Cursor(db)
That's exactly what we do with the bizobj. In fact, I just changed
the underlying attribute in the bizobj from _conn to _cursorFactory
to emphasize this point.
> Is this a fetchmany:
>
> row_cache_size [#]
> Determines the number of rows to read from the database server at
> once.
> Reading more rows increases performance at the cost of memory. The
> default
> value is 100 rows. The affect of this parameter is transparent.
> That is, the
> library reads more rows when the cache is empty automatically.
>
> Interesting last line.
It's different, in that you can iterate through the entire result
set, but the cursor only grabs N records at a time from the server.
This reduces response time from the server, but could induce lags if
you need to process the record set at once. That's why they have this
as a tuning setting.
-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev