GoodbyeSQL 0.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
goodbyesql/__init__.py
ADDED
goodbyesql/config.py
ADDED
goodbyesql/main.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
from sqlalchemy.ext.asyncio import AsyncSession
|
|
2
|
+
from sqlalchemy import select
|
|
3
|
+
from config import GoodbyeSQLConfig
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class GoodbyeSQL:
|
|
7
|
+
def __init__(self, config: GoodbyeSQLConfig):
|
|
8
|
+
self.config = config
|
|
9
|
+
|
|
10
|
+
async def get_info_by_username(self, *, session: AsyncSession, username: str):
|
|
11
|
+
|
|
12
|
+
model = self.config.user_model
|
|
13
|
+
field = getattr(model,self.config.username_field)
|
|
14
|
+
|
|
15
|
+
query = select(model).where(field == username)
|
|
16
|
+
result = await session.execute(query)
|
|
17
|
+
user: None = result.scalar_one_or_none()
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def check_my_library():
|
|
22
|
+
print("It is working right now!")
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
goodbyesql/__init__.py,sha256=4hJuTgjbpk-m6nLWDHGdDgF0Lf83Ih_56OpFsaISkPM,81
|
|
2
|
+
goodbyesql/config.py,sha256=j9pIFKPHZzkgokCNsjWbXntIdA7kSgKqYHqP-og_FYE,169
|
|
3
|
+
goodbyesql/main.py,sha256=Abxg-ozex_t7reQJ31z-reGw3xLeNICi_VPNyr7D7iA,639
|
|
4
|
+
goodbyesql-0.5.dist-info/METADATA,sha256=fnmoMrp9vfYI0gxtpqDk32ZmmbByRD0EqiE-XSuC1Fc,114
|
|
5
|
+
goodbyesql-0.5.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
6
|
+
goodbyesql-0.5.dist-info/entry_points.txt,sha256=HJZv1j9H1L-XcIje9b7p4wQLzWB-u4VSGj9zm2b0zqQ,52
|
|
7
|
+
goodbyesql-0.5.dist-info/top_level.txt,sha256=RKJnBiGErKfK2KnnHs8AXbl8Vk7JSMu_Oozegzplb6E,11
|
|
8
|
+
goodbyesql-0.5.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
goodbyesql
|