PHP 8.2.30
Preview: psycopg2cffi.py Size: 1.62 KB
//opt/cloudlinux/venv/lib/python3.11/site-packages/sqlalchemy/dialects/postgresql/psycopg2cffi.py

# testing/engines.py
# Copyright (C) 2005-2021 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
r"""
.. 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``.

.. versionadded:: 1.0.0

.. seealso::

    :mod:`sqlalchemy.dialects.postgresql.psycopg2`

"""  # noqa
from .psycopg2 import PGDialect_psycopg2


class PGDialect_psycopg2cffi(PGDialect_psycopg2):
    driver = "psycopg2cffi"
    supports_unicode_statements = True

    # psycopg2cffi's first release is 2.5.0, but reports
    # __version__ as 2.4.4.  Subsequent releases seem to have
    # fixed this.

    FEATURE_VERSION_MAP = dict(
        native_json=(2, 4, 4),
        native_jsonb=(2, 7, 1),
        sane_multi_rowcount=(2, 4, 4),
        array_oid=(2, 4, 4),
        hstore_adapter=(2, 4, 4),
    )

    @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

Directory Contents

Dirs: 1 × Files: 15

Name Size Perms Modified Actions
- drwxr-xr-x 2026-02-06 08:01:46
Edit Download
11.50 KB lrw-r--r-- 2026-01-20 13:01:47
Edit Download
126.22 KB lrw-r--r-- 2026-01-20 13:01:47
Edit Download
7.61 KB lrw-r--r-- 2026-01-20 13:01:47
Edit Download
7.56 KB lrw-r--r-- 2026-01-20 13:01:47
Edit Download
12.13 KB lrw-r--r-- 2026-01-20 13:01:47
Edit Download
9.87 KB lrw-r--r-- 2026-01-20 13:01:47
Edit Download
9.49 KB lrw-r--r-- 2026-01-20 13:01:47
Edit Download
1.96 KB lrw-r--r-- 2026-01-20 13:01:47
Edit Download
36.88 KB lrw-r--r-- 2026-01-20 13:01:47
Edit Download
1.62 KB lrw-r--r-- 2026-01-20 13:01:47
Edit Download
7.94 KB lrw-r--r-- 2026-01-20 13:01:47
Edit Download
2.85 KB lrw-r--r-- 2026-01-20 13:01:47
Edit Download
4.51 KB lrw-r--r-- 2026-01-20 13:01:47
Edit Download
1.38 KB lrw-r--r-- 2026-01-20 13:01:47
Edit Download
2.40 KB lrw-r--r-- 2026-01-20 13:01:47
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).