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

Uploaded Python 3

File details

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

File metadata

  • Download URL: overdrive_db-1.4.3.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.3.tar.gz
Algorithm Hash digest
SHA256 c2645d6b46756ef88602a95e4fe6b835725feed73a66802778501f0e53b6178c
MD5 00e3cd7e8b38d571e7d36ed3bddcabad
BLAKE2b-256 f860b6601716271977b96b62d6a8b433364a5928aa78fdff98ab08b60eb76e31

See more details on using hashes here.

File details

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

File metadata

  • Download URL: overdrive_db-1.4.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 dfb31e8b2a58e58276e652ff2b48ebeb53b33c0a7be74dc952d0492e4acee98b
MD5 6a5dbabf6910be0aeef295cc45b24027
BLAKE2b-256 4f68686514e728ce699661660a9699070542663c47a24916033c313411397d72

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