MySQLX 2.2.8__tar.gz → 2.2.9__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.
- {MySQLX-2.2.8 → MySQLX-2.2.9/MySQLX.egg-info}/PKG-INFO +2 -2
- MySQLX-2.2.9/MySQLX.egg-info/requires.txt +2 -0
- {MySQLX-2.2.8/MySQLX.egg-info → MySQLX-2.2.9}/PKG-INFO +2 -2
- {MySQLX-2.2.8 → MySQLX-2.2.9}/README.rst +1 -1
- {MySQLX-2.2.8 → MySQLX-2.2.9}/mysqlx/sql_support.py +6 -2
- {MySQLX-2.2.8 → MySQLX-2.2.9}/setup.py +2 -2
- MySQLX-2.2.8/MySQLX.egg-info/requires.txt +0 -2
- {MySQLX-2.2.8 → MySQLX-2.2.9}/LICENSE +0 -0
- {MySQLX-2.2.8 → MySQLX-2.2.9}/MySQLX.egg-info/SOURCES.txt +0 -0
- {MySQLX-2.2.8 → MySQLX-2.2.9}/MySQLX.egg-info/dependency_links.txt +0 -0
- {MySQLX-2.2.8 → MySQLX-2.2.9}/MySQLX.egg-info/not-zip-safe +0 -0
- {MySQLX-2.2.8 → MySQLX-2.2.9}/MySQLX.egg-info/top_level.txt +0 -0
- {MySQLX-2.2.8 → MySQLX-2.2.9}/mysqlx/__init__.py +0 -0
- {MySQLX-2.2.8 → MySQLX-2.2.9}/mysqlx/constant.py +0 -0
- {MySQLX-2.2.8 → MySQLX-2.2.9}/mysqlx/db.py +0 -0
- {MySQLX-2.2.8 → MySQLX-2.2.9}/mysqlx/dbx.py +0 -0
- {MySQLX-2.2.8 → MySQLX-2.2.9}/mysqlx/log_support.py +0 -0
- {MySQLX-2.2.8 → MySQLX-2.2.9}/mysqlx/sql_holder.py +0 -0
- {MySQLX-2.2.8 → MySQLX-2.2.9}/mysqlx/sql_id_exec.py +0 -0
- {MySQLX-2.2.8 → MySQLX-2.2.9}/mysqlx/sql_mapper.py +0 -0
- {MySQLX-2.2.8 → MySQLX-2.2.9}/mysqlx/sql_page_exec.py +0 -0
- {MySQLX-2.2.8 → MySQLX-2.2.9}/mysqlx/support.py +0 -0
- {MySQLX-2.2.8 → MySQLX-2.2.9}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: MySQLX
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.9
|
|
4
4
|
Summary: A thread safe sql executor for MySQL like MyBatis with connection pool. It helps you automatically manage database connections and transactions.
|
|
5
5
|
Home-page: https://gitee.com/summry/mysqlx
|
|
6
6
|
Author: summy
|
|
@@ -172,7 +172,7 @@ Transaction
|
|
|
172
172
|
|
|
173
173
|
If you want to use ORM, may be you need SQLORMX: https://pypi.org/project/sqlormx
|
|
174
174
|
|
|
175
|
-
If you want to operate PostgreSQL database, may be you need
|
|
175
|
+
If you want to operate PostgreSQL database, may be you need PgSQLX: https://pypi.org/project/pgsqlx
|
|
176
176
|
|
|
177
177
|
If you just wanted a simple sql executor, may be you need SQLExecX: https://pypi.org/project/sqlexecx
|
|
178
178
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: MySQLX
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.9
|
|
4
4
|
Summary: A thread safe sql executor for MySQL like MyBatis with connection pool. It helps you automatically manage database connections and transactions.
|
|
5
5
|
Home-page: https://gitee.com/summry/mysqlx
|
|
6
6
|
Author: summy
|
|
@@ -172,7 +172,7 @@ Transaction
|
|
|
172
172
|
|
|
173
173
|
If you want to use ORM, may be you need SQLORMX: https://pypi.org/project/sqlormx
|
|
174
174
|
|
|
175
|
-
If you want to operate PostgreSQL database, may be you need
|
|
175
|
+
If you want to operate PostgreSQL database, may be you need PgSQLX: https://pypi.org/project/pgsqlx
|
|
176
176
|
|
|
177
177
|
If you just wanted a simple sql executor, may be you need SQLExecX: https://pypi.org/project/sqlexecx
|
|
178
178
|
|
|
@@ -158,7 +158,7 @@ Transaction
|
|
|
158
158
|
|
|
159
159
|
If you want to use ORM, may be you need SQLORMX: https://pypi.org/project/sqlormx
|
|
160
160
|
|
|
161
|
-
If you want to operate PostgreSQL database, may be you need
|
|
161
|
+
If you want to operate PostgreSQL database, may be you need PgSQLX: https://pypi.org/project/pgsqlx
|
|
162
162
|
|
|
163
163
|
If you just wanted a simple sql executor, may be you need SQLExecX: https://pypi.org/project/sqlexecx
|
|
164
164
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import os
|
|
1
2
|
import re
|
|
2
3
|
from jinja2 import Template
|
|
3
4
|
from functools import lru_cache
|
|
@@ -6,6 +7,9 @@ from .constant import DYNAMIC_REGEX, SQL_CACHE_SIZE
|
|
|
6
7
|
|
|
7
8
|
from sqlexecx.sql_support import get_named_sql_args, is_mapping, get_mapping_sql_args, try_mapping, get_batch_args
|
|
8
9
|
|
|
10
|
+
sql_cache_size = int(os.getenv('SQL_CACHE_SIZE', SQL_CACHE_SIZE))
|
|
11
|
+
print(f'======== SQL_CACHE_SIZE: {sql_cache_size}')
|
|
12
|
+
|
|
9
13
|
|
|
10
14
|
def simple_sql(sql: str, *args, **kwargs):
|
|
11
15
|
return get_named_sql_args(sql, **kwargs) if kwargs else (sql, args)
|
|
@@ -23,12 +27,12 @@ def get_page_start(page_num: int, page_size: int):
|
|
|
23
27
|
return (page_num - 1) * page_size
|
|
24
28
|
|
|
25
29
|
|
|
26
|
-
@lru_cache(maxsize=
|
|
30
|
+
@lru_cache(maxsize=sql_cache_size)
|
|
27
31
|
def is_dynamic_sql(sql: str):
|
|
28
32
|
return re.search(DYNAMIC_REGEX, sql) is not None
|
|
29
33
|
|
|
30
34
|
|
|
31
|
-
@lru_cache(maxsize=
|
|
35
|
+
@lru_cache(maxsize=sql_cache_size)
|
|
32
36
|
def _get_sql_type(sql: str):
|
|
33
37
|
"""
|
|
34
38
|
:return: 0: placeholder, 1: dynamic, 2: named mapping
|
|
@@ -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.
|
|
22
|
+
'sqlexecx>=2.1.9',
|
|
23
23
|
],
|
|
24
|
-
version='2.2.
|
|
24
|
+
version='2.2.9',
|
|
25
25
|
url='https://gitee.com/summry/mysqlx',
|
|
26
26
|
author='summy',
|
|
27
27
|
author_email='xiazhongbiao@126.com',
|
|
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
|
|
File without changes
|