Quickstart
Install
Section titled “Install”uv add lexigram-nosqlAdd an optional backend extra for your driver:
uv add "lexigram-nosql[mongodb]" # motoruv add "lexigram-nosql[dynamodb]" # aioboto3uv add "lexigram-nosql[firestore]" # google-cloud-firestoreMinimal Example
Section titled “Minimal Example”import asynciofrom lexigram import Applicationfrom lexigram.contracts.data.nosql import DocumentStoreProtocolfrom lexigram.nosql import NoSQLModule, NoSQLConfig
async def main() -> None: async with Application.boot( name="nosql-demo", modules=[ NoSQLModule.configure( NoSQLConfig(driver="mongodb") ), ], ) as app: store = await app.container.resolve(DocumentStoreProtocol) collection = store.collection("users") result = await collection.insert_one( {"name": "Alice", "email": "alice@example.com"} ) print(f"Inserted: {result.document_id}")
asyncio.run(main())How It Works
Section titled “How It Works”NoSQLModule.configure()creates aNoSQLProviderwith the given config.- The provider registers a
DocumentStoreProtocolsingleton in the container. - On boot, the provider connects to the document store.
- Services receive the store via constructor injection.
Next Steps
Section titled “Next Steps”- Guide — mental model, core concepts, common patterns
- How-Tos — task-oriented recipes
- Configuration — every config key with env-var names