""" dbx is a simple SQL database abstraction layer for Python. The goal of dbx is to make using a SQL database as simple as possible while providing a consistent API across different databases. The Python DB-API is powerful, yet complex. An application that simply needs to execute a query and iterate over the results does not need all that power and can greatly benefit from a simpler interface. This is an example using DB-API: | import MySQLdb | conn = MySQLdb.connect(db="test", host="localhost", | user="user", passwd="pass") | cursor = conn.cursor(MySQLdb.cursors.DictCursor) | cursor.execute("SELECT name, phone FROM User") | rows = cursor.fetchall() | for i in rows: | print i["name"], i["phone"] | cursor.close() | conn.close() This is an example using dbx: | import dbx.mysql as dbx | db = dbx.MySQL("test", "localhost", "user", "pass") | rows = db.listQuery("SELECT name, phone FROM User") | for i in rows: | print i["name"], i["phone"] | db.close() As you can see, it is easier to use dbx because you do not need to deal with cursors. You also do not need to worry about how results are returned, since they are always returned as dictionaries. Exceptions are also handled consistently. """ __author__ = "David Phillips " __version__ = "0.14"