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.0.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.0-py3-none-any.whl (1.5 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: overdrive_db-1.4.0.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.0.tar.gz
Algorithm Hash digest
SHA256 a61fe0bbef2535445b652a8f5e04622caced6014b7a745ff230fe7ce84c21b08
MD5 262bfacb9a20f86de78629824e078af6
BLAKE2b-256 ceed98da145173114d67bc86df37a44bc1638d1951185eabe4a8f187389518dd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: overdrive_db-1.4.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 51e517c05b92c0cf54c0f5d67f26844d7d2ad82cca47f8da2745bd7f9e441d98
MD5 9440ef1cbd47ecbf56372c61dee20647
BLAKE2b-256 897697cc4260fb051007e5c2102a65f0ba5895cdc71fa16d1aefa3909dda2609

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