<div dir="ltr">Hello everyone, it's my first post here, I'll get straight to the point.<br><br>I'm trying to register some functions in sqlite within my PyQt5 app. To do so<br>within Python, I'm trying to obtain the pointer (actually, `sqlite3 **`) to the<br>sqlite instance, so I could use sqlite3_create_function<br>(<a href="https://sqlite.org/c3ref/create_function.html">https://sqlite.org/c3ref/create_function.html</a>) through Python's<br>`ctypes` (<a href="https://docs.python.org/3/library/ctypes.html">https://docs.python.org/3/library/ctypes.html</a>) and register my<br>function.<br><br>When doing this in Qt5 instead of Python, you just use `QSqlDriver::handle()`<br>(<a href="https://doc.qt.io/qt-5/qsqldriver.html#handle">https://doc.qt.io/qt-5/qsqldriver.html#handle</a>), which returns a QVariant<br>containing the address. You cast the `QVariant.data()` appropriately and off<br>you go. When I try to obtain the handle in Python , I get:<br><br>    db.driver().handle()<br>    TypeError: unable to convert a C++ 'sqlite3*' instance to a Python object<br><br>I found that this error is generated within the C++ part of qpycore<br>(qpy/QtCore/qpycore_chimera.cpp:1539).<br>The code shows that a QVariant containing a pointer to an unknown type cannot<br>be translated to a Python object. However, I don't need a Python object, just a<br>pointer I can use with ctypes.<br><br>Does anyone know of a way to do this? Thanks!<br><br></div>