diff options
author | Shaun Stanworth <shaun.stanworth@onefinestay.com> | 2014-11-09 14:52:31 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-01-26 18:43:19 -0500 |
commit | f94d75ede5f5d2ed28d72ff98ca7caca016e5506 (patch) | |
tree | cb10a74016216a849423d0878219d15e5bc3b371 /lib/sqlalchemy/dialects/postgresql/psycopg2cffi.py | |
parent | 987f40b5aa325fe8a6655bcb0be2329c0a24025d (diff) | |
download | sqlalchemy-f94d75ede5f5d2ed28d72ff98ca7caca016e5506.tar.gz |
Added psycopg2cffi dialect
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/psycopg2cffi.py')
-rw-r--r-- | lib/sqlalchemy/dialects/postgresql/psycopg2cffi.py | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/psycopg2cffi.py b/lib/sqlalchemy/dialects/postgresql/psycopg2cffi.py new file mode 100644 index 000000000..5217c5561 --- /dev/null +++ b/lib/sqlalchemy/dialects/postgresql/psycopg2cffi.py @@ -0,0 +1,46 @@ +# testing/engines.py +# Copyright (C) 2005-2014 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 +""" +.. dialect:: postgresql+psycopg2cffi + :name: psycopg2cffi + :dbapi: psycopg2cffi + :connectstring: \ +postgresql+psycopg2cffi://user:password@host:port/dbname\ +[?key=value&key=value...] + :url: http://pypi.python.org/pypi/psycopg2cffi/ + +`psycopg2cffi` is an adaptation of `psycopg2`, using CFFI for the C +layer. This makes it suitable for use in e.g. PyPy. Documentation +is as per `psycopg2`. + +.. seealso:: + + :mod:`sqlalchemy.dialects.postgresql.psycopg2` + +""" +from .psycopg2 import PGDialect_psycopg2 + + +class PGDialect_psycopg2cffi(PGDialect_psycopg2): + driver = 'psycopg2cffi' + + @classmethod + def dbapi(cls): + return __import__('psycopg2cffi') + + @classmethod + def _psycopg2_extensions(cls): + root = __import__('psycopg2cffi', fromlist=['extensions']) + return root.extensions + + @classmethod + def _psycopg2_extras(cls): + root = __import__('psycopg2cffi', fromlist=['extras']) + return root.extras + + +dialect = PGDialect_psycopg2cffi |