[sqlalchemy] how to call group_concat function in MySQL?
Hi Guys, How can I call group_concat() function in MySQL using the function gateway ? something like select([child, func.group_concat(Child.c.xxx).label(count)], group_by=[]).. any clue ? Thx - A --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] [PATCH]: SSL support for MySQL
A simple (too simple?) patch to support SSL connections with MySQL. Use the following syntax to use it: mysql://user:[EMAIL PROTECTED]/db?ssl_ca=path-to-ca-file Tested with SA from svn, mysql-5.0.27, python-2.4.4 and MySQL- python-1.2.1. - Terje Index: lib/sqlalchemy/databases/mysql.py === --- lib/sqlalchemy/databases/mysql.py (revisjon 2530) +++ lib/sqlalchemy/databases/mysql.py (arbeidskopi) @@ -293,8 +293,21 @@ # note: these two could break SA Unicode type util.coerce_kw_type(opts, 'use_unicode', bool) util.coerce_kw_type(opts, 'charset', str) -# TODO: what about options like ssl, cursorclass and conv ? +# ssl +ssl_opts = ['key', 'cert', 'ca', 'capath', 'cipher'] +for opt in ssl_opts: +util.coerce_kw_type(opts, 'ssl_' + opt, str) +# ssl_ca option is required to use ssl +if 'ssl_ca' in opts.keys(): +# ssl arg must be a dict +ssl = {} +for opt in ssl_opts: +if 'ssl_' + opt in opts.keys(): +ssl[opt] = opts['ssl_' + opt] +del opts['ssl_' + opt] +opts['ssl'] = ssl +# TODO: what about options like cursorclass and conv ? client_flag = opts.get('client_flag', 0) if self.dbapi is not None: try: --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: [PATCH]: SSL support for MySQL
thanks, r2532. note that you can also the connect_args dictionary to create_engine, although i know this is not as easy with property-file based configuration frameworks... On Apr 22, 2007, at 10:28 AM, [EMAIL PROTECTED] wrote: Index: lib/sqlalchemy/databases/mysql.py === --- lib/sqlalchemy/databases/mysql.py (revisjon 2530) +++ lib/sqlalchemy/databases/mysql.py (arbeidskopi) @@ -293,8 +293,21 @@ # note: these two could break SA Unicode type util.coerce_kw_type(opts, 'use_unicode', bool) util.coerce_kw_type(opts, 'charset', str) -# TODO: what about options like ssl, cursorclass and conv ? +# ssl +ssl_opts = ['key', 'cert', 'ca', 'capath', 'cipher'] +for opt in ssl_opts: +util.coerce_kw_type(opts, 'ssl_' + opt, str) +# ssl_ca option is required to use ssl +if 'ssl_ca' in opts.keys(): +# ssl arg must be a dict +ssl = {} +for opt in ssl_opts: +if 'ssl_' + opt in opts.keys(): +ssl[opt] = opts['ssl_' + opt] +del opts['ssl_' + opt] +opts['ssl'] = ssl +# TODO: what about options like cursorclass and conv ? client_flag = opts.get('client_flag', 0) if self.dbapi is not None: try: --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---