Skip to main content

PyDb-SQL

A lightweight, Mongoose-inspired SQL ORM for Python with a focus on developer experience, safety, and modern architectural patterns.

Features

  • Declarative Schema: Define models as Python classes.
  • Mongoose-like Queries: Chainable query builder with double-underscore operators (age__gt=20).
  • Identity Map (Session): Ensures object uniqueness across queries.
  • Dirty Tracking: Optimized UPDATE queries that only send modified fields.
  • Lazy Loading: Automatic relationship fetching via ForeignKeyField.
  • Connection Pooling: Built-in support for MySQL connection pooling.

Installation

pip install pydb-sql

Quick Start

from pydb import connect, Model, StringField, IntField

# 1. Connect
connect(host="localhost", user="root", password="your_password", database="test_db")

# 2. Define
class User(Model):
    name = StringField(required=True)
    age = IntField(default=18)

# 3. Synchronize
User.init_table()

# 4. Use
u = User(name="Satyam", age=25).save()
print(f"Created user with ID: {u.id}")

# Query
user = User.find_one(name="Satyam")
user.age = 26
user.save() # Performs partial update

License

MIT

Metadata

Release files for pydb-sql 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydb-sql 0.1.0
File Size Uploaded Provenance Actions
pydb_sql-0.1.0.tar.gz 6.1 kB Without provenance Details for pydb_sql-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pydb-sql 0.1.0
File Interpreter ABI Platform Actions
pydb_sql-0.1.0-py3-none-any.whl Python 3 none any Details for pydb_sql-0.1.0-py3-none-any.whl

Total release size: 12.5 kB

Release files / pydb_sql-0.1.0.tar.gz

Download URL pydb_sql-0.1.0.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4f54fc63bf9d56521a5030b9ce9b9f73eb80e0581a1453c9ae7ed3c5b56c563b
BLAKE2b-256 checksum
How to use checksums
9da9bef1f64ed929da7436e81d4a60894d5547a6829f3a47df44aca50a548f96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release files / pydb_sql-0.1.0-py3-none-any.whl

Download URL pydb_sql-0.1.0-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c98175230b9e72d488f928dd10fba0ef56f9898c653e0197e704f5072d497a85
BLAKE2b-256 checksum
How to use checksums
b06a8c1b964c0319143f5b5bc195d3e91ed831b5c1224df259a4a7a44f914a3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Security for pydb-sql 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page