aboutsummaryrefslogtreecommitdiffstats
path: root/lib/python2.7/site-packages/SQLAlchemy-0.7.0-py2.7-linux-x86_64.egg/sqlalchemy/dialects/mysql/pymysql.py
blob: dee3dfeaa1380fc0bef6036f8b23918665df094b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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