Skip to main content

OverDrive-DB — High-performance embeddable hybrid SQL+NoSQL document database. ACID-compliant with 6 storage engines (Disk, RAM, Vector, Time-Series, Graph, Streaming). Features password-based encryption, auto-table creation, transaction callbacks, watchdog monitoring, and RAM engine caching.

Project description

OverDrive-DB — Python SDK v1.3.0

A high-performance, embeddable hybrid SQL+NoSQL document database. Like SQLite, but for JSON.

v1.3.0 — Security hardened: encrypted key from env, parameterized queries, auto chmod 600, encrypted backups, WAL cleanup, thread-safe wrapper.

Install

pip install overdrive-db==1.3.0

Place the native library for your platform in your project directory or on PATH:

Platform File
Windows x64 overdrive.dll
Linux x64 liboverdrive.so
macOS ARM64 liboverdrive.dylib

Download from GitHub Releases.

Quick Start

from overdrive import OverDrive

# Open — file permissions auto-hardened (chmod 600 / Windows ACL)
with OverDrive("myapp.odb") as db:
    db.create_table("users")
    user_id = db.insert("users", {"name": "Alice", "email": "alice@example.com", "age": 30})

    # ✅ Safe parameterized query — blocks SQL injection
    results = db.query_safe("SELECT * FROM users WHERE age > ?", [25])
    for row in results:
        print(f"  {row['name']}{row['email']}")

    # Backup + WAL cleanup
    db.backup("backups/app.odb")
    db.cleanup_wal()

Security APIs (v1.3.0)

import os
from overdrive import OverDrive, ThreadSafeOverDrive

# 🔐 Open with encryption key from env (never hardcode!)
# $env:ODB_KEY = "my-secret-32-char-key!!!!" (PowerShell)
# export ODB_KEY="my-secret-32-char-key!!!!"  (bash)
db = OverDrive.open_encrypted("app.odb", "ODB_KEY")

# 🛡️ SQL injection prevention — use query_safe() for user input
user_input = "Alice'; DROP TABLE users--"  # malicious
try:
    db.query_safe("SELECT * FROM users WHERE name = ?", [user_input])
except Exception as e:
    print(f"Blocked: {e}")  # ✅ injection blocked

# 💾 Encrypted backup (sync → copy .odb + .wal → harden perms)
db.backup("backups/app_2026-03-04.odb")

# 🗑️ WAL cleanup after commit
txn_id = db.begin_transaction(db.SERIALIZABLE)
db.insert("users", {"name": "Carol"})
db.commit_transaction(txn_id)
db.cleanup_wal()

# 🧵 Thread-safe access
with ThreadSafeOverDrive("app.odb") as safe_db:
    import threading
    threads = [threading.Thread(target=lambda: safe_db.query("SELECT * FROM users")) for _ in range(4)]
    for t in threads: t.start()
    for t in threads: t.join()

Full API

Method Description
OverDrive(path) Open database (auto-hardens permissions)
OverDrive.open_encrypted(path, key_env_var) 🔐 Open with key from env var
db.close() Close the database
db.sync() Force flush to disk
db.create_table(name) Create a table
db.drop_table(name) Drop a table
db.list_tables() List all tables
db.table_exists(name) Check if table exists
db.insert(table, doc) Insert document, returns _id
db.insert_many(table, docs) Batch insert
db.get(table, id) Get by _id
db.update(table, id, updates) Update fields
db.delete(table, id) Delete by _id
db.count(table) Count documents
db.scan(table) Get all documents
db.query(sql) Execute SQL query (trusted input only)
db.query_safe(sql, params) ✅ Parameterized query (user input safe)
db.search(table, text) Full-text search
db.backup(dest_path) 💾 Encrypted backup
db.cleanup_wal() 🗑️ Delete stale WAL file
db.begin_transaction(isolation) Start MVCC transaction
db.commit_transaction(txn_id) Commit transaction
db.abort_transaction(txn_id) Rollback transaction
db.verify_integrity() Check database integrity
db.stats() Database statistics
ThreadSafeOverDrive(path) 🧵 Thread-safe wrapper

Links

License

MIT / Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

overdrive_db-1.4.1.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

overdrive_db-1.4.1-py3-none-any.whl (1.5 MB view details)

Uploaded Python 3

File details

Details for the file overdrive_db-1.4.1.tar.gz.

File metadata

  • Download URL: overdrive_db-1.4.1.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for overdrive_db-1.4.1.tar.gz
Algorithm Hash digest
SHA256 9a3bbfd1c0835de3122721ac300397762e60797e29ebd5cbf74d29c81e6b89ee
MD5 43a4d18b7ca176d7dcabed513bb8a581
BLAKE2b-256 de56d3aaad9ec98e4b8cc54c322dcbbe5801e88ebcda8342146ac67946aef2a0

See more details on using hashes here.

File details

Details for the file overdrive_db-1.4.1-py3-none-any.whl.

File metadata

  • Download URL: overdrive_db-1.4.1-py3-none-any.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for overdrive_db-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9a568f17d87dfdf3827e4276c32f8e7b5e0455cff067270277d98c15768d2885
MD5 c02ff0facddbc8d58b3bb3fb4be728f4
BLAKE2b-256 23fb796ed29a5526dfce4eb1d96e8cfe4723fb427f6da4fd6efdab6c4ab3ea8f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page