Source code for relstorage.adapters.oracle.drivers
# -*- coding: utf-8 -*-################################################################################ Copyright (c) 2016 Zope Foundation and Contributors.# All Rights Reserved.## This software is subject to the provisions of the Zope Public License,# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS# FOR A PARTICULAR PURPOSE.###############################################################################"""Oracle IDBDriver implementations."""from__future__importabsolute_importfrom__future__importprint_functionimportwarningsfromzope.interfaceimportimplementerfrom..driversimportAbstractModuleDriverfrom..driversimportimplement_db_driver_optionsfrom..interfacesimportIDBDriverfrom.dialectimportOracleDialectdatabase_type='oracle'__all__=['cx_OracleDriver',]
[docs]@implementer(IDBDriver)classcx_OracleDriver(AbstractModuleDriver):__name__='cx_Oracle'MODULE_NAME=__name__dialect=OracleDialect()def__init__(self):super().__init__()cx_Oracle=self.driver_moduleself.disconnected_exceptions+=(cx_Oracle.DatabaseError,)self.close_exceptions+=(cx_Oracle.DatabaseError,)# Extensionsself.DatabaseError=cx_Oracle.DatabaseErrorself.NUMBER=cx_Oracle.NUMBERself.BLOB=cx_Oracle.BLOBself.CLOB=cx_Oracle.CLOBself.LOB=cx_Oracle.LOBself.LONG_BINARY=cx_Oracle.LONG_BINARYself.LONG_STRING=cx_Oracle.LONG_STRINGself.BINARY=cx_Oracle.BINARYself.STRING=cx_Oracle.STRINGself.version=cx_Oracle.versiondefexception_is_deadlock(self,exc):warnings.warn("exception_is_deadlock() unimplemented for cx_Oracle")