Re: [SQLObject] mysql connector has no way to specify alternate socket path
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: John R. <joh...@gm...> - 2005-03-25 17:36:28
|
On Fri, 25 Mar 2005 20:19:11 +0300, Oleg Broytmann <ph...@ph...> wrote: > On Fri, Mar 25, 2005 at 06:06:23PM +0100, andrea wrote: > > what about to use that **kw on sqlobject's MySQLConnection.__init__, to > > collect extra parameters and then feed those to mysqldb's connect? then > > it would be care of the caller to manage and use the correct parameters. > > This **kw is already passed to DBAPI.__init__() from > MySQLConnection.__init__(). To collect neccessary names from that kw I > need to know the names of all MySQLdb parameters. > > Oleg. > -- > Oleg Broytmann http://phd.pp.ru/ ph...@ph... > Programmers don't die, they just GOSUB without RETURN. > Well, yes, it would be bad to add arbitrary parameters one by one. That's why I didn't just pass through the unix_socket parameter, which does the one specific thing I needed in this case. This particular parameter (read_default_group) is special because it allows the use of an external conf file; after the patch, you can specify the equivalent of about a dozen different _mysql initialization parameters without any code changes just by changing my.cnf. This is the same mechanism mysql clients generally use, including the built-in ones like mysqladmin. A subset of the MySQL connect parameters are listed here: http://sourceforge.net/docman/display_doc.php?docid=26238&group_id=22307 and the full list is here: http://dev.mysql.com/doc/mysql/en/mysql-options.html Also see here: http://cvs.sourceforge.net/viewcvs.py/mysql-python/MySQLdb/_mysql.c?view=markup static char *kwlist[] = { "host", "user", "passwd", "db", "port", "unix_socket", "conv", "connect_timeout", "compress", "named_pipe", "init_command", "read_default_file", "read_default_group", "client_flag", "ssl", "local_infile", NULL } ; But all this is beside the point. You can make a patch to pass everything through if you want, but just passing read_default_group through gives you most of the benefit. |