Registry / database / sqlite3-api

sqlite3-api

JSON →
library2.0.4pypiunverified

The `sqlite3-api` library (PyPI package version 2.0.4) provides a thin Pythonic wrapper for interacting with SQLite databases. It simplifies some interactions but appears to be minimally maintained, with its last release in November 2021. Most Python users typically interact with SQLite using the `sqlite3` module from Python's standard library, which offers a comprehensive DB-API 2.0 compliant interface.

database
Install & Compatibility
Where this runs
tested against v2.0.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19.2MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 2.4s · import 0.000s · 20MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

The primary class for database interaction in this wrapper library.

from sqlite3_api import SQL

This quickstart demonstrates how to establish a connection, create a table, insert, query, and update data using the `sqlite3-api` wrapper. It emphasizes explicit commit/rollback for transaction management and closing the connection.

import os from sqlite3_api import SQL # Create an in-memory database (for a file-based DB, use 'my_database.db') db_path = ':memory:' conn = SQL(db_path) try: # Create a table conn.execute("CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY, name TEXT)") # Insert data conn.execute("INSERT INTO users (name) VALUES (?)", ("Alice",)) conn.execute("INSERT INTO users (name) VALUES (?)", ("Bob",)) conn.commit() # Explicitly commit changes # Query data print("--- All Users ---") results = conn.query("SELECT * FROM users") for row in results: print(row) # Update data conn.execute("UPDATE users SET name = ? WHERE id = ?", ("Charlie", 1)) conn.commit() # Explicitly commit changes # Verify update print("\n--- Updated User 1 ---") updated_user = conn.query("SELECT name FROM users WHERE id = 1") for row in updated_user: print(row) except Exception as e: print(f"An error occurred: {e}") conn.rollback() # Rollback on error finally: conn.close() # Always close the connection
Debug
Known footguns
gotchaThe `sqlite3-api` PyPI package is a separate, third-party wrapper, not the built-in `sqlite3` module that ships with Python. Most Python users interacting with SQLite should use the standard library's `sqlite3` module, which is actively maintained and fully DB-API 2.0 compliant.
deprecatedThe `sqlite3-api` package appears to be minimally maintained, with its last release in November 2021. Users seeking active development, community support, or robust features should consider Python's built-in `sqlite3` module or other actively maintained database access layers.
gotchaWhile the `sqlite3-api` wrapper might abstract some cursor management, explicit transaction control (e.g., `conn.commit()` and `conn.rollback()`) is still crucial for ensuring data integrity, especially after write operations. Forgetting to commit will result in changes not being saved.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
10 hits · last 30 days
gptbot
4
ahrefsbot
4
script
1
bingbot
1
Resources

No resource links recorded.