Package picalo :: Module Database :: Class _Cursor
[show private | hide private]
[frames | no frames]

Class _Cursor

AbstractDecorator --+
                    |
                   _Cursor


A database cursor. Since Picalo automatically manages cursors, you don't need to create these directly.
Method Summary
  __init__(self, parent, obj)
  __iter__(self)
Returns an iterator to the most recent results
  __repr__(self)
Returns a string representation of this connection
  __str__(self)
Returns a string representation of this connection
  execute(self, sql, parameters)
Executes the given sql
  query(self, sql, parameters)
Runs an SQL query.
  query1(self, sql, parameters)
Runs an SQL query (using cursor.execute) and returns the first record in the result set.
  table(self, sql, parameters)
See Database.Connection.table() for information on this method.
    Inherited from AbstractDecorator
  __cmp__(self, other)
  __delattr__(self, name)
  __eq__(self, other)
  __ge__(self, other)
  __getattr__(self, name)
  __gt__(self, other)
  __hash__(self)
  __le__(self, other)
  __lt__(self, other)
  __ne__(self, other)
  __nonzero__(self)
  __setattr__(self, name, value)

Method Details

__iter__(self)

Returns an iterator to the most recent results

__repr__(self)
(Representation operator)

Returns a string representation of this connection
Overrides:
picalo.base.Global.AbstractDecorator.__repr__

__str__(self)
(Informal representation operator)

Returns a string representation of this connection
Overrides:
picalo.base.Global.AbstractDecorator.__str__

execute(self, sql, parameters=None)

Executes the given sql

query(self, sql, parameters=None)

Runs an SQL query. The results of this method can be iterated directly. Although you cannot randomly access the records by index (only sequentially in a for loop), this method is much more efficient than table() because it pulls only one record into memory at a time.

query1(self, sql, parameters=None)

Runs an SQL query (using cursor.execute) and returns the first record in the result set. This is useful when you only expect one row (such as SELECT MAX(...) queries).

table(self, sql, parameters=None)

See Database.Connection.table() for information on this method.

Generated by Epydoc 2.1 on Mon Aug 20 05:38:17 2007 http://epydoc.sf.net