Python psycopg2 模块,__version__() 实例源码
我们从Python开源项目中,提取了以下21个代码示例,用于说明如何使用psycopg2.__version__()。
def _has_lo64(conn):
"""Return (bool,msg) about the lo64 support"""
if conn.server_version < 90300:
return (False, "server version %s doesn't support the lo64 API"
% conn.server_version)
if 'lo64' not in psycopg2.__version__:
return (False, "this psycopg build doesn't support the lo64 API")
return (True, "this server and build support the lo64 API")
def _has_lo64(conn):
"""Return (bool, "this server and build support the lo64 API")
def get_summary(cls):
"""
Return a diction of information about this database
backend.
"""
summary = {
"DB-API version": "2.0",
"Database sql type": cls.__name__,
"Database sql module": "psycopg2",
"Database sql module version": psycopg2.__version__,
"Database sql module location": psycopg2.__file__,
}
return summary
def _has_lo64(conn):
"""Return (bool, "this server and build support the lo64 API")
def _has_lo64(conn):
"""Return (bool, "this server and build support the lo64 API")
def _has_lo64(conn):
"""Return (bool, "this server and build support the lo64 API")
def _has_lo64(conn):
"""Return (bool, "this server and build support the lo64 API")
def _has_lo64(conn):
"""Return (bool, "this server and build support the lo64 API")
def _has_lo64(conn):
"""Return (bool, "this server and build support the lo64 API")
def _has_lo64(conn):
"""Return (bool, "this server and build support the lo64 API")
def _has_lo64(conn):
"""Return (bool, "this server and build support the lo64 API")
def _has_lo64(conn):
"""Return (bool, "this server and build support the lo64 API")
def _has_lo64(conn):
"""Return (bool, "this server and build support the lo64 API")
def _has_lo64(conn):
"""Return (bool, "this server and build support the lo64 API")
def _has_lo64(conn):
"""Return (bool, "this server and build support the lo64 API")
def make_psycopg_green():
"""Configure Psycopg to be used with eventlet in non-blocking way."""
if not hasattr(extensions, 'set_wait_callback'):
raise ImportError(
"support for coroutines not available in this Psycopg version (%s)"
% psycopg2.__version__)
extensions.set_wait_callback(eventlet_wait_callback)
def _has_lo64(conn):
"""Return (bool, "this server and build support the lo64 API")
def make_psycopg_green():
"""Configure Psycopg to be used with eventlet in non-blocking way."""
if not hasattr(extensions, 'set_wait_callback'):
raise ImportError(
"support for coroutines not available in this Psycopg version (%s)"
% psycopg2.__version__)
extensions.set_wait_callback(eventlet_wait_callback)
def make_psycopg_green():
"""Configure Psycopg to be used with gevent in non-blocking way."""
if not hasattr(extensions, 'set_wait_callback'):
raise ImportError(
"support for coroutines not available in this Psycopg version (%s)"
% psycopg2.__version__)
extensions.set_wait_callback(gevent_wait_callback)
def _has_lo64(conn):
"""Return (bool, "this server and build support the lo64 API")
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。