[DB-SIG] Python Database Objects (PDO)

Bryan J Gudorf bryan at bryangudorf.com
Wed Sep 17 00:16:30 EDT 2003


 Hey Everyone,
      I just finished writing a tool called Python Database Objects (PDO)
that acts like a wrapper class over DB-API 2.0 based modules, giving
them a giving them a common object oriented api.  It was inspired by
ADO, JDBC and other object oriented APIs.In theory, it should make
switching between databases and deployment of database driven
applications easier.
     PDO is being released under a BSD License by my company,
NeuroKode Labs, and is available at: http://pdo.neurokode.com.
We've created a sourceforge project, and are opening development
of this module to the python community. PDO has also been registered
with the Python Packages Index.
      Right now PDO supports basic database functionality: Select,
Update, Insert, Delete through two Objects: ResultSet Object and
Simple Execute

Heres a really quick example:

import pdo
DBConn =
pdo.connect('Module=MySQLdb;User=SalesReader;Passwd=secretpassword;DB=Sales'
)
Results = DBConn.openRS("SELECT * FROM Customers")
while Results.next()
    print "Name: " + Results.fields['Name'].value

...
It supports MySQL and SQLite currently, but adding support for other DB-API
modules should be a snap.  Its usable already, but we'll be adding more
features
(such as a complex execute with query paramters, and editable recordsets)
as we get time.
Thoughts, opinions?

~Bryan J Gudorf
NeuroKode Labs, LLC




More information about the DB-SIG mailing list