Metadata-Version: 2.4
Name: soketdb
Version: 2.0.0
Summary: SoketDB v2.0 — A production-ready, PostgreSQL-like database with AI-powered queries, automatic cloud backup, encryption, MVCC transactions, indexes, constraints, and zero setup.
Home-page: https://github.com/pythos-team/soketdb
Author: Alex Austin
Author-email: Alex Austin <benmap40@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/pythos-team/soketdb
Project-URL: Documentation, https://github.com/pythos-team/soketdb#readme
Project-URL: Repository, https://github.com/pythos-team/soketdb
Project-URL: Bug Tracker, https://github.com/pythos-team/soketdb/issues
Project-URL: Changelog, https://github.com/pythos-team/soketdb/releases
Keywords: database,json,sql,ai,nlp,offline,lightweight,transactions,mvcc,acid,postgresql,production-database,encryption,huggingface,google-drive,aws-s3,dropbox,cloud-sync,indexes,constraints
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Operating System :: OS Independent
Classifier: Topic :: Database
Classifier: Topic :: Database :: Database Engines/Servers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: huggingface_hub>=0.16.0
Requires-Dist: sqlparse>=0.4.3
Requires-Dist: requests>=2.28.0
Requires-Dist: redis>=4.5.0
Requires-Dist: dropbox>=11.36.0
Requires-Dist: boto3>=1.26.0
Requires-Dist: google-auth-oauthlib>=1.0.0
Requires-Dist: google-auth-httplib2>=0.1.0
Requires-Dist: google-api-python-client>=2.70.0
Requires-Dist: cryptography>=39.0.0
Provides-Extra: full
Requires-Dist: cryptography>=39.0.0; extra == "full"
Requires-Dist: huggingface_hub>=0.16.0; extra == "full"
Requires-Dist: boto3>=1.26.0; extra == "full"
Requires-Dist: dropbox>=11.36.0; extra == "full"
Requires-Dist: google-api-python-client>=2.70.0; extra == "full"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: black>=22.0.0; extra == "dev"
Requires-Dist: mypy>=0.990; extra == "dev"
Requires-Dist: flake8>=5.0.0; extra == "dev"
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# ⚡ SoketDB v2.0 — The Production-Ready Database That Runs Anywhere

> **No setup. No servers. No compromises.**
> SoketDB v2.0 transforms from a simple JSON database into a full-featured, ACID-compliant database engine with PostgreSQL-like capabilities — while maintaining zero setup and offline-first philosophy.

---

## 🎊 **MAJOR UPGRADE: SoketDB v2.0**

**This is NOT just an update — it's a complete reimagining of what SoketDB can be.**

The original SoketDB was a smart JSON database. **SoketDB v2.0 is now a production-ready database engine** with all the features you'd expect from PostgreSQL, but with zero setup and AI-powered queries.

### ✨ **What's New in v2.0:**

#### 🏛️ **PostgreSQL-Like Architecture**
- **Write-Ahead Logging (WAL)** — Guaranteed durability and crash recovery
- **Multi-Version Concurrency Control (MVCC)** — Full transaction isolation levels
- **Connection Pooling** — Proper database connections with `Connection` and `Cursor` objects
- **ACID Compliance** — Atomicity, Consistency, Isolation, Durability

#### 📊 **Advanced Query Features**
- **Full JOIN Support** — Inner, Left, Right, and Cross joins
- **Subqueries & CTEs** — Common Table Expressions for complex queries
- **Window Functions** — ROW_NUMBER(), RANK(), LEAD(), LAG()
- **Aggregate Functions** — COUNT, SUM, AVG, MIN, MAX with GROUP BY
- **Full-Text Search** — Built-in search capabilities

#### 🔧 **Database Objects**
- **Indexes** — B-tree, Hash, and GIN (Generalized Inverted Index) for JSON
- **Constraints** — PRIMARY KEY, FOREIGN KEY, UNIQUE, NOT NULL, CHECK, DEFAULT
- **Sequences** — Auto-incrementing columns
- **Views** — Virtual tables based on queries
- **Stored Procedures** — Custom functions (coming soon)

#### 🔐 **Enterprise Security**
- **Production Encryption** — AES-256 encryption for data at rest
- **Automatic Key Management** — Secure key generation and storage
- **Encrypted Backups** — All cloud backups are encrypted
- **Environment Variable Support** — Secure credential management

#### ☁️ **Intelligent Cloud Integration**
- **Automatic Backup Restoration** — Always queries from backup for latest data
- **Hard Read/Write** — Guaranteed persistence with multiple backup layers
- **Smart Caching** — Always fetches latest data without explicit restore()
- **Multi-Provider Support** — HuggingFace, Google Drive, AWS S3, Dropbox

#### 🧠 **Enhanced AI Engine**
- **Natural Language to SQL** — Even smarter query translation
- **Query Optimization** — Automatic execution plan generation
- **Query Caching** — 5-minute cache for frequently run queries
- **Performance Stats** — Detailed database performance metrics

#### 📋 **New Database Objects & Methods**

```python
# Connections & Cursors (like PostgreSQL)
conn = db.get_connection()
cursor = conn.cursor()
cursor.execute("SELECT * FROM users")
row = cursor.fetchone()  # ✅ YES, fetchone() works!
rows = cursor.fetchall()
batch = cursor.fetchmany(10)

# Transactions with isolation levels
conn.begin(isolation_level=IsolationLevel.SERIALIZABLE)
try:
    conn.execute("UPDATE accounts SET balance = balance - 100 WHERE id = 1")
    conn.execute("UPDATE accounts SET balance = balance + 100 WHERE id = 2")
    conn.commit()
except:
    conn.rollback()

# Indexes
db.create_index("users", "email", IndexType.BTREE)
db.create_index("users", "metadata", IndexType.GIN)  # For JSON fields

# Constraints
db.add_constraint("users", "pk_users", ConstraintType.PRIMARY_KEY, ["id"])
db.add_constraint("users", "unique_email", ConstraintType.UNIQUE, ["email"])
db.add_constraint("users", "age_check", ConstraintType.CHECK, ["age"], check_expr="age >= 0 AND age <= 150")

# Advanced queries
result = db.execute("""
    WITH user_orders AS (
        SELECT u.name, COUNT(o.id) as order_count
        FROM users u
        LEFT JOIN orders o ON u.id = o.user_id
        GROUP BY u.id, u.name
    )
    SELECT name, order_count,
           RANK() OVER (ORDER BY order_count DESC) as rank
    FROM user_orders
""")
