s3rds
Python drivers for s3rds — a truly serverless RDS: a Lambda URL as your database endpoint, SQLite on S3, ≈ $0 when idle.
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 (likeautocommit=True).commit()is a no-op.rollback()cannot undo statements that already ran — it warns if anything was written since the lastcommit()(and stays silent otherwise, so pools and ORMs may call it freely). For all-or-nothing writes usetransaction([...]), 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();rowsis 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.pymysqlraises pymysql-style exceptions with MySQL error codes (1062, 1146, 1054, 1064, …); unsupported MySQL features raiseNotSupportedErrorinstead 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.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| s3rds-0.1.2.tar.gz | 23.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| s3rds-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 47.0 kB
Release files / s3rds-0.1.2.tar.gz
| Download URL | s3rds-0.1.2.tar.gz |
|---|---|
| Size | 23.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f9f7763f30481a51495f7fb08efcf58186df6e790170a11d7969796eaa92d4ce
|
|
BLAKE2b-256 checksum How to use checksums |
6f05bf122bc2e945aec9b57ea8fe3fed60432e407b85683a6922280436d7e5f3
|
| 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.2-py3-none-any.whl
| Download URL | s3rds-0.1.2-py3-none-any.whl |
|---|---|
| Size | 23.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3bc318097d63c161015431bf14f8a648ca9942e1cc8722bd84203d12c1fd3b6b
|
|
BLAKE2b-256 checksum How to use checksums |
b3bab2589a664e08fb769d06e0cfce11f7f3ba0ac1d15f54e439ea8ea142cba1
|
| 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.2
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.