Skip to content

Commit 8edca20

Browse files
committed
doc: fill
1 parent 466a02e commit 8edca20

File tree

6 files changed

+14
-26
lines changed

6 files changed

+14
-26
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![Lines](https://img.shields.io/endpoint?url=https%3A%2F%2Fghloc.vercel.app%2Fapi%2Femptybutton%2Ftgdb%2Fbadge%3Ffilter%3D.py&logo=python&label=lines&color=blue)](https://github.com/search?q=repo%3Aemptybutton%2tgdb+language%3APython+&type=code)
66
[![Wakatime](https://wakatime.com/badge/user/0d3b7ff5-0547-4323-a43e-2a7308d973a0/project/2e316b92-fcf1-44d8-ad77-6c81e23cdfe2.svg)](https://wakatime.com/badge/user/0d3b7ff5-0547-4323-a43e-2a7308d973a0/project/2e316b92-fcf1-44d8-ad77-6c81e23cdfe2)
77

8-
РСУБД поверх телеграмма.
8+
РСУБД поверх Telegram.
99

1010
```bash
1111
pip install tgdb

src/tgdb/presentation/fastapi/common/app.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ async def app_from(container: AsyncContainer) -> FastAPI:
8484
version=version,
8585
summary="RDBMS over Telegram.",
8686
openapi_tags=tags_metadata,
87-
contact={"name": "Alexander Smolin", "url": author_url},
87+
contact={
88+
"name": "Alexander Smolin", "url": author_url,
89+
},
8890
license_info={
8991
"name": "Apache 2.0",
9092
"url": f"{repo_url}/blob/main/LICENSE",
@@ -103,4 +105,10 @@ async def app_from(container: AsyncContainer) -> FastAPI:
103105
setup_dishka(container=container, app=app)
104106
add_error_handling(app)
105107

108+
openapi = app.openapi()
109+
openapi["externalDocs"] = {
110+
"description": "Github",
111+
"url": repo_url,
112+
}
113+
106114
return app

src/tgdb/presentation/fastapi/horizon/routes/commit_transaction.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,6 @@
2121

2222
commit_transaction_router = APIRouter()
2323

24-
description = """
25-
Record all transaction operators and commit them.
26-
27-
A transaction may fail to commit in the following cases:
28-
1. It is a serializable transaction that conflicts with another serializable transaction.
29-
2. The server runs out of space for active transactions and rolls back your transaction.
30-
3. The transaction rolled back due to timeout.
31-
4. The server crashes.
32-
33-
If the commit fails, all changes in the transaction will not be applied.
34-
Therefore, for any negative response, retry the entire transaction.
35-
""" # noqa: E501
36-
3724

3825
class CommitTransactionSchema(BaseModel):
3926
operators: tuple[OperatorSchema, ...]
@@ -51,7 +38,7 @@ class CommitTransactionSchema(BaseModel):
5138
status.HTTP_409_CONFLICT: {"model": TransactionConflictSchema},
5239
},
5340
summary="Commit transaction",
54-
description=description,
41+
description="Record all transaction operators and commit them.",
5542
tags=[Tag.transaction],
5643
)
5744
@inject

src/tgdb/presentation/fastapi/horizon/routes/rollback_transaction.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@
1313

1414
rollback_transaction_router = APIRouter()
1515

16-
description = """
17-
Roll back the transaction as if it had never started.
18-
19-
If the transaction cannot be rolled back, it will be rolled back automatically
20-
over time.
21-
"""
22-
2316

2417
@rollback_transaction_router.delete(
2518
"/transactions/{xid}",
@@ -30,7 +23,7 @@
3023
status.HTTP_404_NOT_FOUND: {"model": NoTransactionSchema},
3124
},
3225
summary="Rollback transaction",
33-
description=description,
26+
description="Rollback a transaction as if it had never started.",
3427
tags=[Tag.transaction],
3528
)
3629
@inject

src/tgdb/presentation/fastapi/horizon/routes/start_transaction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class StartedTransactionSchema(BaseModel):
2929
status.HTTP_201_CREATED: {"model": StartedTransactionSchema},
3030
},
3131
summary="Start transaction",
32-
description="Start transaction.",
32+
description="Start new transaction.",
3333
tags=[Tag.transaction],
3434
)
3535
@inject

src/tgdb/presentation/fastapi/relation/routes/view_tuples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def of(cls, tuples: Iterable[Tuple]) -> "ViewedTuplesSchema":
5050
},
5151
},
5252
summary="View tuples",
53-
description="View tuples in an active transaction.",
53+
description="View tuples, optionally in an active transaction.",
5454
tags=[Tag.relation],
5555
)
5656
@inject

0 commit comments

Comments
 (0)