55 < meta http-equiv ="X-UA-Compatible " content ="IE=edge " />
66 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
77 < link rel ="shortcut icon " href ="../img/favicon.ico " />
8- < title > Getting started - context-async-sqlalchemy</ title >
8+ < title > Getting Started - context-async-sqlalchemy</ title >
99 < link rel ="stylesheet " href ="../css/theme.css " />
1010 < link rel ="stylesheet " href ="../css/theme_extra.css " />
1111 < link rel ="stylesheet " href ="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/github.min.css " />
1212
1313 < script >
1414 // Current page data
15- var mkdocs_page_name = "Getting started " ;
15+ var mkdocs_page_name = "Getting Started " ;
1616 var mkdocs_page_input_path = "getting_started.md" ;
1717 var mkdocs_page_url = null ;
1818 </ script >
4444 </ li >
4545 </ ul >
4646 < ul >
47- < li class ="toctree-l1 "> < a class ="reference internal " href ="../problem "> What problems it solves </ a >
47+ < li class ="toctree-l1 "> < a class ="reference internal " href ="../problem "> The Problem It Solves </ a >
4848 </ li >
4949 </ ul >
5050 < ul class ="current ">
51- < li class ="toctree-l1 current "> < a class ="reference internal current " href ="# "> Getting started </ a >
51+ < li class ="toctree-l1 current "> < a class ="reference internal current " href ="# "> Getting Started </ a >
5252 < ul class ="current ">
5353 < li class ="toctree-l2 "> < a class ="reference internal " href ="#configure-the-connection-to-the-database "> Configure the connection to the database</ a >
5454 </ li >
6464 </ li >
6565 </ ul >
6666 < ul >
67- < li class ="toctree-l1 "> < a class ="reference internal " href ="../examples "> Usage examples </ a >
67+ < li class ="toctree-l1 "> < a class ="reference internal " href ="../examples "> Usage Examples </ a >
6868 </ li >
6969 </ ul >
7070 < ul >
71- < li class ="toctree-l1 "> < a class ="reference internal " href ="../concurrent_queries "> Concurrent sql queries </ a >
71+ < li class ="toctree-l1 "> < a class ="reference internal " href ="../concurrent_queries "> Concurrent SQL Queries </ a >
7272 </ li >
7373 </ ul >
7474 < ul >
9797 < div class ="rst-content "> < div role ="navigation " aria-label ="breadcrumbs navigation ">
9898 < ul class ="wy-breadcrumbs ">
9999 < li > < a href =".. " class ="icon icon-home " aria-label ="Docs "> </ a > </ li >
100- < li class ="breadcrumb-item active "> Getting started </ li >
100+ < li class ="breadcrumb-item active "> Getting Started </ li >
101101 </ ul >
102102 < hr />
103103</ div >
106106
107107 < h1 id ="getting-started "> Getting started</ h1 >
108108< h2 id ="configure-the-connection-to-the-database "> Configure the connection to the database</ h2 >
109- < p > for example for PostgreSQL database.py:</ p >
109+ < p > For example, for PostgreSQL - database.py:</ p >
110110< pre > < code class ="language-python "> from sqlalchemy.ext.asyncio import (
111111 async_sessionmaker,
112112 AsyncEngine,
@@ -153,7 +153,7 @@ <h2 id="configure-the-connection-to-the-database">Configure the connection to th
153153)
154154</ code > </ pre >
155155< h2 id ="manage-database-connection-lifecycle "> Manage Database connection lifecycle</ h2 >
156- < p > Close the resources at the end of your application's life </ p >
156+ < p > Close resources at the end of your application's lifecycle. </ p >
157157< p > Example for FastAPI:</ p >
158158< pre > < code class ="language-python "> from contextlib import asynccontextmanager
159159from typing import Any, AsyncGenerator
@@ -169,8 +169,9 @@ <h2 id="manage-database-connection-lifecycle">Manage Database connection lifecyc
169169 await connection.close() # Close the engine if it was open
170170</ code > </ pre >
171171< h2 id ="setup-middleware "> Setup middleware</ h2 >
172- < p > Middleware takes on the most important and complex work of managing context and sessions.</ p >
173- < p > You can use ready-made middlewares:</ p >
172+ < p > Middleware handles the most important and complex part -
173+ managing context and sessions.</ p >
174+ < p > You can use the ready-made middleware components:</ p >
174175< h3 id ="fastapi "> FastAPI</ h3 >
175176< pre > < code class ="language-python "> from context_async_sqlalchemy.fastapi_utils import (
176177 add_fastapi_http_db_session_middleware,
@@ -188,8 +189,9 @@ <h3 id="starlette">Starlette</h3>
188189add_starlette_http_db_session_middleware(app)
189190</ code > </ pre >
190191< h3 id ="write-own "> Write own</ h3 >
191- < p > If there is no ready-made solution for you, don't worry! You can see
192- < a href ="../how_middleware_works "> how it works</ a > and write your own.</ p >
192+ < p > If there’s no ready-made solution that fits your needs - don’t worry!
193+ You can check out < a href ="../how_middleware_works "> how it works</ a > and implement your
194+ own.</ p >
193195< h2 id ="use-it "> Use it</ h2 >
194196< pre > < code class ="language-python "> from context_async_sqlalchemy import db_session
195197from sqlalchemy import insert
@@ -216,19 +218,21 @@ <h2 id="use-it">Use it</h2>
216218 # The commit and closing of the session will occur automatically
217219</ code > </ pre >
218220< h2 id ="examples "> Examples</ h2 >
219- < p > The repository includes an example integration with FastAPI,
220- which describes numerous workflows.
221+ < p > The repository includes an example integration with FastAPI, demonstrating
222+ various workflows:
221223< a href ="https://github.com/krylosov-aa/context-async-sqlalchemy/tree/main/examples/fastapi_example/routes "> FastAPI example</ a > </ p >
222- < p > It also includes two types of test setups you can use in your projects.</ p >
223- < p > All library tests are in the examples, as we want to test not in the abstract
224- but in the context of a real asynchronous web application.</ p >
225- < p > < a href ="https://github.com/krylosov-aa/context-async-sqlalchemy/tree/main/examples/fastapi_example/tests "> FastAPI tests example</ a > </ p >
224+ < p > It also contains two types of test setups that you can use in your own
225+ projects.</ p >
226+ < p > All library tests are included within the examples - because we aim to
227+ test the functionality not in isolation, but in the context of a real
228+ asynchronous web application.
229+ < a href ="https://github.com/krylosov-aa/context-async-sqlalchemy/tree/main/examples/fastapi_example/tests "> FastAPI tests example</ a > </ p >
226230
227231 </ div >
228232 </ div > < footer >
229233 < div class ="rst-footer-buttons " role ="navigation " aria-label ="Footer Navigation ">
230- < a href ="../problem " class ="btn btn-neutral float-left " title ="What problems it solves "> < span class ="icon icon-circle-arrow-left "> </ span > Previous</ a >
231- < a href ="../examples " class ="btn btn-neutral float-right " title ="Usage examples "> Next < span class ="icon icon-circle-arrow-right "> </ span > </ a >
234+ < a href ="../problem " class ="btn btn-neutral float-left " title ="The Problem It Solves "> < span class ="icon icon-circle-arrow-left "> </ span > Previous</ a >
235+ < a href ="../examples " class ="btn btn-neutral float-right " title ="Usage Examples "> Next < span class ="icon icon-circle-arrow-right "> </ span > </ a >
232236 </ div >
233237
234238 < hr />
0 commit comments