[14350] Added ScyllaDB and Cassandra docs and tests#14352
Closed
andrii-kysylevskyi wants to merge 6 commits intofastapi:masterfrom
Closed
[14350] Added ScyllaDB and Cassandra docs and tests#14352andrii-kysylevskyi wants to merge 6 commits intofastapi:masterfrom
andrii-kysylevskyi wants to merge 6 commits intofastapi:masterfrom
Conversation
861bb10 to
fe69066
Compare
Contributor
📝 Docs previewLast commit 3c3e723 at: https://1b800028.fastapitiangolo.pages.dev Modified Pages |
3ec9a50 to
88653cd
Compare
Member
|
Thanks for the interest! I'm currently not using Cassandra, I wouldn't have the bandwidth to maintain this extra tutorial. So I'll pass on this one for now. Thanks! ☕ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NoSQL Databases Tutorial (Cassandra/ScyllaDB)
Adds a tutorial demonstrating FastAPI integration with NoSQL databases, specifically Apache Cassandra and ScyllaDB.
What's Included
docs/en/docs/tutorial/nosql-databases.md)tutorial001.py(Cassandra) andtutorial001_scylla.py(ScyllaDB)Compatibility
typing.Listfor older versions)Key Features
lifespanpatternWhy This Tutorial?
FastAPI documentation currently covers SQL databases but doesn't mention NoSQL options. Community articles already demonstrate FastAPI + Cassandra integration (e.g., DataStax Astra DB docs), showing there's demand for this content.
Testing Approach
Tests use mocked database operations (via
conftest.py) to:What tests validate:
What tests don't validate:
This differs from SQL tutorials which use real SQLite. The tutorial code has been manually tested against real Cassandra and ScyllaDB containers via Docker Compose.
Future Improvements
Integration tests with real databases (using
testcontainers-python) could be added to validate actual database operations. This could be done in this PR or as a follow-up, depending on maintainer preference.Files Changed
docs/en/docs/tutorial/nosql-databases.md- Tutorial documentationdocs/en/mkdocs.yml- Added tutorial to navigationdocs_src/nosql_databases/tutorial001.py- Cassandra exampledocs_src/nosql_databases/tutorial001_scylla.py- ScyllaDB exampletests/test_tutorial/test_nosql_databases/- Tests with mocked databaserequirements-tests.txt- Removed cassandra-driver (tests use mocks)Questions for Reviewers
conftest.pymocking approach acceptable?