cloudoll 3.0.7__tar.gz → 3.0.8__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.
Files changed (47) hide show
  1. {cloudoll-3.0.7 → cloudoll-3.0.8}/PKG-INFO +1 -1
  2. cloudoll-3.0.8/cloudoll/__init__.py +1 -0
  3. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/orm/__init__.py +5 -2
  4. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/orm/awsmysql.py +1 -1
  5. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/orm/awspostgres.py +2 -2
  6. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/orm/mysql.py +1 -1
  7. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/orm/postgres.py +8 -16
  8. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll.egg-info/PKG-INFO +1 -1
  9. {cloudoll-3.0.7 → cloudoll-3.0.8}/pyproject.toml +1 -1
  10. cloudoll-3.0.7/cloudoll/__init__.py +0 -1
  11. {cloudoll-3.0.7 → cloudoll-3.0.8}/LICENSE +0 -0
  12. {cloudoll-3.0.7 → cloudoll-3.0.8}/README.md +0 -0
  13. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/__main__.py +0 -0
  14. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/cli.py +0 -0
  15. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/clitool/__init__.py +0 -0
  16. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/clitool/cli_main.py +0 -0
  17. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/clitool/m2d.py +0 -0
  18. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/clitool/process.py +0 -0
  19. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/clitool/spinner.py +0 -0
  20. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/clitool/watch.py +0 -0
  21. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/logging/__init__.py +0 -0
  22. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/mail/__init__.py +0 -0
  23. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/mail/smtp.py +0 -0
  24. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/orm/base.py +0 -0
  25. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/orm/err.py +0 -0
  26. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/orm/field.py +0 -0
  27. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/orm/model.py +0 -0
  28. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/orm/parse.py +0 -0
  29. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/orm/test_sql.py +0 -0
  30. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/template/__init__.py +0 -0
  31. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/utils/__init__.py +0 -0
  32. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/utils/common.py +0 -0
  33. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/utils/snowflake.py +0 -0
  34. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/web/__init__.py +0 -0
  35. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/web/core.py +0 -0
  36. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/web/exception.py +0 -0
  37. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/web/html.py +0 -0
  38. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/web/jwt.py +0 -0
  39. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/web/requests.py +0 -0
  40. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll/web/settings.py +0 -0
  41. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll.egg-info/SOURCES.txt +0 -0
  42. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll.egg-info/dependency_links.txt +0 -0
  43. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll.egg-info/entry_points.txt +0 -0
  44. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll.egg-info/requires.txt +0 -0
  45. {cloudoll-3.0.7 → cloudoll-3.0.8}/cloudoll.egg-info/top_level.txt +0 -0
  46. {cloudoll-3.0.7 → cloudoll-3.0.8}/setup.cfg +0 -0
  47. {cloudoll-3.0.7 → cloudoll-3.0.8}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cloudoll
3
- Version: 3.0.7
3
+ Version: 3.0.8
4
4
  Summary: Assist in quickly creating distributable microservices based on aiohttp, with a focus on simplicity and ease of use.
5
5
  Home-page: https://github.com/smallerqiu/cloudoll-py
6
6
  Author: Qiu
@@ -0,0 +1 @@
1
+ __version__ = "3.0.8"
@@ -3,8 +3,7 @@ from cloudoll.orm.parse import parse_coon
3
3
  import aiopg as pg
4
4
  from .mysql import Mysql
5
5
  from .postgres import Postgres
6
- from .awspostgres import AwsPostgres
7
- from .awsmysql import AwsMysql
6
+
8
7
 
9
8
  __all__ = ["create_engine"]
10
9
 
@@ -27,8 +26,12 @@ async def create_engine(**kw):
27
26
  if driver == "mysql":
28
27
  return await Mysql().create_engine(**configs, **query)
29
28
  elif driver == "aws-mysql":
29
+ from .awsmysql import AwsMysql
30
+
30
31
  return await AwsMysql().create_engine(**configs, **query)
31
32
  elif driver in ["aws-postgres", "aws-postgressql"]:
33
+ from .awspostgres import AwsPostgres
34
+
32
35
  return await AwsPostgres().create_engine(**configs, **query)
33
36
  elif driver in ["postgres", "postgressql"]:
34
37
  return await Postgres().create_engine(**configs, **query)
@@ -34,7 +34,7 @@ class AwsMysql(MeteBase):
34
34
  with AwsWrapperConnection.connect(
35
35
  Connect, self._dsn, **self._params
36
36
  ) as conn:
37
- with conn.cursor() as cursor:
37
+ with conn.cursor(dictionary=True) as cursor:
38
38
  if (
39
39
  query_type == QueryTypes.CREATEBATCH
40
40
  or query_type == QueryTypes.UPDATEBATCH
@@ -7,7 +7,7 @@ from aws_advanced_python_wrapper.sql_alchemy_connection_provider import (
7
7
 
8
8
  from cloudoll.orm.base import MeteBase, QueryTypes
9
9
  from cloudoll.logging import info, error
10
-
10
+ from psycopg2.extras import RealDictCursor
11
11
 
12
12
  class AwsPostgres(MeteBase):
13
13
  def __init__(self):
@@ -33,7 +33,7 @@ class AwsPostgres(MeteBase):
33
33
  with AwsWrapperConnection.connect(
34
34
  psycopg.Connection.connect, self._dsn, **self._params
35
35
  ) as conn:
36
- with conn.cursor() as cursor:
36
+ with conn.cursor(cursor_factory=RealDictCursor) as cursor:
37
37
  if (
38
38
  query_type == QueryTypes.CREATEBATCH
39
39
  or query_type == QueryTypes.UPDATEBATCH
@@ -19,7 +19,7 @@ class AttrDictCursor(aiomysql.DictCursor):
19
19
 
20
20
  class Mysql(MeteBase):
21
21
  def __init__(self):
22
- self.pool: aiomysql.Pool
22
+ self.pool: Optional[aiomysql.Pool] = None
23
23
  self.driver = "mysql"
24
24
 
25
25
  def __call__(self, *args: Any, **kwds: Any) -> Any:
@@ -1,4 +1,5 @@
1
1
  import aiopg
2
+ from psycopg2.extras import RealDictCursor
2
3
  from cloudoll.logging import error
3
4
  from cloudoll.orm.base import MeteBase, QueryTypes
4
5
  from cloudoll.logging import info, error
@@ -35,7 +36,7 @@ class Postgres(MeteBase):
35
36
  if conn.echo:
36
37
  info("sql: %s ,%s", sql, params)
37
38
 
38
- async with conn.cursor() as cursor:
39
+ async with conn.cursor(cursor_factory=RealDictCursor) as cursor:
39
40
  # current_cursor = getattr(cursor, 'lastrowid', None)
40
41
  if (
41
42
  query_type == QueryTypes.CREATEBATCH
@@ -48,21 +49,12 @@ class Postgres(MeteBase):
48
49
  # await conn.commit()
49
50
  result = None
50
51
 
51
- if query_type == QueryTypes.ALL and cursor.description is not None:
52
- columns = [desc[0] for desc in cursor.description]
53
- rows = await cursor.fetchall()
54
- result = [dict(zip(columns, row)) for row in rows]
55
- return result
56
- elif query_type == QueryTypes.ONE and cursor.description is not None:
57
- columns = [desc[0] for desc in cursor.description]
58
- row = await cursor.fetchone()
59
- result = dict(zip(columns, row)) if row else {}
60
- return result
61
- elif query_type == QueryTypes.MANY and cursor.description is not None:
62
- columns = [desc[0] for desc in cursor.description]
63
- rows = await cursor.fetchmany(size)
64
- result = [dict(zip(columns, row)) for row in rows]
65
- return result
52
+ if query_type == QueryTypes.ALL:
53
+ return await cursor.fetchall()
54
+ elif query_type == QueryTypes.ONE:
55
+ return await cursor.fetchone()
56
+ elif query_type == QueryTypes.MANY:
57
+ return await cursor.fetchmany(size)
66
58
  elif query_type == QueryTypes.COUNT:
67
59
  result = await cursor.fetchone()
68
60
  count = 0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cloudoll
3
- Version: 3.0.7
3
+ Version: 3.0.8
4
4
  Summary: Assist in quickly creating distributable microservices based on aiohttp, with a focus on simplicity and ease of use.
5
5
  Home-page: https://github.com/smallerqiu/cloudoll-py
6
6
  Author: Qiu
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "cloudoll"
7
- version = "3.0.7"
7
+ version = "3.0.8"
8
8
  description = "Assist in quickly creating distributable microservices based on aiohttp, with a focus on simplicity and ease of use."
9
9
  authors = [
10
10
  {name = "Qiu", email = "smallerqiu@gmail.com"},
@@ -1 +0,0 @@
1
- __version__ = "3.0.7"
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
File without changes
File without changes
File without changes
File without changes
File without changes