MySQLX 2.2.2__tar.gz → 2.2.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mysqlx
3
- Version: 2.2.2
3
+ Version: 2.2.4
4
4
  Summary: A thread safe sql executor for MySQL like MyBatis with connection pool. It helps you automatically manage database connections and transactions. It also provides ORM operations for single tables.
5
5
  Home-page: https://gitee.com/summry/mysqlx
6
6
  Author: summy
@@ -11,8 +11,10 @@ from sqlexecx import (
11
11
  init as _init
12
12
  )
13
13
 
14
+ from .support import InitArgs
14
15
  from .sql_mapper import sql, mapper
15
16
 
17
+
16
18
  def init_db(*args, **kwargs):
17
19
  """
18
20
  Compliant with the Python DB API 2.0 (PEP-249).
@@ -30,15 +32,13 @@ def init_db(*args, **kwargs):
30
32
  :param pool_size=0: int, default 0, size of connection pool
31
33
  :param show_sql=False: bool, if True, print sql
32
34
  :param debug=False: bool, if True, print debug context
33
- :param trans_placeholder=True: bool, if True, sql placeholder '?' --> '%s'
34
35
 
35
36
  Other parameters of connection pool refer to DBUtils: https://webwareforpython.github.io/DBUtils/main.html#pooleddb-pooled-db
36
37
  """
37
- from .constant import MAPPER_PATH
38
38
  from .sql_holder import load_mapper
39
39
 
40
40
  # Dialect.init(Engine.MYSQL)
41
- mapper_path = kwargs.pop(MAPPER_PATH) if MAPPER_PATH in kwargs else None
41
+ mapper_path = kwargs.pop(InitArgs.MAPPER_PATH) if InitArgs.MAPPER_PATH in kwargs else None
42
42
  _init(*args, **kwargs)
43
43
  if mapper_path:
44
44
  load_mapper(mapper_path)
@@ -4,6 +4,4 @@ SQL_CACHE_SIZE = CACHE_SIZE << 1
4
4
 
5
5
  MODULE = 'MySQLX'
6
6
 
7
- MAPPER_PATH = 'mapper_path'
8
-
9
7
  DYNAMIC_REGEX = '{%|{{|}}|%}'
@@ -4,7 +4,7 @@ from functools import lru_cache
4
4
  from .log_support import page_log
5
5
  from .constant import DYNAMIC_REGEX, SQL_CACHE_SIZE
6
6
 
7
- from sqlexecx.sql_support import get_named_sql_args, is_mapping, get_mapping_sql_args, try_mapping
7
+ from sqlexecx.sql_support import get_named_sql_args, is_mapping, get_mapping_sql_args, try_mapping, get_batch_args
8
8
 
9
9
 
10
10
  def simple_sql(sql: str, *args, **kwargs):
@@ -0,0 +1,35 @@
1
+ from enum import Enum
2
+ from sqlexecutorx import DBError, InitArgs as _InitArgs
3
+
4
+
5
+ class MapperError(DBError):
6
+ pass
7
+
8
+
9
+ class NotFoundError(DBError):
10
+ pass
11
+
12
+
13
+ class SqlAction(Enum):
14
+ CALL = 'call'
15
+ INSERT = 'insert'
16
+ UPDATE = 'update'
17
+ DELETE = 'delete'
18
+ SELECT = 'select'
19
+
20
+
21
+ class InitArgs(_InitArgs):
22
+ """
23
+ Args:
24
+ HOST = 'host' \n
25
+ PORT = 'port' \n
26
+ USER = 'user' \n
27
+ PASSWORD = 'password' \n
28
+ DATABASE = 'database' \n
29
+ DRIVER = 'driver' \n
30
+ DEBUG = 'debug' \n
31
+ SHOW_SQL = 'show_sql' \n
32
+ POOL_SIZE = 'pool_size' \n
33
+ MAPPER_PATH = 'mapper_path'
34
+ """
35
+ MAPPER_PATH = 'mapper_path'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mysqlx
3
- Version: 2.2.2
3
+ Version: 2.2.4
4
4
  Summary: A thread safe sql executor for MySQL like MyBatis with connection pool. It helps you automatically manage database connections and transactions. It also provides ORM operations for single tables.
5
5
  Home-page: https://gitee.com/summry/mysqlx
6
6
  Author: summy
@@ -0,0 +1,2 @@
1
+ Jinja2>=2.7.0
2
+ sqlexecx>=2.1.3
@@ -19,9 +19,9 @@ setup(
19
19
  long_description_content_type='text/markdown',
20
20
  install_requires=[
21
21
  'Jinja2>=2.7.0',
22
- 'sqlexecx>=2.1.1',
22
+ 'sqlexecx>=2.1.3',
23
23
  ],
24
- version='2.2.2',
24
+ version='2.2.4',
25
25
  url='https://gitee.com/summry/mysqlx',
26
26
  author='summy',
27
27
  author_email='xiazhongbiao@126.com',
@@ -1,20 +0,0 @@
1
- from enum import Enum
2
-
3
- # Don't remove. Import for not repetitive implementation
4
- from sqlexecutorx import DBError
5
-
6
-
7
- class MapperError(DBError):
8
- pass
9
-
10
-
11
- class NotFoundError(DBError):
12
- pass
13
-
14
-
15
- class SqlAction(Enum):
16
- CALL = 'call'
17
- INSERT = 'insert'
18
- UPDATE = 'update'
19
- DELETE = 'delete'
20
- SELECT = 'select'
@@ -1,2 +0,0 @@
1
- Jinja2>=2.7.0
2
- sqlexecx>=2.1.1
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