fastasyncpg 0.0.5__tar.gz → 0.0.6__tar.gz
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.
- {fastasyncpg-0.0.5/fastasyncpg.egg-info → fastasyncpg-0.0.6}/PKG-INFO +1 -1
- fastasyncpg-0.0.6/fastasyncpg/__init__.py +1 -0
- {fastasyncpg-0.0.5 → fastasyncpg-0.0.6}/fastasyncpg/_modidx.py +1 -0
- {fastasyncpg-0.0.5 → fastasyncpg-0.0.6}/fastasyncpg/core.py +13 -7
- {fastasyncpg-0.0.5 → fastasyncpg-0.0.6/fastasyncpg.egg-info}/PKG-INFO +1 -1
- fastasyncpg-0.0.5/fastasyncpg/__init__.py +0 -1
- {fastasyncpg-0.0.5 → fastasyncpg-0.0.6}/LICENSE +0 -0
- {fastasyncpg-0.0.5 → fastasyncpg-0.0.6}/MANIFEST.in +0 -0
- {fastasyncpg-0.0.5 → fastasyncpg-0.0.6}/README.md +0 -0
- {fastasyncpg-0.0.5 → fastasyncpg-0.0.6}/fastasyncpg.egg-info/SOURCES.txt +0 -0
- {fastasyncpg-0.0.5 → fastasyncpg-0.0.6}/fastasyncpg.egg-info/dependency_links.txt +0 -0
- {fastasyncpg-0.0.5 → fastasyncpg-0.0.6}/fastasyncpg.egg-info/entry_points.txt +0 -0
- {fastasyncpg-0.0.5 → fastasyncpg-0.0.6}/fastasyncpg.egg-info/requires.txt +0 -0
- {fastasyncpg-0.0.5 → fastasyncpg-0.0.6}/fastasyncpg.egg-info/top_level.txt +0 -0
- {fastasyncpg-0.0.5 → fastasyncpg-0.0.6}/pyproject.toml +0 -0
- {fastasyncpg-0.0.5 → fastasyncpg-0.0.6}/setup.cfg +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.0.6"
|
|
@@ -19,6 +19,7 @@ d = { 'settings': { 'branch': 'main',
|
|
|
19
19
|
'fastasyncpg.core.Database.item': ('core.html#database.item', 'fastasyncpg/core.py'),
|
|
20
20
|
'fastasyncpg.core.Database.link_dcs': ('core.html#database.link_dcs', 'fastasyncpg/core.py'),
|
|
21
21
|
'fastasyncpg.core.Database.q': ('core.html#database.q', 'fastasyncpg/core.py'),
|
|
22
|
+
'fastasyncpg.core.Database.qone': ('core.html#database.qone', 'fastasyncpg/core.py'),
|
|
22
23
|
'fastasyncpg.core.Database.refresh': ('core.html#database.refresh', 'fastasyncpg/core.py'),
|
|
23
24
|
'fastasyncpg.core.Database.set_classes': ('core.html#database.set_classes', 'fastasyncpg/core.py'),
|
|
24
25
|
'fastasyncpg.core.Database.t': ('core.html#database.t', 'fastasyncpg/core.py'),
|
|
@@ -392,15 +392,21 @@ async def selectone(
|
|
|
392
392
|
elif len(res) > 1: raise ValueError(f"Not unique: {len(res)} results")
|
|
393
393
|
return res[0]
|
|
394
394
|
|
|
395
|
-
# %% ../nbs/00_core.ipynb #
|
|
395
|
+
# %% ../nbs/00_core.ipynb #d994c66c
|
|
396
396
|
@patch
|
|
397
|
-
async def
|
|
398
|
-
"Execute sql and return
|
|
399
|
-
res = await self.
|
|
397
|
+
async def qone(self:Database, sql, *args, **kwargs):
|
|
398
|
+
"Execute sql and return exactly one row"
|
|
399
|
+
res = await self.q(sql, *args, **kwargs)
|
|
400
400
|
if len(res)==0: raise NotFoundError
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
401
|
+
if len(res)>1: raise ValueError(f"Not unique: {len(res)} results")
|
|
402
|
+
return res[0]
|
|
403
|
+
|
|
404
|
+
# %% ../nbs/00_core.ipynb #e53a268a
|
|
405
|
+
@patch
|
|
406
|
+
async def item(self:Database, sql, *args, **kwargs):
|
|
407
|
+
"Execute sql and return a single field from a single row"
|
|
408
|
+
row = await self.qone(sql, *args, **kwargs)
|
|
409
|
+
if len(row)>1: raise ValueError(f"Too many fields: {len(row)} fields")
|
|
404
410
|
return row[0]
|
|
405
411
|
|
|
406
412
|
# %% ../nbs/00_core.ipynb #0261da8a
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.0.5"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|