Karellen Sqlite Extensions
Project description
About
This project contains Karellen Sqlite extensions to the standard Python SQLite3 module.
These extensions are verified to work with Python 3.x (x >= 3) on Linux x86_64 and have been verified to work with GA and Debug builds of CPython. Any CPython ABI-compliant Python should work as well (YMMV).
SQLite3 Update Hook
The SQLite3 update hook allows the hook to be notified if the database to which the connection is made was changed.
This a drop-in replacement that can be used as demonstrated in the example below. The name pysqlite2 was chosen to the driver to be discovered automatically by Django SQLite backend.
from pysqlite2 import connect
def hook(conn, op, db_name, table_name, rowid):
"""Handle notification here. Do not modify the connection!"""
with connect(":memory:") as conn:
conn.set_update_hook(hook)
conn.execute("CREATE TABLE a (int id);")
conn.execute("INSERT INTO a VALUES (1);")
You can also use this library directly with your Python 3 without renaming:
from sqlite3 import connect
from karellen.sqlite3 import Connection
with connect(":memory:", factory=Connection):
# Do something useful here
pass
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 karellen_sqlite-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f329a44efac70281c8e905c1ad1512a5fda942c4680c1fe7bc63b060e29c9913 |
|
MD5 | 003ee0113793ed3cd6afb40088461fa7 |
|
BLAKE2b-256 | d9e011668db6cba07b53d275218ec292d367f155eacb90192cf6cca992c03d2c |