Thursday, September 20, 2012

MySQLdb book and other news

Did you know there is a book specifically addressing how to use MySQLdb? MySQL for Python was published by Packt Publishing in September 2010. If you're worried about two years being an eternity on the internet, don't: There hasn't been a new release of MySQLdb since the book was published.

Speaking of new releases, I built a Windows installer of MySQLdb-1.2.3 for Python-2.7 and using the MySQL Connector/C 6.0. This should be able to connect to any modern version of MySQL (4.0 through 5.5 and newer), and as I understand it, it should also work with MariaDB, but this is not yet tested.

Additionally, there is a 1.2.4 release coming out in the near future which will be a bug-fix release only. It will support Python-2.4 through 2.7 (and should be compatible with Python-2.8 when it arrives). There is some work towards Python-3 compatibility (specifically, 3.2.3), but unfortunately, I can't easily support Python < 2.7 and Python >= 3 at the same time. So after 1.2.4 is out, there will be a 1.3.0 release shortly thereafter which will be for Python-2.7 and 3.2 or newer (and probably earlier).

Longer term: I've also been working on a MySQLdb-2.0 version which is almost completely rewritten from scratch on the Python side, and modularized (and some code removed) on the C side. It's going to have pluggable drivers, with the intention of having the option of using libmysqlclient (the standard C library), libmysqld (the embedded server library), some kind of pure Python driver, and eventually a driver for Drizzle. MySQLdb-2.0 is actually going to be renamed Moist, and no, I don't yet have the code in github yet, but it will be what is the MySQLdb2 repository on SourceForge.

Is the project leaving SourceForge? It remains to be seen. Every time I get fed up and I'm sure I'm about to move, they have some big update which makes things better. The current location is pretty well-known, and the project has been there since 2001. I do think I will be mirroring a git repository between SF and github at the very least; all the cool kids are on github these days.

4 comments:

mike bayer said...

hi Andy -

can you please update the sourceforge site to make it clear where the current source of MySQLdb is? There are many links which all seem to be wrong or ambiguous.

There is the git repo: http://sourceforge.net/p/mysql-python/code/ci/de972addacedc7bf50b3d7941a31e8d69741d16f/tree/

There is the SVN repo: http://sourceforge.net/p/mysql-python/svn/

Both contain a file SVN-MOVED-TO-HG which points to an empty HG repository: http://mysql-python.hg.sourceforge.net/hgweb/mysql-python/mysql-python

I think I saw some evidence of commits to *both* the hg and SVN repos at the same time in recent weeks, but I don't have a link for that.

Let's pick just *one* repository, use it consistently, ensure the other ones have correct "moved" info, and remove all links to the other ones, OK !

Andy Dustman said...

The SVN repository is still the best one, at the moment, for MySQLdb-1.x and ZMySQLDA. The trunk of this repository does say it's moved to HG, which is true: That's the MySQLdb2 hg repository. It may look empty, but only the default branch is empty, due to the way the export worked. MySQLdb2 is going to be exported over to github to be the moist repositor there. MySQLdb1 is a recent git clone of the SVN repository.

The long term plan is to stick with git, though the SVN repository may stay indefinitely has it has some historical data that I don't want to lose (it originally was imported from CVS).

mike bayer said...

definitely keep the SVN repo, I agree, but will MySQLdb1 also be moved to git for future development ?

Andy Dustman said...

MySQLdb1 is a git repository already. Or did you mean github? In which case, yes, it's there already.

https://github.com/farcepest

MySQL/Python Video

Loading...