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

  • Each execute() is its own transaction and is durable in S3 when it returns (autocommit=True). Use transaction() for multi-statement atomicity.
  • 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.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 s3rds 0.1.0
File Size Uploaded Provenance
s3rds-0.1.0.tar.gz 13.6 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 27.8 kB

Release files / s3rds-0.1.0.tar.gz

Download URL s3rds-0.1.0.tar.gz
Size 13.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3d50dcaad2e189b5232d595cd3d5cacfa9fb12aae924fa6e023982a7fd50b383
BLAKE2b-256 checksum
How to use checksums
fd08d812c646d628c5f5208d3ec4f4574145af825a8051f233751176224b4dc2
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.0-py3-none-any.whl

Download URL s3rds-0.1.0-py3-none-any.whl
Size 14.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c016de80b9da610f6a251737df31328b7f8dbde77e10912b30a8700a98542a76
BLAKE2b-256 checksum
How to use checksums
ca1bf6bc3072e81b44a84ff9867d3a7da44eaf14e89c1e568fd48b617eef48df
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.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.

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