From 1515073b960b2319bd77ed6e9f6e04e458636a1e Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 26 Jan 2011 11:18:03 -0500 Subject: - New DBAPI support for pymysql, a pure Python port of MySQL-python. [ticket:1991] --- lib/sqlalchemy/dialects/mysql/pymysql.py | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 lib/sqlalchemy/dialects/mysql/pymysql.py (limited to 'lib/sqlalchemy/dialects/mysql/pymysql.py') diff --git a/lib/sqlalchemy/dialects/mysql/pymysql.py b/lib/sqlalchemy/dialects/mysql/pymysql.py new file mode 100644 index 000000000..dee3dfeaa --- /dev/null +++ b/lib/sqlalchemy/dialects/mysql/pymysql.py @@ -0,0 +1,38 @@ +# mysql/pymysql.py +# Copyright (C) 2005-2011 the SQLAlchemy authors and contributors +# +# This module is part of SQLAlchemy and is released under +# the MIT License: http://www.opensource.org/licenses/mit-license.php + +"""Support for the MySQL database via the pymysql adapter. + +pymysql is available at: + + http://code.google.com/p/pymysql/ + +Connecting +---------- + +Connect string:: + + mysql+pymysql://:@/[?] + +MySQL-Python Compatibility +-------------------------- + +The pymysql DBAPI is a pure Python port of the MySQL-python (MySQLdb) driver, +and targets 100% compatibility. Most behavioral notes for MySQL-python apply to +the pymysql driver as well. + +""" + +from sqlalchemy.dialects.mysql.mysqldb import MySQLDialect_mysqldb + +class MySQLDialect_pymysql(MySQLDialect_mysqldb): + driver = 'pymysql' + + @classmethod + def dbapi(cls): + return __import__('pymysql') + +dialect = MySQLDialect_pymysql \ No newline at end of file -- cgit v1.2.1