nanasqlite 1.3.3.dev4__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.
- nanasqlite/__init__.py +52 -0
- nanasqlite/async_core.py +1456 -0
- nanasqlite/cache.py +335 -0
- nanasqlite/core.py +2336 -0
- nanasqlite/exceptions.py +117 -0
- nanasqlite/py.typed +0 -0
- nanasqlite/sql_utils.py +174 -0
- nanasqlite/utils.py +202 -0
- nanasqlite-1.3.3.dev4.dist-info/METADATA +413 -0
- nanasqlite-1.3.3.dev4.dist-info/RECORD +13 -0
- nanasqlite-1.3.3.dev4.dist-info/WHEEL +5 -0
- nanasqlite-1.3.3.dev4.dist-info/licenses/LICENSE +21 -0
- nanasqlite-1.3.3.dev4.dist-info/top_level.txt +1 -0
nanasqlite/__init__.py
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"""
|
|
2
|
+
NanaSQLite: A dict-like SQLite wrapper with instant persistence and intelligent caching.
|
|
3
|
+
|
|
4
|
+
Example:
|
|
5
|
+
>>> from nanasqlite import NanaSQLite
|
|
6
|
+
>>> db = NanaSQLite("mydata.db")
|
|
7
|
+
>>> db["user"] = {"name": "Nana", "age": 20}
|
|
8
|
+
>>> print(db["user"])
|
|
9
|
+
{'name': 'Nana', 'age': 20}
|
|
10
|
+
|
|
11
|
+
Async Example:
|
|
12
|
+
>>> import asyncio
|
|
13
|
+
>>> from nanasqlite import AsyncNanaSQLite
|
|
14
|
+
>>>
|
|
15
|
+
>>> async def main():
|
|
16
|
+
... async with AsyncNanaSQLite("mydata.db") as db:
|
|
17
|
+
... await db.aset("user", {"name": "Nana", "age": 20})
|
|
18
|
+
... user = await db.aget("user")
|
|
19
|
+
... print(user)
|
|
20
|
+
>>>
|
|
21
|
+
>>> asyncio.run(main())
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
from .async_core import AsyncNanaSQLite
|
|
25
|
+
from .cache import CacheType
|
|
26
|
+
from .core import NanaSQLite
|
|
27
|
+
from .exceptions import (
|
|
28
|
+
NanaSQLiteCacheError,
|
|
29
|
+
NanaSQLiteClosedError,
|
|
30
|
+
NanaSQLiteConnectionError,
|
|
31
|
+
NanaSQLiteDatabaseError,
|
|
32
|
+
NanaSQLiteError,
|
|
33
|
+
NanaSQLiteLockError,
|
|
34
|
+
NanaSQLiteTransactionError,
|
|
35
|
+
NanaSQLiteValidationError,
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
__version__ = "1.3.3dev4"
|
|
39
|
+
__author__ = "Disnana"
|
|
40
|
+
__all__ = [
|
|
41
|
+
"NanaSQLite",
|
|
42
|
+
"AsyncNanaSQLite",
|
|
43
|
+
"CacheType",
|
|
44
|
+
"NanaSQLiteError",
|
|
45
|
+
"NanaSQLiteValidationError",
|
|
46
|
+
"NanaSQLiteDatabaseError",
|
|
47
|
+
"NanaSQLiteTransactionError",
|
|
48
|
+
"NanaSQLiteConnectionError",
|
|
49
|
+
"NanaSQLiteLockError",
|
|
50
|
+
"NanaSQLiteCacheError",
|
|
51
|
+
"NanaSQLiteClosedError",
|
|
52
|
+
]
|