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
@@ -0,0 +1,3 @@
1
+ # __init__.py
2
+ from .main import GoodbyeSQL
3
+ from .config import GoodbyeSQLConfig
goodbyesql/config.py ADDED
@@ -0,0 +1,11 @@
1
+ from dataclasses import dataclass
2
+ from typing import Any
3
+
4
+
5
+ @dataclass
6
+ class GoodbyeSQLConfig:
7
+ user_model: any
8
+ username_field: str = 'username'
9
+
10
+
11
+
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,5 @@
1
+ Metadata-Version: 2.4
2
+ Name: GoodbyeSQL
3
+ Version: 0.5
4
+ Requires-Dist: sqlalchemy==2.0.43
5
+ Dynamic: requires-dist
@@ -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,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ goodbyesql = goodbyesql.main:main
@@ -0,0 +1 @@
1
+ goodbyesql