Saturday, 2 May 2009
I'm happy to announce (bit unofficially) the first (alpha) source code release of MySQL Connector/Python. It's hosted on Launchpad and can be downloaded using the Bazaar client. It's more a preview as I'm still working on it during free time. Please post comments, bug reports, ideas, critics, etc..
MySQL Connector/Python is a rewrite of the MySQL Protocol in Python. It does not require the C library libmysqlclient, thus no compiling. However, I'm currently working on making a version which will be linked with the MySQL libraries, for performance.
Small, silly example:

#!/usr/bin/env python

import mysql.connector

db = mysql.connector.Connect(host='localhost')
cursor = db.cursor()

stmt = "SELECT VERSION()"
cursor.execute(stmt)
row = cursor.fetchone()
print row
db.close()
3 comments:
Pedahzur said...

Since this wasn't addressed in the README: I assume the driver is DB API 2.0 compliant?

Also, what optional features (such as .lastrowid) do you support?

Geert JM Vanderkelen said...

@Pedahzur

Yes, it should be DB API 2.0 compliant. If not, leave a bug report and I'll address it :)

I'll look at the lastrowid thing.

Domas Mituzas said...

Congrats, sire Geert!

Post a Comment