Module ezsqlobject
[show private | hide private]
[frames | no frames]

Module ezsqlobject

A Convenience layer for SQLObject

Provides easy access to existing databases, without having to creats python classes mimicking the database schema.

Abstracts a database into an object with an attribute called 'tables', and which on accessing any existing table as an attribute, returns an SQLObject subclass for that table (with an attribute 'columns', listing the table's columns).

Example use:
 >>> import sqlobj
 >>> db = sqlobj.mysqlobj(db='test', user='test', passwd='test')
 >>> print db.tables
 ['address', 'people']
 >>> addr = db.address
 >>> print addr.columns
 ['street', 'suburb', 'city', 'phone']
 >>> pps = db.people.select()
 >>> for p in pps: print p
 <people 1 first='fred' last='daggg' age=34L>
 <people 2 first='mary' last='smith' age=27L>
 <people 3 first='adam' last='jones' age=42L>
 <people 4 first='jane' last='doe' age=35L>

Classes
EzDbmDb EzSqlDb subclass specific for DBM databases
EzFirebirdDb EzSqlDb subclass specific for Firebird databases
EzMysqlDb EzSqlDb subclass specific for MySQL databases
EzPostgresDb EzSqlDb subclass specific for PostgreSQL databases
EzSqlDb Abstracts an SQL database into an object, whose attribute 'tables' contains a list of existing tables in the database.
EzSqliteDb EzSqlDb subclass specific for SQLite databases
EzSqlResults Wrapper for SQLObject results objects
EzSqlTab Convenience wrapper for SQLObject table classes

Generated by Epydoc 2.0 on Fri Mar 26 13:22:45 2004 http://epydoc.sf.net