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

Uploaded Python 3

File details

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

File metadata

  • Download URL: overdrive_db-1.4.2.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.2.tar.gz
Algorithm Hash digest
SHA256 3bd9b7c2e50e853e5bfcbd79b1de01f002689c6991f53f0c76039c1a021aeaf2
MD5 67dcc1f21d15e981d7845e00f035b80c
BLAKE2b-256 5894fb6804add1b3120d2a96a8238a36285885d25170b4be904a16ee0133b679

See more details on using hashes here.

File details

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

File metadata

  • Download URL: overdrive_db-1.4.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 af281152064a287516e45fd7c3f757d098eaccdd3f168913cbe8adcca1d0c4b9
MD5 1e80a4ad021c9a85ecfb3b6c1ab34d1b
BLAKE2b-256 5bd07c93310dc02526190521f12c9db3454792838cb6ac3f8e0daa90f7622c78

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