[Chicago] Chicago Digest, Vol 58, Issue 1

Tal Liron tal.liron at threecrickets.com
Wed Jun 2 03:43:15 CEST 2010


  My experience with MySQLdb is less happy: it has severe memory leaks 
in Unicode mode (documented! not fixed for years!), and unclear 
(=undocumented!) thread safety.

As a latecomer to Python, I took the sad state of MySQL support in 
Python to be a very clear endorsement of Postgres. OK, I get it: 
Postgres is better.

-Tal

On 06/01/2010 01:59 PM, Garrett Smith wrote:
> I use MySQLdb quite a bit and have no complaints. Personally, I'd
> start there unless I had requirements it obviously can't meet.
>
> On Tue, Jun 1, 2010 at 1:53 PM, Walter Askew<waltaskew at gmail.com>  wrote:
>> MySQLdb is a very no-frills package.  No-frills as in it doesn't support
>> anything fancy like 'laziness' or 'real prepared statements'.
>> I'm not joking about the no prepared statements thing.  You can write stuff
>> like this:
>>
>> c=db.cursor()
>> max_price=5
>> c.execute("""SELECT spam, eggs, sausage FROM breakfast
>>            WHERE price<  %s""", (max_price,))
>>
>> And it's pretty much what it looks like -- string interpolation.
>> For more featureful libraries, there's oursql (I've never used it myself)
>> and the ever popular SQLAlchemy
>> I'm not sure how big of a project this is, but I've only used MySQLdb for
>> writing one-off scripts (for which it's great.)  Especially for a larger
>> project, using an ORM like SQLAlchemy can definitely be more pleasant than
>> writing SQL by hand.  Plus, seriously, real prepared statements and
>> laziness.
>> On Jun 1, 2010, at 5:00 AM, chicago-request at python.org wrote:
>>
>> Send Chicago mailing list submissions to
>> chicago at python.org
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>> http://mail.python.org/mailman/listinfo/chicago
>> or, via email, send a message with subject or body 'help' to
>> chicago-request at python.org
>>
>> You can reach the person managing the list at
>> chicago-owner at python.org
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of Chicago digest..."
>> Today's Topics:
>>
>>    1. MySQL from unprivileged account (Jonathan Hayward)
>>
>> From: Jonathan Hayward<christos.jonathan.hayward at gmail.com>
>> Date: May 31, 2010 10:55:48 AM CDT
>> To: The Chicago Python Users Group<chicago at python.org>
>> Subject: [Chicago] MySQL from unprivileged account
>> Reply-To: The Chicago Python Users Group<chicago at python.org>
>>
>>
>> I would like to migrate a project from a custom database to using MySQL. The
>> target system is a Linux system where I have unprivileged shell access and
>> setuptools is installed. After playing around with easy_install and setting
>> my PYTHONPATH, I have MySQLdb working, or at least importing.
>> Before I go further, I wanted to ask opinions on preferred ways of dealing
>> with MySQL from Python. Is there any one package which is strongly
>> preferred, and in particular is MySQLdb a choice to warn about, or a sane
>> choice with sensible adherents?
>> --
>> → Jonathan Hayward, christos.jonathan.hayward at gmail.com
>> → An Orthodox Christian author: theology, literature, et cetera.
>> → My award-winning collection is available for free reading online:
>> ☩ I invite you to visit my main site at http://JonathansCorner.com/
>>
>>
>> _______________________________________________
>> Chicago mailing list
>> Chicago at python.org
>> http://mail.python.org/mailman/listinfo/chicago
>>
>>
>> _______________________________________________
>> Chicago mailing list
>> Chicago at python.org
>> http://mail.python.org/mailman/listinfo/chicago
>>
>>
> _______________________________________________
> Chicago mailing list
> Chicago at python.org
> http://mail.python.org/mailman/listinfo/chicago


More information about the Chicago mailing list