Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /pbylicki_rfhub2 /rfhub2 /api /utils /db.py
| from starlette.requests import Request | |
| from rfhub2.db.repository.keyword_repository import KeywordRepository | |
| from rfhub2.db.repository.collection_repository import CollectionRepository | |
| from rfhub2.db.repository.keyword_statistics_repository import ( | |
| KeywordStatisticsRepository, | |
| ) | |
| def get_collection_repository(request: Request) -> CollectionRepository: | |
| return CollectionRepository(request.state.db) | |
| def get_keyword_repository(request: Request) -> KeywordRepository: | |
| return KeywordRepository(request.state.db) | |
| def get_keyword_statistics_repository(request: Request) -> KeywordStatisticsRepository: | |
| return KeywordStatisticsRepository(request.state.db) | |
| def db_healthcheck(request: Request) -> bool: | |
| try: | |
| result = request.state.db.execute("select 1") | |
| return next(result) == (1,) | |
| except Exception as e: | |
| print(e) | |
| return False | |
Xet Storage Details
- Size:
- 886 Bytes
- Xet hash:
- ca2def39c879e7f5b538907f9a73f5ed67a3e48924a2fbe6c1b0fcc74efefe73
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.