Skip to content

examples: Concurrent Ideas Board demo (6 features) - #5

Merged
felipeg48 merged 4 commits into
mainfrom
example/ideas-board
Nov 19, 2026
Merged

felipeg48 merged 4 commits into
mainfrom
example/ideas-board

Conversation

@felipeg48

Copy link
Copy Markdown
Contributor

Adds the Concurrent Ideas Board example (examples/ideas-board/) for the Python library.

Hero: @crdb_retry on SQLSTATE 40001 under SERIALIZABLE. Includes metrics, follower reads, CDC, multi-region, and vector/semantic search. On the psycopg path the follower-read/regional decorators are declarative — the demo applies staleness / writes crdb_region explicitly, with the SQLAlchemy layer providing auto-injection. Unit tests pass; Testcontainers ITs skip without Docker; multi-region/vector ITs gated on cluster/image.

Mirror the Java demo's metrics, follower-read, CDC, multi-region, and
semantic-search features in Python idiom against this library's real API:

- metrics: RetryEngine + InMemoryMetricsCollector count transactions/retries
- follower-read: @follower_read + build_staleness, cooperative AS OF SYSTEM TIME
- cdc: @changefeed_handler + ChangefeedHandlerRegistry webhook dispatch
- multi-region: @regional_by_row + RegionContext, explicit crdb_region write
- semantic-search: CockroachDBVectorStore + deterministic embedding provider

Each feature ships a runnable unit test plus a Testcontainers integration
test; multi-region and semantic ITs are gated (multi-region cluster / vector
image). Tagged regions added for tutorial include.
The example/ideas-board tree never ran through CI before (first push of the
branch), so ruff format --check and ruff check . flagged it. Apply ruff format
to the example, auto-fix import sorting and stray noqa, and extend the examples
per-file-ignores (TC, SIM105, N818) so demo code keeps a runtime pytest import
and readable try/except without weakening library linting. No logic changes;
unit tests still 15 passed / 5 skipped (ITs skip without Docker).
@felipeg48
felipeg48 merged commit d3e2413 into main Nov 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant