From 06f7897c91a9bbbf99f3891b16ab0d292abc6f10 Mon Sep 17 00:00:00 2001 From: Stephen Chapman Date: Sat, 20 Jun 2026 14:04:17 -0400 Subject: [PATCH 1/2] Correct storage backend documentation --- README.md | 5 +++-- docs/MIGRATION.md | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0f33940..f925ffd 100644 --- a/README.md +++ b/README.md @@ -33,9 +33,10 @@ This is a pure python distribution and - thus - should require no external compilers or tools besides those contained within Python itself. -# Notes for this fork +# Project notes -- **Default storage:** this fork uses Parquet v2 files by default (via `pyarrow`) for improved I/O performance and reliability. If `pyarrow` is not available, it falls back to TinyDB's default JSON storage. +- **Default storage:** TinyMongo uses TinyDB's default JSON storage unless another backend is selected. +- **Optional storage backends:** Parquet v2, SQLite, and DuckDB backends are available by passing `backend="parquet"`, `backend="sqlite"`, or `backend="duckdb"` to `TinyMongoClient`. - **Concurrency:** writes use atomic temp-file replace and optional advisory locks (`portalocker`) to reduce corruption risk under concurrent writers. - **Tests & CI:** a GitHub Actions workflow is included at `.github/workflows/ci.yml` to run unit tests and linters across Python versions. See `requirements-dev.txt` for dev dependencies. diff --git a/docs/MIGRATION.md b/docs/MIGRATION.md index 86b9636..0807f5d 100644 --- a/docs/MIGRATION.md +++ b/docs/MIGRATION.md @@ -5,7 +5,8 @@ This guide helps you migrate from earlier `tinymongo` versions to `1.0.0`. ## Key changes - The package now uses `pyproject.toml` for packaging metadata. -- Default storage is now Parquet v2 (`pyarrow`) instead of TinyDB JSON files. +- Default storage remains TinyDB JSON storage. +- Parquet v2, SQLite, and DuckDB are available as optional storage backends. - Concurrent writes are safer due to atomic file replace and optional file locks. - Optional `uv` extras are available for dependency-managed ASGI usage. @@ -24,6 +25,7 @@ pip install .[uv] ## Notes -- The default storage uses Parquet and requires `pyarrow`. -- If `pyarrow` is not installed, `tinymongo` falls back to TinyDB JSON storage. +- The default storage uses TinyDB JSON storage. +- Parquet storage requires `pyarrow`; DuckDB storage requires `duckdb`. +- Select optional storage backends with `TinyMongoClient(path, backend="parquet")`, `backend="sqlite"`, or `backend="duckdb"`. - For local development, install `requirements-dev.txt` and run `pytest -q`. From 28dbcbdd87b3d2625779df0c836dedd3868784ec Mon Sep 17 00:00:00 2001 From: Stephen Chapman Date: Sat, 20 Jun 2026 17:57:44 -0400 Subject: [PATCH 2/2] Document storage backend options --- README.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f925ffd..ce9d133 100644 --- a/README.md +++ b/README.md @@ -36,11 +36,37 @@ compilers or tools besides those contained within Python itself. # Project notes - **Default storage:** TinyMongo uses TinyDB's default JSON storage unless another backend is selected. -- **Optional storage backends:** Parquet v2, SQLite, and DuckDB backends are available by passing `backend="parquet"`, `backend="sqlite"`, or `backend="duckdb"` to `TinyMongoClient`. +- **Optional storage backends:** Parquet v2, SQLite, and DuckDB backends are available. - **Concurrency:** writes use atomic temp-file replace and optional advisory locks (`portalocker`) to reduce corruption risk under concurrent writers. - **Tests & CI:** a GitHub Actions workflow is included at `.github/workflows/ci.yml` to run unit tests and linters across Python versions. See `requirements-dev.txt` for dev dependencies. +# Backend options + +TinyMongo defaults to TinyDB's JSON storage: + +```python + from tinymongo import TinyMongoClient + + connection = TinyMongoClient("/path/to/folder") +``` + +You can select another backend with the `backend` argument: + +```python + parquet_connection = TinyMongoClient("/path/to/folder", backend="parquet") + sqlite_connection = TinyMongoClient("/path/to/folder", backend="sqlite") + duckdb_connection = TinyMongoClient("/path/to/folder", backend="duckdb") +``` + +Available backends: + +- `tinydb` or `json`: TinyDB's default JSON storage. This is the default and writes `.json` files. +- `parquet` or `parquetv2`: Parquet v2 storage backed by `pyarrow`. This writes `.parquet` files. +- `sqlite`: SQLite storage using Python's standard `sqlite3` module. This writes `.sqlite` files. +- `duckdb`: DuckDB storage. Install `duckdb` before using this backend. This writes `.duckdb` files. + + # Examples The quick start is shown below. For a more detailed look at tinymongo,