{"id":14932,"library":"sqlite3-api","title":"sqlite3-api","description":"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.","status":"maintenance","version":"2.0.4","language":"en","source_language":"en","source_url":"https://github.com/AlexDev-py/sqlite3-api.git","tags":["sqlite","database","wrapper","db-api"],"install":[{"cmd":"pip install sqlite3-api","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"The primary class for database interaction in this wrapper library.","symbol":"SQL","correct":"from sqlite3_api import SQL"}],"quickstart":{"code":"import os\nfrom sqlite3_api import SQL\n\n# Create an in-memory database (for a file-based DB, use 'my_database.db')\ndb_path = ':memory:' \nconn = SQL(db_path)\n\ntry:\n    # Create a table\n    conn.execute(\"CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY, name TEXT)\")\n\n    # Insert data\n    conn.execute(\"INSERT INTO users (name) VALUES (?)\", (\"Alice\",))\n    conn.execute(\"INSERT INTO users (name) VALUES (?)\", (\"Bob\",))\n    conn.commit() # Explicitly commit changes\n\n    # Query data\n    print(\"--- All Users ---\")\n    results = conn.query(\"SELECT * FROM users\")\n    for row in results:\n        print(row)\n\n    # Update data\n    conn.execute(\"UPDATE users SET name = ? WHERE id = ?\", (\"Charlie\", 1))\n    conn.commit() # Explicitly commit changes\n\n    # Verify update\n    print(\"\\n--- Updated User 1 ---\")\n    updated_user = conn.query(\"SELECT name FROM users WHERE id = 1\")\n    for row in updated_user:\n        print(row)\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n    conn.rollback() # Rollback on error\nfinally:\n    conn.close() # Always close the connection","lang":"python","description":"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."},"warnings":[{"fix":"For direct SQLite access without external dependencies, use `import sqlite3`. If a higher-level ORM or wrapper is desired, consider more widely adopted and actively maintained alternatives.","message":"The `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.","severity":"gotcha","affected_versions":"All"},{"fix":"Evaluate whether the built-in `sqlite3` module or another maintained library (e.g., SQLAlchemy for ORM, or a more recent, community-supported wrapper) better suits your project's needs.","message":"The `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.","severity":"deprecated","affected_versions":"2.0.4 and potentially earlier"},{"fix":"Always call `conn.commit()` after any operations that modify the database (INSERT, UPDATE, DELETE). Use `conn.rollback()` if an error occurs and changes should not be persisted. Consider using a `try...except...finally` block for robust error handling and resource management.","message":"While 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.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z","problems":[],"ecosystem":"pypi"}