Skip to main content

s3rds

Python drivers for s3rds — a truly serverless RDS: a Lambda URL as your database endpoint, SQLite on S3, ≈ $0 when idle.

s3rds architecture

Zero dependencies (standard library only). Each driver is a submodule named after the standard client it mirrors, so moving to a real database is a one-line import change and nothing else:

pip install s3rds                # s3rds.sqlite: SQLite dialect
pip install "s3rds[mysql]"       # + s3rds.pymysql: write MySQL, translated on the client (sqlglot)
from s3rds import pymysql        # today   -- later: `import pymysql` on a real RDS, rest unchanged

conn = pymysql.connect(
    host="xxxx.lambda-url.us-east-2.on.aws",
    user="admin", password="...", database="blog")

with conn.cursor() as cur:
    cur.execute("CREATE TABLE posts (id INT AUTO_INCREMENT PRIMARY KEY, title VARCHAR(200))")
    cur.execute("INSERT INTO posts (title) VALUES (%s)", ["hello"])
    print(cur.lastrowid)

with conn.cursor(pymysql.cursors.DictCursor) as cur:
    cur.execute("SELECT * FROM posts WHERE id = %s", [1])
    print(cur.fetchall())                         # [{'id': 1, 'title': 'hello'}]

conn.transaction([                                 # all-or-nothing, single S3 write
    ("UPDATE stock SET qty = qty - 1 WHERE id = %s", [7]),
    ("INSERT INTO orders (item) VALUES (%s)", [7]),
])
Submodule SQL dialect Mirrors Status
s3rds.sqlite SQLite (no translation) pymysql-shaped API available
s3rds.pymysql MySQL, translated on the client pymysql available — pip install "s3rds[mysql]"
s3rds.psycopg2 PostgreSQL psycopg2 placeholder; connect() raises until implemented

Semantics

  • Transactions: each execute() is its own transaction and is durable in S3 when it returns (like autocommit=True). commit() is a no-op. rollback() cannot undo statements that already ran — it warns if anything was written since the last commit() (and stays silent otherwise, so pools and ORMs may call it freely). For all-or-nothing writes use transaction([...]), which runs several statements as one commit and one S3 write.
  • Large results are paged by the server (4 MB per page) and reassembled inside execute(); rows is always complete. If the database changes while paging, the query is re-run rather than mixing versions.
  • Writes never duplicate: the driver re-sends only when the request provably never reached the server (stale keep-alive connection). Timeouts raise an error with an explicit "result unknown".
  • s3rds.pymysql raises pymysql-style exceptions with MySQL error codes (1062, 1146, 1054, 1064, …); unsupported MySQL features raise NotSupportedError instead of misbehaving silently.

Server

You need an s3rds server in your own AWS account — deploy it once with Terraform or CloudFormation from the main repository. Same as any driver needs its database.

Metadata

Release files for s3rds 0.1.1

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

Source distribution (sdist)

Source distribution for s3rds 0.1.1
File Size Uploaded Provenance
s3rds-0.1.1.tar.gz 15.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for s3rds 0.1.1
File Interpreter ABI Platform
s3rds-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 30.7 kB

Release files / s3rds-0.1.1.tar.gz

Download URL s3rds-0.1.1.tar.gz
Size 15.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4c8f2cc129f06d9d48f28f49a3139b72a7864b1a0dd2ab0bee75d53aa5eb4d53
BLAKE2b-256 checksum
How to use checksums
fc042aaae6060e0be38095fde0dde2711c23143fb677b66301ad8d01d910e499
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / s3rds-0.1.1-py3-none-any.whl

Download URL s3rds-0.1.1-py3-none-any.whl
Size 15.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9e2beecd12ea68ace4e3dec5c6f0c0f082454e3a2f6714f9f4d6112072a0efb
BLAKE2b-256 checksum
How to use checksums
45838d5c254859adb87ebbd958805c047a19e9c5ee8a497e711f24c99a6eb4dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Security for s3rds 0.1.1

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.

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