summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/mysql/pymysql.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2011-01-26 11:18:03 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2011-01-26 11:18:03 -0500
commit1515073b960b2319bd77ed6e9f6e04e458636a1e (patch)
tree31d382c11cea9ecc7de88a3b9d06ad3a7167b9d9 /lib/sqlalchemy/dialects/mysql/pymysql.py
parent9122268ed03d9fb59fafb62ee5a435775f1020d5 (diff)
downloadsqlalchemy-1515073b960b2319bd77ed6e9f6e04e458636a1e.tar.gz
- New DBAPI support for pymysql, a pure Python port
of MySQL-python. [ticket:1991]
Diffstat (limited to 'lib/sqlalchemy/dialects/mysql/pymysql.py')
-rw-r--r--lib/sqlalchemy/dialects/mysql/pymysql.py38
1 files changed, 38 insertions, 0 deletions
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 <see AUTHORS file>
+#
+# 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://<username>:<password>@<host>/<dbname>[?<options>]
+
+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