NCBI C++ ToolKit
Classes | Namespaces | Macros | Typedefs | Functions | Variables
python_ncbi_dbapi.cpp File Reference
#include <ncbi_pch.hpp>
#include <common/ncbi_package_ver.h>
#include <corelib/ncbiapp.hpp>
#include <corelib/ncbi_safe_static.hpp>
#include <corelib/plugin_manager_store.hpp>
#include <util/static_map.hpp>
#include <util/value_convert_policy.hpp>
#include <dbapi/error_codes.hpp>
#include <dbapi/driver/dbapi_svc_mapper.hpp>
#include "../../ds_impl.hpp"
#include <connect/ext/ncbi_dblb_svcmapper.hpp>
#include <cstdlib>
#include "python_ncbi_dbapi.hpp"
#include "pythonpp/pythonpp_pdt.hpp"
#include "pythonpp/pythonpp_extdt.hpp"
#include <structmember.h>
+ Include dependency graph for python_ncbi_dbapi.cpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

class  python::CVariantSet
 
class  python::CCachedResultSet
 
class  python::CVariant_Callbacks
 
class  python::CRealResultSet
 
class  python::CRealSetProxy
 
class  python::CVariantSetProxy
 
class  python::CDBAPIModule
 
class  CPythonDiagHandler
 

Namespaces

 python
 

Macros

#define PYTHONPP_DEFINE_GLOBALS   1
 
#define PYDBAPI_MOD_RETURN
 
#define PYDBAPI_MODINIT_FUNC(name)   PyMODINIT_FUNC NCBI_NAME2(init,name)(void)
 
#define PYDBAPI_SUPPORT_DIR   "python_ncbi_dbapi/" NCBI_PACKAGE_VERSION
 
#define NCBI_USE_ERRCODE_X   Dbapi_Python
 
#define DB_ERR_CODE(value, type)   { value, &C##type##Error::Rethrow }
 

Typedefs

typedef void(* python::FRethrow) (const CDB_Exception &)
 
typedef CStaticArrayMap< int, FRethrow > python::TDBErrCodeMap
 
typedef SStaticPair< int, FRethrow > python::TDBErrCodePair
 

Functions

static PyObject * python::SetLogger (PyObject *self, PyObject *args)
 
static string python::RetrieveModuleFileName (void)
 
 python::DEFINE_STATIC_ARRAY_MAP (TDBErrCodeMap, sc_ClientErrCodes, kClientErrCodes)
 
 python::DEFINE_STATIC_ARRAY_MAP (TDBErrCodeMap, sc_SybaseErrCodes, kSybaseErrCodes)
 
static void python::s_ThrowDatabaseError (const CException &e)
 
EStatementType python::RetrieveStatementType (const string &stmt, EStatementType default_type, ETriState output_expected)
 
static void python::s_FillDescription (pythonpp::CList &descr, const IResultSetMetaData *data)
 
pythonpp::CObject python::ConvertCVariant2PCObject (const CVariant &value)
 
pythonpp::CTuple python::MakeTupleFromResult (IResultSet &rs)
 
pythonpp::CTuple python::MakeTupleFromResult (CVariantSet &rs)
 
static ETriState python::s_IsOutputExpected (const pythonpp::CDict &kwargs)
 
static CNullable< short > python::x_GetUTCOffset (const pythonpp::CDateTime &dt)
 
PyObject * python::s_GetCursorIter (PyObject *curs_obj)
 
PyObject * python::s_GetCursorIterFromIter (PyObject *iter_obj)
 
PyObject * python::s_CursorIterNext (PyObject *iter_obj)
 
static PyObject * python::ReturnStrsAsUnicode (PyObject *self, PyObject *args)
 
static PyObject * python::ReleaseGlobalLock (PyObject *self, PyObject *args)
 
static PyObject * python::Connect (PyObject *self, PyObject *args)
 
static PyObject * python::Date (PyObject *self, PyObject *args)
 
static PyObject * python::Time (PyObject *self, PyObject *args)
 
static PyObject * python::Timestamp (PyObject *self, PyObject *args)
 
static PyObject * python::DateFromTicks (PyObject *self, PyObject *args)
 
static PyObject * python::TimeFromTicks (PyObject *self, PyObject *args)
 
static PyObject * python::TimestampFromTicks (PyObject *self, PyObject *args)
 
static PyObject * python::Binary (PyObject *self, PyObject *args)
 
static void s_RestoreOrigDiagHandler (void)
 
static int s_OnClear (PyObject *)
 
static PyObject * init_common (const string &module_name)
 
PyMODINIT_FUNC NCBI_NAME2 (init, python_ncbi_dbapi)(void)
 
PyMODINIT_FUNC NCBI_NAME2 (init, ncbi_dbapi)(void)
 
PyMODINIT_FUNC NCBI_NAME2 (init, ncbi_dbapi_current)(void)
 
PyMODINIT_FUNC NCBI_NAME2 (init, ncbi_dbapi_frozen)(void)
 
PyMODINIT_FUNC NCBI_NAME2 (init, ncbi_dbapi_metastable)(void)
 
PyMODINIT_FUNC NCBI_NAME2 (init, ncbi_dbapi_potluck)(void)
 
PyMODINIT_FUNC NCBI_NAME2 (init, ncbi_dbapi_production)(void)
 
PyMODINIT_FUNC NCBI_NAME2 (init, ncbi_dbapi_stable)(void)
 

Variables

bool g_PythonStrDefToUnicode = false
 Flag showing whether all pythonpp::CString objects should be created as Python unicode strings (TRUE value) or regular strings (FALSE value) More...
 
static const TDBErrCodePair python::kClientErrCodes []
 
static const TDBErrCodePair python::kSybaseErrCodes []
 
static struct PyMethodDef python_ncbi_dbapi_methods []
 
static CDiagHandlers_OrigDiagHandler
 
static bool s_WasUsingOldPostFormat
 

Macro Definition Documentation

◆ DB_ERR_CODE

#define DB_ERR_CODE (   value,
  type 
)    { value, &C##type##Error::Rethrow }

Definition at line 1096 of file python_ncbi_dbapi.cpp.

◆ NCBI_USE_ERRCODE_X

#define NCBI_USE_ERRCODE_X   Dbapi_Python

Definition at line 84 of file python_ncbi_dbapi.cpp.

◆ PYDBAPI_MOD_RETURN

#define PYDBAPI_MOD_RETURN

Definition at line 76 of file python_ncbi_dbapi.cpp.

◆ PYDBAPI_MODINIT_FUNC

#define PYDBAPI_MODINIT_FUNC (   name)    PyMODINIT_FUNC NCBI_NAME2(init,name)(void)

Definition at line 77 of file python_ncbi_dbapi.cpp.

◆ PYDBAPI_SUPPORT_DIR

#define PYDBAPI_SUPPORT_DIR   "python_ncbi_dbapi/" NCBI_PACKAGE_VERSION

Definition at line 81 of file python_ncbi_dbapi.cpp.

◆ PYTHONPP_DEFINE_GLOBALS

#define PYTHONPP_DEFINE_GLOBALS   1

Definition at line 55 of file python_ncbi_dbapi.cpp.

Function Documentation

◆ init_common()

static PyObject* init_common ( const string module_name)
static

Definition at line 4664 of file python_ncbi_dbapi.cpp.

References python::CCursor::__enter__(), python::CTransaction::__enter__(), python::CConnection::__enter__(), pythonpp::CModuleExt::AddConst(), C_DriverMgr::AddDllSearchPath(), python::CCursor::callproc(), python::CCursor::close(), python::CTransaction::close(), python::CConnection::close(), python::CTransaction::commit(), python::CConnection::commit(), python::CTransaction::cursor(), python::CConnection::cursor(), DBLB_INSTALL_DEFAULT, pythonpp::CExtObject< CNumber >::Declare(), pythonpp::CExtObject< CCursorIter >::Declare(), pythonpp::CExtObject< CRowID >::Declare(), pythonpp::CExtObject< CTransaction >::Declare(), pythonpp::CExtObject< CConnection >::Declare(), pythonpp::CExtObject< CStringType >::Declare(), pythonpp::CExtObject< CCursor >::Declare(), pythonpp::CExtObject< CBinaryType >::Declare(), pythonpp::CExtObject< CDateTimeType >::Declare(), pythonpp::CUserError< CIntegrityError, CDatabaseError >::Declare(), pythonpp::CUserError< CWarning >::Declare(), pythonpp::CUserError< CDatabaseError, CError >::Declare(), pythonpp::CUserError< COperationalError, CDatabaseError >::Declare(), pythonpp::CUserError< CError >::Declare(), pythonpp::CUserError< CInternalError, CDatabaseError >::Declare(), pythonpp::CUserError< CNotSupportedError, CDatabaseError >::Declare(), pythonpp::CUserError< CProgrammingError, CDatabaseError >::Declare(), pythonpp::CUserError< CDataError, CDatabaseError >::Declare(), pythonpp::CUserError< CInterfaceError, CError >::Declare(), pythonpp::CModuleExt::Declare(), pythonpp::CExtObject< CConnection >::Def(), pythonpp::CExtObject< CCursor >::Def(), pythonpp::CExtObject< CTransaction >::Def(), python::CCursor::execute(), python::CCursor::executemany(), python::CCursor::fetchall(), python::CCursor::fetchmany(), python::CCursor::fetchone(), file, python::CCursor::get_proc_return_status(), GetDiagHandler(), CDriverManager::GetInstance(), pythonpp::CModuleExt::GetPyModule(), CDBLB_ServiceMapper::GetServer(), pythonpp::CExtObject< CConnection >::GetType(), pythonpp::CExtObject< CRowID >::GetType(), pythonpp::CExtObject< CCursor >::GetType(), pythonpp::CExtObject< CBinaryType >::GetType(), pythonpp::CExtObject< CTransaction >::GetType(), pythonpp::CExtObject< CCursorIter >::GetType(), pythonpp::CExtObject< CDateTimeType >::GetType(), pythonpp::CExtObject< CStringType >::GetType(), pythonpp::CExtObject< CNumber >::GetType(), CNcbiApplication::Instance(), CDiagContext::IsSetOldPostFormat(), NCBI_PACKAGE_VERSION, python::CCursor::nextset(), NULL, PYDBAPI_SUPPORT_DIR, python_ncbi_dbapi_methods, python::RetrieveModuleFileName(), python::CTransaction::rollback(), python::CConnection::rollback(), python::s_CursorIterNext(), python::s_GetCursorIter(), python::s_GetCursorIterFromIter(), s_OnClear(), s_OrigDiagHandler, s_RestoreOrigDiagHandler(), s_WasUsingOldPostFormat, SetDiagHandler(), python::CCursor::setinputsizes(), pythonpp::CExtType::SetName(), CDiagContext::SetOldPostFormat(), python::CCursor::setoutputsize(), and python::CConnection::transaction().

Referenced by NCBI_NAME2().

◆ NCBI_NAME2() [1/8]

PyMODINIT_FUNC NCBI_NAME2 ( init  ,
ncbi_dbapi   
)

Definition at line 4933 of file python_ncbi_dbapi.cpp.

References init_common(), and PYDBAPI_MOD_RETURN.

◆ NCBI_NAME2() [2/8]

PyMODINIT_FUNC NCBI_NAME2 ( init  ,
ncbi_dbapi_current   
)

Definition at line 4938 of file python_ncbi_dbapi.cpp.

References init_common(), and PYDBAPI_MOD_RETURN.

◆ NCBI_NAME2() [3/8]

PyMODINIT_FUNC NCBI_NAME2 ( init  ,
ncbi_dbapi_frozen   
)

Definition at line 4943 of file python_ncbi_dbapi.cpp.

References init_common(), and PYDBAPI_MOD_RETURN.

◆ NCBI_NAME2() [4/8]

PyMODINIT_FUNC NCBI_NAME2 ( init  ,
ncbi_dbapi_metastable   
)

Definition at line 4948 of file python_ncbi_dbapi.cpp.

References init_common(), and PYDBAPI_MOD_RETURN.

◆ NCBI_NAME2() [5/8]

PyMODINIT_FUNC NCBI_NAME2 ( init  ,
ncbi_dbapi_potluck   
)

Definition at line 4953 of file python_ncbi_dbapi.cpp.

References init_common(), and PYDBAPI_MOD_RETURN.

◆ NCBI_NAME2() [6/8]

PyMODINIT_FUNC NCBI_NAME2 ( init  ,
ncbi_dbapi_production   
)

Definition at line 4958 of file python_ncbi_dbapi.cpp.

References init_common(), and PYDBAPI_MOD_RETURN.

◆ NCBI_NAME2() [7/8]

PyMODINIT_FUNC NCBI_NAME2 ( init  ,
ncbi_dbapi_stable   
)

Definition at line 4963 of file python_ncbi_dbapi.cpp.

References init_common(), and PYDBAPI_MOD_RETURN.

◆ NCBI_NAME2() [8/8]

PyMODINIT_FUNC NCBI_NAME2 ( init  ,
python_ncbi_dbapi   
)

Definition at line 4928 of file python_ncbi_dbapi.cpp.

References init_common(), and PYDBAPI_MOD_RETURN.

◆ s_OnClear()

static int s_OnClear ( PyObject *  )
static

Definition at line 4657 of file python_ncbi_dbapi.cpp.

References s_RestoreOrigDiagHandler().

Referenced by init_common().

◆ s_RestoreOrigDiagHandler()

static void s_RestoreOrigDiagHandler ( void  )
static

Variable Documentation

◆ g_PythonStrDefToUnicode

bool g_PythonStrDefToUnicode = false

Flag showing whether all pythonpp::CString objects should be created as Python unicode strings (TRUE value) or regular strings (FALSE value)

Definition at line 91 of file python_ncbi_dbapi.cpp.

Referenced by pythonpp::CString::operator=(), and python::ReturnStrsAsUnicode().

◆ python_ncbi_dbapi_methods

struct PyMethodDef python_ncbi_dbapi_methods[]
static

Definition at line 91 of file python_ncbi_dbapi.cpp.

Referenced by init_common().

◆ s_OrigDiagHandler

CDiagHandler* s_OrigDiagHandler
static

Definition at line 4639 of file python_ncbi_dbapi.cpp.

Referenced by init_common(), and s_RestoreOrigDiagHandler().

◆ s_WasUsingOldPostFormat

bool s_WasUsingOldPostFormat
static

Definition at line 4640 of file python_ncbi_dbapi.cpp.

Referenced by init_common(), and s_RestoreOrigDiagHandler().

Modified on Sun Apr 21 03:42:46 2024 by modify_doxy.py rev. 669887