Drop-in Qt-based replacement for the sqlite3 module
Project description
About SQLite3-Qt
A drop-in module for Python’s sqlite3 built-in module, providing basic functionality via Qt SQL module. The goal is to enable the creation of a SQL backend module which can support both script and UI frontends.
Installation
Install using pip:
pip install sqlite3-qt
Features
Supports the basic database operations including binding values. (See below for supported sqlite3 classes and functions.)
API to mimic built-in sqlite3 module to enable easy swapping:
# import sqlite3 # default import import sqlite3_qt as sqlite3 # drop-in replacement without any change in the code ...
Underlying Qt Database connection name is auto-generated and transparent
Access Qt’s QSqlDatabase name and QSqlQuery objects
sqlite3_qt.Connection.qt_name # to get the QSqlDatabase name sqlite3_qt.Cursor.qt_query # to access the underlying QSqlQuery object
Auto-detect PyQt6 / PySide6 / PyQt5 / PySide2 (PySide2 fails the Github CI test)
Compatibility Table
Unfortunately, not all features of Python’s sqlite3 built-in module can be supported by Qt SQL module. The table below summarizes which sqlite3 functions/classes are currently supported.
sqlite3 functions and classes |
Supported? |
---|---|
sqlite3.connect( |
Partially |
database, |
Yes |
timeout, |
Yes |
detect_types, |
No |
isolation_level, |
No |
check_same_thread, |
No |
factory, |
Yes |
cached_statements, |
No |
uri, |
Yes |
autocommit) |
No |
class sqlite3.Connection |
Yes |
cursor() |
Yes |
blobopen() |
No |
commit() |
Yes |
rollback() |
Yes |
close() |
Yes |
execute() |
Yes |
executemany() |
Yes |
executescript() |
Yes |
create_function() |
No |
create_aggregate() |
No |
create_window_function() |
No |
create_collation() |
No |
interrupt() |
No |
set_authorizer() |
No |
set_progress_handler() |
No |
set_trace_callback() |
No |
enable_load_extension() |
No |
load_extension() |
No |
iterdump() |
No |
backup() |
No |
getlimit() |
No |
setlimit() |
No |
getconfig() |
No |
setconfig() |
No |
serialize() |
No |
deserialize() |
No |
autocommit |
?? |
in_transaction |
No |
isolation_level |
No |
row_factory |
Yes |
text_factory |
Yes |
total_changes |
No |
class sqlite3.Cursor |
Yes |
execute() |
Yes |
executemany() |
Yes |
executescript() |
Yes |
fetchone() |
Yes |
fetchmany() |
Yes |
fetchall() |
Yes |
close() |
Yes |
setinputsizes() |
No |
setoutputsize() |
No |
arraysize |
Yes |
connection |
Yes |
description |
Yes |
lastrowid |
Yes |
rowcount |
Yes |
row_factory |
Yes |
class sqlite3.Row |
Yes |
keys() |
Yes |
class sqlite3.Blob |
No |
sqlite3.complete_statement() |
No |
sqlite3.enable_callback_tracebacks() |
No |
sqlite3.register_adapter() |
No (TODO) |
sqlite3.register_converter() |
No (TODO) |
sqlite3.apilevel |
No |
sqlite3.paramstyle |
No |
sqlite3.sqlite_version |
Yes |
sqlite3.sqlite_version_info |
Yes |
sqlite3.threadsafety |
No |
sqlite3.version |
Yes |
sqlite3.version_info |
Yes |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for sqlite3_qt-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3138caadb93058fa38e9e905f416f90275f3c5430f8eaaa4f00c0b819b965234 |
|
MD5 | 05bd4c8e107cfe9bfec0acfd3520cca2 |
|
BLAKE2b-256 | 443e5e63e1b342a619d13d4b376d20c89b2c4440462759e29fce3e790d3b9af3 |